From a90711f32804442cae1eb4c16c09a8f9a7c03b6c Mon Sep 17 00:00:00 2001 From: nukeykt Date: Wed, 24 Jul 2019 00:56:39 +0900 Subject: [PATCH] Add extra field to tilefromtexture # Conflicts: # source/build/src/defs.cpp --- source/build/src/defs.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index d28acb808..3db30b0f8 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -123,6 +123,7 @@ enum scripttoken_t T_SHADEFACTOR, T_RFFDEFINEID, T_IFCRC, + T_EXTRA, T_NEWGAMECHOICES, }; @@ -796,10 +797,11 @@ static int32_t defsparser(scriptfile *script) char *texturetokptr = script->ltextptr, *textureend, *fn = NULL; int32_t tile = -1; int32_t alphacut = 255, flags = 0; - int32_t havexoffset = 0, haveyoffset = 0; + int32_t havexoffset = 0, haveyoffset = 0, haveextra = 0; int32_t xoffset = 0, yoffset = 0; int32_t istexture = 0; int32_t tilecrc = 0, origcrc = 0; + int32_t extra = 0; static const tokenlist tilefromtexturetokens[] = { @@ -814,6 +816,7 @@ static int32_t defsparser(scriptfile *script) { "nofullbright", T_NOFULLBRIGHT }, { "texture", T_TEXTURE }, { "ifcrc", T_IFCRC }, + { "extra", T_EXTRA }, }; if (scriptfile_getsymbol(script,&tile)) break; @@ -852,6 +855,10 @@ static int32_t defsparser(scriptfile *script) case T_TEXTURE: istexture = 1; break; + case T_EXTRA: + haveextra = 1; + scriptfile_getsymbol(script, &extra); + break; default: break; } @@ -882,6 +889,8 @@ static int32_t defsparser(scriptfile *script) picanm[tile].xofs = xoffset; if (haveyoffset) picanm[tile].yofs = yoffset; + if (haveextra) + picanm[tile].extra = extra; if (EDUKE32_PREDICT_FALSE(flags == 0 && !havexoffset && !haveyoffset)) initprintf("\nError: missing 'file name' for tilefromtexture definition near line %s:%d", @@ -910,6 +919,9 @@ static int32_t defsparser(scriptfile *script) picanm[tile].yofs = yoffset; else if (texstatus == 0) picanm[tile].yofs = 0; + + if (haveextra) + picanm[tile].extra = extra; } break; case T_COPYTILE: