mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 23:33:00 +00:00
Modify to have one GetVertexZ rather than IsVertexZSet / GetVertexZ
This commit is contained in:
parent
a58acfc625
commit
f049421831
2 changed files with 19 additions and 22 deletions
|
@ -443,30 +443,28 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetVertexZ)
|
|||
PARAM_UINT(vertex);
|
||||
PARAM_INT(planeval);
|
||||
|
||||
if (vertex < self->Level->vertexes.Size() && vertex < self->loader->vertexdatas.Size())
|
||||
{
|
||||
vertexdata_t& data = self->loader->vertexdatas[vertex];
|
||||
double value = planeval ? data.zFloor : data.zCeiling;
|
||||
ACTION_RETURN_FLOAT(value);
|
||||
}
|
||||
|
||||
ACTION_RETURN_FLOAT(0);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, IsVertexZSet)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
|
||||
PARAM_UINT(vertex);
|
||||
PARAM_INT(planeval);
|
||||
double value = 0;
|
||||
bool isset = false;
|
||||
|
||||
if (vertex < self->Level->vertexes.Size() && vertex < self->loader->vertexdatas.Size())
|
||||
{
|
||||
vertexdata_t& data = self->loader->vertexdatas[vertex];
|
||||
bool value = data.flags & (planeval ? VERTEXFLAG_ZFloorEnabled : VERTEXFLAG_ZCeilingEnabled);
|
||||
ACTION_RETURN_BOOL(value);
|
||||
value = planeval ? data.zFloor : data.zCeiling;
|
||||
isset = data.flags & (planeval ? VERTEXFLAG_ZFloorEnabled : VERTEXFLAG_ZCeilingEnabled);
|
||||
}
|
||||
|
||||
ACTION_RETURN_BOOL(false);
|
||||
if (numret > 1)
|
||||
{
|
||||
numret = 2;
|
||||
ret[1].SetInt(isset);
|
||||
}
|
||||
|
||||
if (numret > 0)
|
||||
{
|
||||
ret[0].SetFloat(value);
|
||||
}
|
||||
|
||||
return numret;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetVertexZ)
|
||||
|
@ -493,7 +491,7 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetVertexZ)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, UnsetVertexZ)
|
||||
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, RemoveVertexZ)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
|
||||
PARAM_UINT(vertex);
|
||||
|
|
|
@ -47,10 +47,9 @@ class LevelPostProcessor native play
|
|||
protected native void SetThingStringArgument(uint thing, Name value);
|
||||
|
||||
protected native void SetVertex(uint vertex, double x, double y);
|
||||
protected native double GetVertexZ(uint vertex, int plane);
|
||||
protected native bool IsVertexZSet(uint vertex, int plane);
|
||||
protected native double, bool GetVertexZ(uint vertex, int plane);
|
||||
protected native void SetVertexZ(uint vertex, int plane, double z);
|
||||
protected native void UnsetVertexZ(uint vertex, int plane);
|
||||
protected native void RemoveVertexZ(uint vertex, int plane);
|
||||
protected native void SetLineVertexes(uint Line, uint v1, uint v2);
|
||||
protected native void FlipLineSideRefs(uint Line);
|
||||
protected native void SetLineSectorRef(uint line, uint side, uint sector);
|
||||
|
|
Loading…
Reference in a new issue