- Allow defaultenvironment to take names as well as numeric IDs.

SVN r2262 (trunk)
This commit is contained in:
Randy Heit 2010-03-31 23:33:18 +00:00
parent aa86e62693
commit 69c777df4c
3 changed files with 24 additions and 7 deletions

View file

@ -2027,6 +2027,9 @@ void D_DoomMain (void)
StartScreen->AppendStatusLine(temp); StartScreen->AppendStatusLine(temp);
} }
// [RH] Load sound environments
S_ParseReverbDef ();
// [RH] Parse through all loaded mapinfo lumps // [RH] Parse through all loaded mapinfo lumps
Printf ("G_ParseMapInfo: Load map definitions.\n"); Printf ("G_ParseMapInfo: Load map definitions.\n");
G_ParseMapInfo (iwad_info->MapInfo); G_ParseMapInfo (iwad_info->MapInfo);
@ -2035,7 +2038,6 @@ void D_DoomMain (void)
Printf ("S_InitData: Load sound definitions.\n"); Printf ("S_InitData: Load sound definitions.\n");
S_InitData (); S_InitData ();
Printf ("Texman.Init: Init texture manager.\n"); Printf ("Texman.Init: Init texture manager.\n");
TexMan.Init(); TexMan.Init();

View file

@ -1256,12 +1256,28 @@ DEFINE_MAP_OPTION(defaultenvironment, false)
int id; int id;
parse.ParseAssign(); parse.ParseAssign();
parse.sc.MustGetNumber(); if (parse.sc.CheckNumber())
{ // Numeric ID XXX [, YYY]
id = parse.sc.Number << 8; id = parse.sc.Number << 8;
if (parse.CheckNumber()) if (parse.CheckNumber())
{ {
id |= parse.sc.Number; id |= parse.sc.Number;
} }
}
else
{ // Named environment
parse.sc.MustGetString();
ReverbContainer *reverb = S_FindEnvironment(parse.sc.String);
if (reverb == NULL)
{
parse.sc.ScriptMessage("Unknown sound environment '%s'\n", parse.sc.String);
id = 0;
}
else
{
id = reverb->ID;
}
}
info->DefaultEnvironment = id; info->DefaultEnvironment = id;
} }

View file

@ -323,7 +323,6 @@ void S_InitData ()
LastLocalSndInfo = LastLocalSndSeq = ""; LastLocalSndInfo = LastLocalSndSeq = "";
S_ParseSndInfo (); S_ParseSndInfo ();
S_ParseSndSeq (-1); S_ParseSndSeq (-1);
S_ParseReverbDef ();
} }
//========================================================================== //==========================================================================