Only load one Ready and HWG announcer sample because it's only played once

This commit is contained in:
Chris Danford
2003-03-16 07:38:40 +00:00
parent 996aa1d66e
commit 33917de85c
3 changed files with 10 additions and 8 deletions
+3 -1
View File
@@ -29,7 +29,7 @@ RandomSample::~RandomSample()
} }
bool RandomSample::LoadSoundDir( CString sDir ) bool RandomSample::LoadSoundDir( CString sDir, int iMaxToLoad )
{ {
if( sDir == "" ) if( sDir == "" )
return true; return true;
@@ -55,6 +55,8 @@ bool RandomSample::LoadSoundDir( CString sDir )
GetDirListing( sDir + "*.ogg", arraySoundFiles ); GetDirListing( sDir + "*.ogg", arraySoundFiles );
GetDirListing( sDir + "*.wav", arraySoundFiles ); GetDirListing( sDir + "*.wav", arraySoundFiles );
arraySoundFiles.resize( min( arraySoundFiles.size(), (unsigned)iMaxToLoad ) );
for( unsigned i=0; i<arraySoundFiles.size(); i++ ) for( unsigned i=0; i<arraySoundFiles.size(); i++ )
LoadSound( sDir + arraySoundFiles[i] ); LoadSound( sDir + arraySoundFiles[i] );
+3 -3
View File
@@ -20,14 +20,14 @@ public:
RandomSample(); RandomSample();
virtual ~RandomSample(); virtual ~RandomSample();
virtual bool Load( CString sFilePath ) virtual bool Load( CString sFilePath, int iMaxToLoad = 1000 /*load all*/ )
{ {
CString sDir, sFName, sExt; CString sDir, sFName, sExt;
splitrelpath( sFilePath, sDir, sFName, sExt ); splitrelpath( sFilePath, sDir, sFName, sExt );
sExt.MakeLower(); sExt.MakeLower();
if( sExt == "" ) return LoadSoundDir( sFilePath ); if( sExt == "" ) return LoadSoundDir( sFilePath, iMaxToLoad );
else return LoadSound( sFilePath ); else return LoadSound( sFilePath );
}; };
@@ -35,7 +35,7 @@ public:
void Stop(); void Stop();
private: private:
bool LoadSoundDir( CString sDir ); bool LoadSoundDir( CString sDir, int iMaxToLoad );
bool LoadSound( CString sSoundFilePath ); bool LoadSound( CString sSoundFilePath );
+4 -4
View File
@@ -469,13 +469,13 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
if( !bDemonstration ) // only load if we're going to use it if( !bDemonstration ) // only load if we're going to use it
{ {
m_soundOniDie.Load( THEME->GetPathTo("Sounds","ScreenGameplay oni die") ); m_soundOniDie.Load( THEME->GetPathTo("Sounds","ScreenGameplay oni die") );
m_announcerReady.Load( ANNOUNCER->GetPathTo("gameplay ready") ); m_announcerReady.Load( ANNOUNCER->GetPathTo("gameplay ready"), 1 );
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go extra") ); m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go extra"), 1 );
else if( GAMESTATE->IsFinalStage() ) else if( GAMESTATE->IsFinalStage() )
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go final") ); m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go final"), 1 );
else else
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go normal") ); m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go normal"), 1 );
m_announcerDanger.Load( ANNOUNCER->GetPathTo("gameplay comment danger") ); m_announcerDanger.Load( ANNOUNCER->GetPathTo("gameplay comment danger") );
m_announcerGood.Load( ANNOUNCER->GetPathTo("gameplay comment good") ); m_announcerGood.Load( ANNOUNCER->GetPathTo("gameplay comment good") );
m_announcerHot.Load( ANNOUNCER->GetPathTo("gameplay comment hot") ); m_announcerHot.Load( ANNOUNCER->GetPathTo("gameplay comment hot") );