Add extra field to tilefromtexture

# Conflicts:
#	source/build/src/defs.cpp
This commit is contained in:
nukeykt 2019-07-24 00:56:39 +09:00 committed by Christoph Oelckers
parent ce43103ae9
commit a90711f328

View file

@ -123,6 +123,7 @@ enum scripttoken_t
T_SHADEFACTOR, T_SHADEFACTOR,
T_RFFDEFINEID, T_RFFDEFINEID,
T_IFCRC, T_IFCRC,
T_EXTRA,
T_NEWGAMECHOICES, T_NEWGAMECHOICES,
}; };
@ -796,10 +797,11 @@ static int32_t defsparser(scriptfile *script)
char *texturetokptr = script->ltextptr, *textureend, *fn = NULL; char *texturetokptr = script->ltextptr, *textureend, *fn = NULL;
int32_t tile = -1; int32_t tile = -1;
int32_t alphacut = 255, flags = 0; 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 xoffset = 0, yoffset = 0;
int32_t istexture = 0; int32_t istexture = 0;
int32_t tilecrc = 0, origcrc = 0; int32_t tilecrc = 0, origcrc = 0;
int32_t extra = 0;
static const tokenlist tilefromtexturetokens[] = static const tokenlist tilefromtexturetokens[] =
{ {
@ -814,6 +816,7 @@ static int32_t defsparser(scriptfile *script)
{ "nofullbright", T_NOFULLBRIGHT }, { "nofullbright", T_NOFULLBRIGHT },
{ "texture", T_TEXTURE }, { "texture", T_TEXTURE },
{ "ifcrc", T_IFCRC }, { "ifcrc", T_IFCRC },
{ "extra", T_EXTRA },
}; };
if (scriptfile_getsymbol(script,&tile)) break; if (scriptfile_getsymbol(script,&tile)) break;
@ -852,6 +855,10 @@ static int32_t defsparser(scriptfile *script)
case T_TEXTURE: case T_TEXTURE:
istexture = 1; istexture = 1;
break; break;
case T_EXTRA:
haveextra = 1;
scriptfile_getsymbol(script, &extra);
break;
default: default:
break; break;
} }
@ -882,6 +889,8 @@ static int32_t defsparser(scriptfile *script)
picanm[tile].xofs = xoffset; picanm[tile].xofs = xoffset;
if (haveyoffset) if (haveyoffset)
picanm[tile].yofs = yoffset; picanm[tile].yofs = yoffset;
if (haveextra)
picanm[tile].extra = extra;
if (EDUKE32_PREDICT_FALSE(flags == 0 && !havexoffset && !haveyoffset)) if (EDUKE32_PREDICT_FALSE(flags == 0 && !havexoffset && !haveyoffset))
initprintf("\nError: missing 'file name' for tilefromtexture definition near line %s:%d", 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; picanm[tile].yofs = yoffset;
else if (texstatus == 0) else if (texstatus == 0)
picanm[tile].yofs = 0; picanm[tile].yofs = 0;
if (haveextra)
picanm[tile].extra = extra;
} }
break; break;
case T_COPYTILE: case T_COPYTILE: