mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-04-22 15:47:19 +00:00
- new zscript function 'SetLineVertexes(line, v1, v2)'
- scriptify 'FlipLine' completely using new function, remove native version # Conflicts: # src/maploader/postprocessor.cpp
This commit is contained in:
parent
c6105a1e3f
commit
4878da381b
2 changed files with 18 additions and 8 deletions
|
@ -730,20 +730,23 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetVertex)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, FlipLine)
|
||||
DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetLineVertexes)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DLevelPostProcessor);
|
||||
PARAM_UINT(lineidx);
|
||||
PARAM_UINT(vertexidx1);
|
||||
PARAM_UINT(vertexidx2);
|
||||
|
||||
if (lineidx < level.lines.Size())
|
||||
if (lineidx < level.lines.Size() &&
|
||||
vertexidx1 < level.vertexes.Size() &&
|
||||
vertexidx2 < level.vertexes.Size())
|
||||
{
|
||||
line_t *line = &level.lines[lineidx];
|
||||
vertex_t *v1 = line->v1;
|
||||
vertex_t *v2 = line->v2;
|
||||
|
||||
line->v1 = v2;
|
||||
line->v2 = v1;
|
||||
vertex_t *vertex1 = &level.vertexes[vertexidx1];
|
||||
vertex_t *vertex2 = &level.vertexes[vertexidx2];
|
||||
|
||||
line->v1 = vertex1;
|
||||
line->v2 = vertex2;
|
||||
}
|
||||
ForceNodeBuild = true;
|
||||
return 0;
|
||||
|
|
|
@ -45,10 +45,17 @@ class LevelPostProcessor native play
|
|||
protected native void SetThingStringArgument(uint thing, Name value);
|
||||
|
||||
protected native void SetVertex(uint vertex, double x, double y);
|
||||
protected native void FlipLine(uint Line);
|
||||
protected native void SetLineVertexes(uint Line, uint v1, uint v2);
|
||||
protected native void SetLineSectorRef(uint line, uint side, uint sector);
|
||||
protected native Actor GetDefaultActor(Name actorclass);
|
||||
|
||||
protected void FlipLine(uint Line)
|
||||
{
|
||||
uint v1 = level.lines[Line].v1.Index();
|
||||
uint v2 = level.lines[Line].v2.Index();
|
||||
SetLineVertexes(Line, v2, v1);
|
||||
}
|
||||
|
||||
protected void SetWallTexture(int line, int side, int texpart, String texture)
|
||||
{
|
||||
SetWallTextureID(line, side, texpart, TexMan.CheckForTexture(texture, TexMan.Type_Wall));
|
||||
|
|
Loading…
Reference in a new issue