- rffdefineid

This commit is contained in:
Christoph Oelckers 2021-04-13 18:15:12 +02:00
parent 643b969dff
commit 40a632a2ae
2 changed files with 37 additions and 27 deletions

View file

@ -2303,36 +2303,11 @@ static int32_t defsparser(scriptfile *script)
}
break;
case T_NEWGAMECHOICES: // stub
{
FScanner::SavedPos blockend;
if (scriptfile_getbraces(script,&blockend))
break;
scriptfile_setposition(script, blockend);
parseNewGameChoices(*script, pos);
break;
}
case T_RFFDEFINEID:
{
FString resName;
FString resType;
FString rffName;
int resID;
if (scriptfile_getstring(script, &resName))
break;
if (scriptfile_getstring(script, &resType))
break;
if (scriptfile_getnumber(script, &resID))
break;
if (scriptfile_getstring(script, &rffName))
break;
FStringf name("%s.%s", resName.GetChars(), resType.GetChars());
fileSystem.CreatePathlessCopy(name, resID, 0);
}
parseRffDefineId(*script, pos);
break;

View file

@ -643,3 +643,38 @@ void parseMultiPsky(FScanner& sc, FScriptPosition& pos)
auto psky = tileSetupSky(sky.tilenum);
*psky = sky;
}
//===========================================================================
//
//
//
//===========================================================================
void parseRffDefineId(FScanner& sc, FScriptPosition& pos)
{
FString resName;
FString resType;
int resID;
if (!sc.GetString(resName)) return;
if (!sc.GetString(resType)) return;
if (!sc.GetNumber(resID)) return;
if (!sc.GetString()) return;
resName.AppendFormat(".%s", resType.GetChars());
fileSystem.CreatePathlessCopy(resName, resID, 0);
}
//===========================================================================
//
// empty stub
//
//===========================================================================
void parseNewGameChoices(FScanner& sc, FScriptPosition& pos)
{
FScanner::SavedPos blockend;
if (sc.StartBraces(&blockend)) return;
while (!sc.FoundEndBrace(blockend)) {}
}