From f347a52e24c7c8a44770b4b435b32225501e59e7 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Fri, 27 Mar 2015 12:29:52 +0000 Subject: [PATCH] Defs: Add "nofloorpal " to "makepalookup", which, when specified, allows you to set exactly the value of g_noFloorPal that you want. git-svn-id: https://svn.eduke32.com/eduke32@5101 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/defs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index 49a9533d0..22c866cd0 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -69,6 +69,7 @@ enum scripttoken_t T_HIGHPALOOKUP, T_TINT, T_MAKEPALOOKUP, T_REMAPPAL, T_REMAPSELF, + T_NOFLOORPAL, T_RED,T_GREEN,T_BLUE, T_TEXTURE,T_ALPHACUT,T_XSCALE,T_YSCALE,T_SPECPOWER,T_SPECFACTOR,T_NOCOMPRESS,T_NODOWNSIZE, T_ORIGSIZEX,T_ORIGSIZEY, @@ -1718,6 +1719,7 @@ static int32_t defsparser(scriptfile *script) char *const starttokptr = script->ltextptr; int32_t red=0, green=0, blue=0, pal=-1; int32_t havepal=0, remappal=0; + int32_t nofloorpal=-1; char *endtextptr; static const tokenlist palookuptokens[] = @@ -1728,6 +1730,7 @@ static int32_t defsparser(scriptfile *script) { "blue", T_BLUE }, { "b", T_BLUE }, { "remappal", T_REMAPPAL }, { "remapself", T_REMAPSELF }, + { "nofloorpal", T_NOFLOORPAL }, }; enum { @@ -1771,6 +1774,10 @@ static int32_t defsparser(scriptfile *script) havepal |= HAVEPAL_ERROR; havepal |= HAVE_REMAPSELF; break; + case T_NOFLOORPAL: + scriptfile_getsymbol(script, &nofloorpal); + nofloorpal = clamp(nofloorpal, 0, 1); + break; } } @@ -1813,7 +1820,7 @@ static int32_t defsparser(scriptfile *script) // NOTE: all palookups are initialized, i.e. non-NULL! // NOTE2: aliasing (pal==remappal) is OK makepalookup(pal, palookup[remappal], red, green, blue, - remappal==0 ? 1 : g_noFloorPal[remappal]); + remappal==0 ? 1 : (nofloorpal == -1 ? g_noFloorPal[remappal] : nofloorpal)); } break; case T_TEXTURE: