Make* -> Driver::Create. Having these floating in arch.h isn't
useful; if you create the class, you need the class definition to free it, and anyone creating a class is probably going to use it, too.
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "arch/Sound/RageSoundDriver.h"
|
||||
|
||||
#include "arch/arch.h"
|
||||
#include "arch/arch_default.h"
|
||||
|
||||
/*
|
||||
@@ -52,7 +51,7 @@ void RageSoundManager::Init()
|
||||
if( sDrivers.empty() )
|
||||
sDrivers = DEFAULT_SOUND_DRIVER_LIST;
|
||||
|
||||
m_pDriver = MakeRageSoundDriver( sDrivers );
|
||||
m_pDriver = RageSoundDriver::Create( sDrivers );
|
||||
if( m_pDriver == NULL )
|
||||
RageException::Throw( "%s", COULDNT_FIND_SOUND_DRIVER.GetValue().c_str() );
|
||||
}
|
||||
|
||||
@@ -896,7 +896,7 @@ int main(int argc, char* argv[])
|
||||
SetCommandlineArguments( argc, argv );
|
||||
|
||||
/* Set up arch hooks first. This may set up crash handling. */
|
||||
HOOKS = MakeArchHooks();
|
||||
HOOKS = ArchHooks::Create();
|
||||
HOOKS->Init();
|
||||
#if !defined(DEBUG)
|
||||
/* Tricky: for other exceptions, we want a backtrace. To do this in Windows,
|
||||
|
||||
@@ -50,7 +50,7 @@ bool ArchHooks::GoToURL( RString sUrl )
|
||||
return false;
|
||||
}
|
||||
|
||||
ArchHooks *MakeArchHooks()
|
||||
ArchHooks *ArchHooks::Create()
|
||||
{
|
||||
return new ARCH_HOOKS;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
class ArchHooks
|
||||
{
|
||||
public:
|
||||
static ArchHooks *Create();
|
||||
|
||||
ArchHooks(): m_bHasFocus(true), m_bFocusChanged(false) { }
|
||||
virtual ~ArchHooks() { }
|
||||
virtual void Init() { }
|
||||
|
||||
@@ -77,7 +77,7 @@ static Preference<RString> g_sMovieDrivers( "MovieDrivers", "" ); // "" == defau
|
||||
/* Try drivers in order of preference until we find one that works. */
|
||||
static LocalizedString MOVIE_DRIVERS_EMPTY ( "Arch", "Movie Drivers cannot be empty." );
|
||||
static LocalizedString COULDNT_CREATE_MOVIE_DRIVER ( "Arch", "Couldn't create a movie driver." );
|
||||
RageMovieTexture *MakeRageMovieTexture( RageTextureID ID )
|
||||
RageMovieTexture *RageMovieTexture::Create( RageTextureID ID )
|
||||
{
|
||||
DumpAVIDebugInfo( ID.filename );
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
class RageMovieTexture : public RageTexture
|
||||
{
|
||||
public:
|
||||
static RageMovieTexture *Create( RageTextureID ID );
|
||||
|
||||
RageMovieTexture( RageTextureID ID ): RageTexture(ID) { }
|
||||
virtual ~RageMovieTexture() { }
|
||||
virtual void Update( float fDeltaTime ) { }
|
||||
|
||||
@@ -11,7 +11,7 @@ RegisterSoundDriver::RegisterSoundDriver( const istring &sName, CreateRageDriver
|
||||
g_pRegistrees.Add( sName, pfn );
|
||||
}
|
||||
|
||||
RageSoundDriver *MakeRageSoundDriver( const RString &drivers )
|
||||
RageSoundDriver *RageSoundDriver::Create( const RString &drivers )
|
||||
{
|
||||
vector<RString> DriversToTry;
|
||||
split( drivers, ",", DriversToTry, true );
|
||||
|
||||
@@ -8,6 +8,8 @@ class RageSoundBase;
|
||||
class RageSoundDriver: public RageDriver
|
||||
{
|
||||
public:
|
||||
static RageSoundDriver *Create( const RString &sDrivers );
|
||||
|
||||
friend class RageSoundManager;
|
||||
|
||||
/* Initialize. On failure, an error message is returned. */
|
||||
|
||||
Reference in New Issue
Block a user