From 512411d0fad61956b7545f52458f56ae1251f4cc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Apr 2021 21:02:14 +0200 Subject: [PATCH] - parseUndefTexture(Range) --- source/build/src/defs.cpp | 24 ++++-------------------- source/core/parsefuncs.h | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 6cda5fd9f..417c337f7 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -1085,27 +1085,11 @@ static int32_t defsparser(scriptfile *script) break; case T_UNDEFTEXTURE: + parseUndefTexture(*script, pos); + break; case T_UNDEFTEXTURERANGE: - { - int32_t r0,r1; - if (scriptfile_getsymbol(script,&r0)) break; - if (tokn == T_UNDEFTEXTURERANGE) - { - if (scriptfile_getsymbol(script,&r1)) break; - - if (check_tile_range("undeftexturerange", &r0, &r1, script, pos)) - break; - } - else - { - r1 = r0; - - if (check_tile("undeftexture", r0, script, pos)) - break; - } - for (; r0 <= r1; r0++) tileRemoveReplacement(r0); - } - break; + parseUndefTextureRange(*script, pos); + break; case T_TEXHITSCANRANGE: parseTexHitscanRange(*script, pos); diff --git a/source/core/parsefuncs.h b/source/core/parsefuncs.h index c8e677b44..198c8d404 100644 --- a/source/core/parsefuncs.h +++ b/source/core/parsefuncs.h @@ -207,6 +207,33 @@ void parseTexture(FScanner& sc, FScriptPosition& pos) // //=========================================================================== +void parseUndefTexture(FScanner& sc, FScriptPosition& pos) +{ + if (!sc.GetNumber(true)) return; + if (ValidateTilenum("undeftexture", sc.Number, pos)) tileRemoveReplacement(sc.Number); +} + +//=========================================================================== +// +// +// +//=========================================================================== + +void parseUndefTextureRange(FScanner& sc, FScriptPosition& pos) +{ + int start, end; + if (!sc.GetNumber(start, true)) return; + if (!sc.GetNumber(end, true)) return; + if (ValidateTileRange("undeftexturerange", start, end, pos)) + for (int i = start; i <= end; i++) tileRemoveReplacement(i); +} + +//=========================================================================== +// +// +// +//=========================================================================== + void parseTileFromTexture(FScanner& sc, FScriptPosition& pos) { FScanner::SavedPos blockend;