mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 13:21:04 +00:00
- added a parser for WT's developer commentary definitions.
This commit is contained in:
parent
b8dae02464
commit
3a459ac603
3 changed files with 56 additions and 0 deletions
|
@ -323,6 +323,7 @@ void GameInterface::app_init()
|
||||||
|
|
||||||
ud.last_level = -1;
|
ud.last_level = -1;
|
||||||
enginecompatibility_mode = ENGINECOMPATIBILITY_19961112;//bVanilla;
|
enginecompatibility_mode = ENGINECOMPATIBILITY_19961112;//bVanilla;
|
||||||
|
S_ParseDeveloperCommentary();
|
||||||
}
|
}
|
||||||
|
|
||||||
END_DUKE_NS
|
END_DUKE_NS
|
||||||
|
|
|
@ -733,4 +733,56 @@ void S_WorldTourMappingsForOldSounds()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TArray<FString> Commentaries;
|
||||||
|
|
||||||
|
|
||||||
|
void S_ParseDeveloperCommentary()
|
||||||
|
{
|
||||||
|
int lumpnum = fileSystem.FindFile("def/developer_commentary.def");
|
||||||
|
if (lumpnum < 0) return;
|
||||||
|
FScanner sc;
|
||||||
|
sc.OpenLumpNum(lumpnum);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
sc.SetCMode(true);
|
||||||
|
sc.MustGetStringName("def");
|
||||||
|
sc.MustGetStringName("developercommentary");
|
||||||
|
sc.MustGetStringName("{");
|
||||||
|
while (!sc.CheckString("}"))
|
||||||
|
{
|
||||||
|
FString path;
|
||||||
|
int num = -1;
|
||||||
|
sc.MustGetStringName("def");
|
||||||
|
sc.MustGetStringName("sound");
|
||||||
|
sc.MustGetStringName("{");
|
||||||
|
while (!sc.CheckString("}"))
|
||||||
|
{
|
||||||
|
sc.MustGetString();
|
||||||
|
if (sc.Compare("path"))
|
||||||
|
{
|
||||||
|
sc.MustGetStringName(":");
|
||||||
|
sc.MustGetString();
|
||||||
|
path = sc.String;
|
||||||
|
sc.MustGetStringName(";");
|
||||||
|
}
|
||||||
|
else if (sc.Compare("num"))
|
||||||
|
{
|
||||||
|
sc.MustGetStringName(":");
|
||||||
|
sc.MustGetNumber();
|
||||||
|
num = sc.Number;
|
||||||
|
sc.MustGetStringName(";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sc.MustGetStringName(";");
|
||||||
|
if (Commentaries.Size() <= num) Commentaries.Resize(num + 1);
|
||||||
|
Commentaries[num] = std::move(path);
|
||||||
|
}
|
||||||
|
//sc.MustGetStringName(";");
|
||||||
|
}
|
||||||
|
catch (const std::exception& ex)
|
||||||
|
{
|
||||||
|
Printf("Failed to read developer commentary definitions:\n%s", ex.what());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
END_DUKE_NS
|
END_DUKE_NS
|
||||||
|
|
|
@ -70,6 +70,9 @@ void S_PlaySpecialMusic(unsigned int);
|
||||||
void S_ContinueLevelMusic(void);
|
void S_ContinueLevelMusic(void);
|
||||||
|
|
||||||
// Placeholders.
|
// Placeholders.
|
||||||
|
|
||||||
|
void S_ParseDeveloperCommentary();
|
||||||
|
|
||||||
inline void StopCommentary()
|
inline void StopCommentary()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue