From 9b495ea67fb3e8beabbbc55d69d6737cbc0603fb Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 23 May 2018 05:43:35 +0000 Subject: [PATCH] Ensure that anywhere the def parser takes a tilenum or palnum accepts defined tokens in addition to integer literals, if it doesn't already. Affects fogpal, nofloorpalrange, setuptilerange, dummytilerange, undefinetilerange, definemodelframe, definevoxeltiles, texhitscanrange, nofullbrightrange, and light. git-svn-id: https://svn.eduke32.com/eduke32@6896 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/defs.cpp | 32 ++++++++++++++++---------------- source/build/src/mhk.cpp | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 50d92b451..f4ce48b2a 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -595,7 +595,7 @@ static int32_t defsparser(scriptfile *script) { int32_t p,r,g,b; - if (scriptfile_getnumber(script,&p)) break; + if (scriptfile_getsymbol(script,&p)) break; if (scriptfile_getnumber(script,&r)) break; if (scriptfile_getnumber(script,&g)) break; if (scriptfile_getnumber(script,&b)) break; @@ -611,8 +611,8 @@ static int32_t defsparser(scriptfile *script) { int32_t b,e,i; - if (scriptfile_getnumber(script,&b)) break; - if (scriptfile_getnumber(script,&e)) break; + if (scriptfile_getsymbol(script,&b)) break; + if (scriptfile_getsymbol(script,&e)) break; b = max(b, 1); e = min(e, MAXPALOOKUPS-1); @@ -722,8 +722,8 @@ static int32_t defsparser(scriptfile *script) { int32_t tile1,tile2,xsiz,ysiz,xoffs,yoffs,i; - if (scriptfile_getnumber(script,&tile1)) break; - if (scriptfile_getnumber(script,&tile2)) break; + if (scriptfile_getsymbol(script,&tile1)) break; + if (scriptfile_getsymbol(script,&tile2)) break; if (scriptfile_getnumber(script,&xsiz)) break; if (scriptfile_getnumber(script,&ysiz)) break; if (scriptfile_getsymbol(script,&xoffs)) break; @@ -1058,8 +1058,8 @@ static int32_t defsparser(scriptfile *script) { int32_t tile1,tile2,xsiz,ysiz,i; - if (scriptfile_getnumber(script,&tile1)) break; - if (scriptfile_getnumber(script,&tile2)) break; + if (scriptfile_getsymbol(script,&tile1)) break; + if (scriptfile_getsymbol(script,&tile2)) break; if (scriptfile_getnumber(script,&xsiz)) break; if (scriptfile_getnumber(script,&ysiz)) break; @@ -1103,8 +1103,8 @@ static int32_t defsparser(scriptfile *script) { int32_t tile1, tile2; - if (scriptfile_getnumber(script,&tile1)) break; - if (scriptfile_getnumber(script,&tile2)) break; + if (scriptfile_getsymbol(script,&tile1)) break; + if (scriptfile_getsymbol(script,&tile2)) break; if (check_tile_range("undefinetilerange", &tile1, &tile2, script, cmdtokptr)) break; @@ -1152,8 +1152,8 @@ static int32_t defsparser(scriptfile *script) int32_t ftilenume, ltilenume; if (scriptfile_getstring(script,&framename)) break; - if (scriptfile_getnumber(script,&ftilenume)) break; //first tile number - if (scriptfile_getnumber(script,<ilenume)) break; //last tile number (inclusive) + if (scriptfile_getsymbol(script,&ftilenume)) break; //first tile number + if (scriptfile_getsymbol(script,<ilenume)) break; //last tile number (inclusive) if (check_tile_range("definemodelframe", &ftilenume, <ilenume, script, cmdtokptr)) break; @@ -1311,8 +1311,8 @@ static int32_t defsparser(scriptfile *script) { int32_t ftilenume, ltilenume, tilex; - if (scriptfile_getnumber(script,&ftilenume)) break; //1st tile # - if (scriptfile_getnumber(script,<ilenume)) break; //last tile # + if (scriptfile_getsymbol(script,&ftilenume)) break; //1st tile # + if (scriptfile_getsymbol(script,<ilenume)) break; //last tile # if (check_tile_range("definevoxeltiles", &ftilenume, <ilenume, script, cmdtokptr)) break; @@ -1415,7 +1415,7 @@ static int32_t defsparser(scriptfile *script) switch (getatoken(script,modelframetokens,ARRAY_SIZE(modelframetokens))) { case T_PAL: - scriptfile_getnumber(script,&pal); break; + scriptfile_getsymbol(script,&pal); break; case T_FRAME: scriptfile_getstring(script,&framename); break; case T_TILE: @@ -2539,8 +2539,8 @@ static int32_t defsparser(scriptfile *script) { int32_t b,e, i; - if (EDUKE32_PREDICT_FALSE(scriptfile_getnumber(script,&b))) break; - if (EDUKE32_PREDICT_FALSE(scriptfile_getnumber(script,&e))) break; + if (EDUKE32_PREDICT_FALSE(scriptfile_getsymbol(script,&b))) break; + if (EDUKE32_PREDICT_FALSE(scriptfile_getsymbol(script,&e))) break; b = max(b, 0); e = min(e, MAXUSERTILES-1); diff --git a/source/build/src/mhk.cpp b/source/build/src/mhk.cpp index eeddd6917..0ac922632 100644 --- a/source/build/src/mhk.cpp +++ b/source/build/src/mhk.cpp @@ -303,7 +303,7 @@ int32_t engineLoadMHK(const char *filename) light.maxshade = value; scriptfile_getnumber(script, &value); light.priority = value; - scriptfile_getnumber(script, &value); + scriptfile_getsymbol(script, &value); light.tilenum = value; light.publicflags.emitshadow = 1;