unreachable (we check for this outside), and we can return NULL anyway, if all drivers fail
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
#include "RageSoundDriver.h"
|
#include "RageSoundDriver.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "LocalizedString.h"
|
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
|
|
||||||
map<istring, CreateSoundDriverFn> *RegisterSoundDriver::g_pRegistrees;
|
map<istring, CreateSoundDriverFn> *RegisterSoundDriver::g_pRegistrees;
|
||||||
@@ -15,15 +14,11 @@ RegisterSoundDriver::RegisterSoundDriver( const istring &sName, CreateSoundDrive
|
|||||||
(*g_pRegistrees)[sName] = pfn;
|
(*g_pRegistrees)[sName] = pfn;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LocalizedString SOUND_DRIVERS_CANNOT_EMPTY( "Arch", "Sound Drivers cannot be empty." );
|
|
||||||
RageSoundDriver *MakeRageSoundDriver( const RString &drivers )
|
RageSoundDriver *MakeRageSoundDriver( const RString &drivers )
|
||||||
{
|
{
|
||||||
vector<RString> DriversToTry;
|
vector<RString> DriversToTry;
|
||||||
split( drivers, ",", DriversToTry, true );
|
split( drivers, ",", DriversToTry, true );
|
||||||
|
|
||||||
if( DriversToTry.empty() )
|
|
||||||
RageException::Throw( "%s", SOUND_DRIVERS_CANNOT_EMPTY.GetValue().c_str() );
|
|
||||||
|
|
||||||
FOREACH_CONST( RString, DriversToTry, Driver )
|
FOREACH_CONST( RString, DriversToTry, Driver )
|
||||||
{
|
{
|
||||||
map<istring, CreateSoundDriverFn>::const_iterator iter = RegisterSoundDriver::g_pRegistrees->find( istring(*Driver) );
|
map<istring, CreateSoundDriverFn>::const_iterator iter = RegisterSoundDriver::g_pRegistrees->find( istring(*Driver) );
|
||||||
|
|||||||
Reference in New Issue
Block a user