From 1098a13fdba374cd6195e6a0ab658f455865a930 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 10 Nov 2019 09:04:30 -0500 Subject: [PATCH] - add 'FlipLine' to 'LevelPostProcessor' --- src/maploader/maploader.cpp | 16 ++++++++++++++++ wadsrc/static/zscript/level_postprocessor.zs | 1 + 2 files changed, 17 insertions(+) diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index 3159fa7b7..983cd31a2 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -3660,6 +3660,22 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetVertex) return 0; } +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, FlipLine) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(lineidx); + + line_t *line = &self->Level->lines[lineidx]; + vertex_t *v1 = line->v1; + vertex_t *v2 = line->v2; + + line->v1 = v2; + line->v2 = v1; + + self->loader->ForceNodeBuild = true; + return 0; +} + DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetLineSectorRef) { PARAM_SELF_PROLOGUE(DLevelPostProcessor); diff --git a/wadsrc/static/zscript/level_postprocessor.zs b/wadsrc/static/zscript/level_postprocessor.zs index afef058d5..fb2ac6d95 100644 --- a/wadsrc/static/zscript/level_postprocessor.zs +++ b/wadsrc/static/zscript/level_postprocessor.zs @@ -47,6 +47,7 @@ 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 SetLineSectorRef(uint line, uint side, uint sector); protected native Actor GetDefaultActor(Name actorclass);