Only load one Ready and HWG announcer sample because it's only played once
This commit is contained in:
@@ -29,7 +29,7 @@ RandomSample::~RandomSample()
|
||||
}
|
||||
|
||||
|
||||
bool RandomSample::LoadSoundDir( CString sDir )
|
||||
bool RandomSample::LoadSoundDir( CString sDir, int iMaxToLoad )
|
||||
{
|
||||
if( sDir == "" )
|
||||
return true;
|
||||
@@ -55,6 +55,8 @@ bool RandomSample::LoadSoundDir( CString sDir )
|
||||
GetDirListing( sDir + "*.ogg", arraySoundFiles );
|
||||
GetDirListing( sDir + "*.wav", arraySoundFiles );
|
||||
|
||||
arraySoundFiles.resize( min( arraySoundFiles.size(), (unsigned)iMaxToLoad ) );
|
||||
|
||||
for( unsigned i=0; i<arraySoundFiles.size(); i++ )
|
||||
LoadSound( sDir + arraySoundFiles[i] );
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@ public:
|
||||
RandomSample();
|
||||
virtual ~RandomSample();
|
||||
|
||||
virtual bool Load( CString sFilePath )
|
||||
virtual bool Load( CString sFilePath, int iMaxToLoad = 1000 /*load all*/ )
|
||||
{
|
||||
CString sDir, sFName, sExt;
|
||||
splitrelpath( sFilePath, sDir, sFName, sExt );
|
||||
|
||||
sExt.MakeLower();
|
||||
|
||||
if( sExt == "" ) return LoadSoundDir( sFilePath );
|
||||
if( sExt == "" ) return LoadSoundDir( sFilePath, iMaxToLoad );
|
||||
else return LoadSound( sFilePath );
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
void Stop();
|
||||
|
||||
private:
|
||||
bool LoadSoundDir( CString sDir );
|
||||
bool LoadSoundDir( CString sDir, int iMaxToLoad );
|
||||
bool LoadSound( CString sSoundFilePath );
|
||||
|
||||
|
||||
|
||||
@@ -469,13 +469,13 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
if( !bDemonstration ) // only load if we're going to use it
|
||||
{
|
||||
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() )
|
||||
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() )
|
||||
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go final") );
|
||||
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go final"), 1 );
|
||||
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_announcerGood.Load( ANNOUNCER->GetPathTo("gameplay comment good") );
|
||||
m_announcerHot.Load( ANNOUNCER->GetPathTo("gameplay comment hot") );
|
||||
|
||||
Reference in New Issue
Block a user