- consolidated a bit of dead content in .def parser.

This commit is contained in:
Christoph Oelckers 2021-04-08 20:03:50 +02:00
parent c9483353ff
commit 9f08f9786a
2 changed files with 13 additions and 46 deletions

View file

@ -387,38 +387,12 @@ static int32_t defsparser(scriptfile *script)
} }
break; break;
case T_SPRITECOL: case T_SPRITECOL:
{
int32_t tile,col,col2;
if (scriptfile_getsymbol(script,&tile)) break;
if (scriptfile_getnumber(script,&col)) break;
if (scriptfile_getnumber(script,&col2)) break;
}
break;
case T_2DCOL:
{
int32_t col,b,g,r;
if (scriptfile_getnumber(script,&col)) break;
if (scriptfile_getnumber(script,&r)) break;
if (scriptfile_getnumber(script,&g)) break;
if (scriptfile_getnumber(script,&b)) break;
if ((unsigned)col < 256)
{
}
}
break;
case T_2DCOLIDXRANGE: // NOTE: takes precedence over 2dcol, see InitCustomColors() case T_2DCOLIDXRANGE: // NOTE: takes precedence over 2dcol, see InitCustomColors()
{ parseSkip<3>(*script, pos);
int32_t col, idx, idxend; break;
case T_2DCOL:
if (scriptfile_getnumber(script,&col)) break; parseSkip<4>(*script, pos);
if (scriptfile_getnumber(script,&idx)) break; break;
if (scriptfile_getnumber(script,&idxend)) break;
}
break;
case T_FOGPAL: case T_FOGPAL:
{ {
int32_t p,r,g,b; int32_t p,r,g,b;
@ -461,15 +435,9 @@ static int32_t defsparser(scriptfile *script)
} }
break; break;
case T_CACHESIZE: case T_CACHESIZE:
{
int32_t j;
if (scriptfile_getnumber(script,&j)) break;
}
break;
case T_SHADEFACTOR: case T_SHADEFACTOR:
//scriptfile_getnumber(script, &realmaxshade); case T_GLOBALGAMEFLAGS:
//frealmaxshade = (float)realmaxshade; parseSkip<1>(*script, pos);
break; break;
case T_ARTFILE: case T_ARTFILE:
{ {
@ -2087,13 +2055,6 @@ static int32_t defsparser(scriptfile *script)
} }
break; break;
case T_GLOBALGAMEFLAGS:
{
int32_t dummy;
if (scriptfile_getnumber(script,&dummy)) break;
}
break;
case T_MULTIPSKY: case T_MULTIPSKY:
{ {
FScanner::SavedPos blockend; FScanner::SavedPos blockend;

View file

@ -45,6 +45,12 @@ void tileRemoveReplacement(int num);
// //
//=========================================================================== //===========================================================================
template<int cnt>
void parseSkip(FScanner& sc, FScriptPosition& pos)
{
for (int i = 0; i < cnt; i++) if (!sc.GetNumber(true)) return;
}
void parseDefineTexture(FScanner& sc, FScriptPosition& pos) void parseDefineTexture(FScanner& sc, FScriptPosition& pos)
{ {
int tile, palette; int tile, palette;