- migrated a few more .def commands.

This commit is contained in:
Christoph Oelckers 2021-04-09 19:59:03 +02:00
parent 333581a084
commit 92697686cb

View file

@ -323,24 +323,11 @@ static int32_t defsparser(scriptfile *script)
break; break;
} }
case T_INCLUDEDEFAULT: case T_INCLUDEDEFAULT:
{
defsparser_include(G_DefaultDefFile(), script, &pos); defsparser_include(G_DefaultDefFile(), script, &pos);
break; break;
}
case T_DEFINE: case T_DEFINE:
{ parseDefine(*script, pos);
FString name;
int32_t number;
if (scriptfile_getstring(script,&name)) break;
if (scriptfile_getsymbol(script,&number)) break;
if (scriptfile_addsymbolvalue(script, name,number) < 0)
pos.Message(MSG_WARNING, "Warning: Symbol %s was NOT redefined to %d", name.GetChars(),number);
break; break;
}
// OLD (DEPRECATED) DEFINITION SYNTAX
case T_DEFINETEXTURE: case T_DEFINETEXTURE:
parseDefineTexture(*script, pos); parseDefineTexture(*script, pos);
break; break;
@ -348,44 +335,14 @@ static int32_t defsparser(scriptfile *script)
parseDefineSkybox(*script, pos); parseDefineSkybox(*script, pos);
break; break;
case T_DEFINETINT: case T_DEFINETINT:
{ parseDefineTint(*script, pos);
int32_t pal, r,g,b,f; break;
if (scriptfile_getsymbol(script,&pal)) break;
if (scriptfile_getnumber(script,&r)) break;
if (scriptfile_getnumber(script,&g)) break;
if (scriptfile_getnumber(script,&b)) break;
if (scriptfile_getnumber(script,&f)) break; //effects
lookups.setPaletteTint(pal,r,g,b,0,0,0,f);
}
break;
case T_ALPHAHACK: case T_ALPHAHACK:
{ parseAlphahack(*script, pos);
int32_t tile; break;
double alpha;
if (scriptfile_getsymbol(script,&tile)) break;
if (scriptfile_getdouble(script,&alpha)) break;
if ((uint32_t)tile < MAXTILES)
TileFiles.tiledata[tile].texture->alphaThreshold = (float)alpha;
}
break;
case T_ALPHAHACKRANGE: case T_ALPHAHACKRANGE:
{ parseAlphahackRange(*script, pos);
int32_t tilenume1,tilenume2; break;
double alpha;
if (scriptfile_getsymbol(script,&tilenume1)) break;
if (scriptfile_getsymbol(script,&tilenume2)) break;
if (scriptfile_getdouble(script,&alpha)) break;
if (check_tile_range("alphahackrange", &tilenume1, &tilenume2, script, pos))
break;
for (int i=tilenume1; i<=tilenume2; i++)
TileFiles.tiledata[i].texture->alphaThreshold = (float)alpha;
}
break;
case T_SPRITECOL: case T_SPRITECOL:
case T_2DCOLIDXRANGE: // NOTE: takes precedence over 2dcol, see InitCustomColors() case T_2DCOLIDXRANGE: // NOTE: takes precedence over 2dcol, see InitCustomColors()
parseSkip<3>(*script, pos); parseSkip<3>(*script, pos);