- Store ambient sound names as FSoundID rather than as FString.

SVN r3843 (trunk)
This commit is contained in:
Randy Heit 2012-08-22 23:55:30 +00:00
parent 39ff34645f
commit cc4aadbfaf
1 changed files with 4 additions and 4 deletions

View File

@ -123,7 +123,7 @@ struct FAmbientSound
int periodmax; // max # of tics for random ambients int periodmax; // max # of tics for random ambients
float volume; // relative volume of sound float volume; // relative volume of sound
float attenuation; float attenuation;
FString sound; // Logical name of sound to play FSoundID sound; // Sound to play
}; };
TMap<int, FAmbientSound> Ambients; TMap<int, FAmbientSound> Ambients;
@ -1004,10 +1004,10 @@ static void S_AddSNDINFO (int lump)
ambient->periodmax = 0; ambient->periodmax = 0;
ambient->volume = 0; ambient->volume = 0;
ambient->attenuation = 0; ambient->attenuation = 0;
ambient->sound = ""; ambient->sound = 0;
sc.MustGetString (); sc.MustGetString ();
ambient->sound = sc.String; ambient->sound = FSoundID(S_FindSoundTentative(sc.String));
ambient->attenuation = 0; ambient->attenuation = 0;
sc.MustGetString (); sc.MustGetString ();
@ -2125,7 +2125,7 @@ void AAmbientSound::Tick ()
loop = CHAN_LOOP; loop = CHAN_LOOP;
} }
if (ambient->sound.IsNotEmpty()) if (ambient->sound != 0)
{ {
// The second argument scales the ambient sound's volume. // The second argument scales the ambient sound's volume.
// 0 and 100 are normal volume. The maximum volume level // 0 and 100 are normal volume. The maximum volume level