Skip to content

Commit

Permalink
- allow SNDINFO to declare sound mappings by using 'sounda = soundfle'.
Browse files Browse the repository at this point in the history
This works similar to MAPINFO: The first definition in a file declares the format, all later ones must be the same.
This change in syntax increases robustness significantly because it avoids the problems with the original syntax not being able to detect badly formatted names.
  • Loading branch information
coelckers committed Nov 24, 2022
1 parent f7f6711 commit 419e593
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/sound/s_advsound.cpp
Expand Up @@ -799,6 +799,7 @@ static void S_AddSNDINFO (int lump)
auto &S_sfx = soundEngine->GetSounds();
bool skipToEndIf;
TArray<uint32_t> list;
int wantassigns = -1;

FScanner sc(lump);
skipToEndIf = false;
Expand Down Expand Up @@ -1247,6 +1248,15 @@ static void S_AddSNDINFO (int lump)
else
{ // Got a logical sound mapping
FString name (sc.String);
if (wantassigns == -1)
{
wantassigns = sc.CheckString("=");
}
else if (wantassigns)
{
sc.MustGetStringName("=");
}

sc.MustGetString ();
S_AddSound (name, sc.String, &sc);
}
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/menudef.txt
Expand Up @@ -2822,7 +2822,7 @@ OptionValue "os_isanyof_values"
OptionMenu "vkoptions"
{
Title "$VK_TITLE"
StaticText "$VK_WARNING"
//StaticText "$VK_WARNING"
StaticText "$VK_RESTART"
StaticText ""
TextField "$VKMNU_DEVICE", vk_device
Expand Down

0 comments on commit 419e593

Please sign in to comment.