mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-18 22:51:39 +00:00
- new zscript function 'SetLineVertexes(line, v1, v2)'
- scriptify 'FlipLine' completely using new function, remove native version
This commit is contained in:
parent
a4b6a8f093
commit
21a74dfb13
2 changed files with 18 additions and 8 deletions
|
@ -437,20 +437,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 < self->Level->lines.Size())
|
||||
if (lineidx < self->Level->lines.Size() &&
|
||||
vertexidx1 < self->Level->vertexes.Size() &&
|
||||
vertexidx2 < self->Level->vertexes.Size())
|
||||
{
|
||||
line_t *line = &self->Level->lines[lineidx];
|
||||
vertex_t *v1 = line->v1;
|
||||
vertex_t *v2 = line->v2;
|
||||
|
||||
line->v1 = v2;
|
||||
line->v2 = v1;
|
||||
vertex_t *vertex1 = &self->Level->vertexes[vertexidx1];
|
||||
vertex_t *vertex2 = &self->Level->vertexes[vertexidx2];
|
||||
|
||||
line->v1 = vertex1;
|
||||
line->v2 = vertex2;
|
||||
}
|
||||
self->loader->ForceNodeBuild = true;
|
||||
return 0;
|
||||
|
|
|
@ -47,10 +47,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