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:
@@ -15,8 +15,6 @@
|
|||||||
#include "CommonMetrics.h"
|
#include "CommonMetrics.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
|
|
||||||
#include "arch/arch.h"
|
|
||||||
|
|
||||||
const RString DEFAULT_LIGHTS_DRIVER = "Null";
|
const RString DEFAULT_LIGHTS_DRIVER = "Null";
|
||||||
static Preference<RString> g_sLightsDriver( "LightsDriver", "" ); // "" == DEFAULT_LIGHTS_DRIVER
|
static Preference<RString> g_sLightsDriver( "LightsDriver", "" ); // "" == DEFAULT_LIGHTS_DRIVER
|
||||||
Preference<float> g_fLightsFalloffSeconds( "LightsFalloffSeconds", 0.1f );
|
Preference<float> g_fLightsFalloffSeconds( "LightsFalloffSeconds", 0.1f );
|
||||||
@@ -90,7 +88,7 @@ LightsManager::LightsManager()
|
|||||||
RString sDriver = g_sLightsDriver.Get();
|
RString sDriver = g_sLightsDriver.Get();
|
||||||
if( sDriver.empty() )
|
if( sDriver.empty() )
|
||||||
sDriver = DEFAULT_LIGHTS_DRIVER;
|
sDriver = DEFAULT_LIGHTS_DRIVER;
|
||||||
MakeLightsDrivers( sDriver, m_vpDrivers );
|
LightsDriver::Create( sDriver, m_vpDrivers );
|
||||||
m_fTestAutoCycleCurrentIndex = 0;
|
m_fTestAutoCycleCurrentIndex = 0;
|
||||||
m_clTestManualCycleCurrent = CabinetLight_Invalid;
|
m_clTestManualCycleCurrent = CabinetLight_Invalid;
|
||||||
m_iControllerTestManualCycleCurrent = -1;
|
m_iControllerTestManualCycleCurrent = -1;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#include "MessageManager.h"
|
#include "MessageManager.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
#include "RageUtil_WorkerThread.h"
|
#include "RageUtil_WorkerThread.h"
|
||||||
#include "arch/arch.h"
|
|
||||||
#include "arch/MemoryCard/MemoryCardDriver_Null.h"
|
#include "arch/MemoryCard/MemoryCardDriver_Null.h"
|
||||||
#include "LuaManager.h"
|
#include "LuaManager.h"
|
||||||
|
|
||||||
@@ -141,7 +140,7 @@ ThreadedMemoryCardWorker::ThreadedMemoryCardWorker():
|
|||||||
UsbStorageDevicesMutex("UsbStorageDevicesMutex")
|
UsbStorageDevicesMutex("UsbStorageDevicesMutex")
|
||||||
{
|
{
|
||||||
if( g_bMemoryCards )
|
if( g_bMemoryCards )
|
||||||
m_pDriver = MakeMemoryCardDriver();
|
m_pDriver = MemoryCardDriver::Create();
|
||||||
else
|
else
|
||||||
m_pDriver = new MemoryCardDriver_Null;
|
m_pDriver = new MemoryCardDriver_Null;
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ using namespace RageDisplay_OGL_Helpers;
|
|||||||
|
|
||||||
#include "arch/LowLevelWindow/LowLevelWindow.h"
|
#include "arch/LowLevelWindow/LowLevelWindow.h"
|
||||||
|
|
||||||
#include "arch/arch.h"
|
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
@@ -347,7 +345,7 @@ static LocalizedString OBTAIN_AN_UPDATED_VIDEO_DRIVER ( "RageDisplay_OGL", "Obta
|
|||||||
static LocalizedString GLDIRECT_IS_NOT_COMPATIBLE ( "RageDisplay_OGL", "GLDirect was detected. GLDirect is not compatible with this game and should be disabled." );
|
static LocalizedString GLDIRECT_IS_NOT_COMPATIBLE ( "RageDisplay_OGL", "GLDirect was detected. GLDirect is not compatible with this game and should be disabled." );
|
||||||
RString RageDisplay_OGL::Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer )
|
RString RageDisplay_OGL::Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer )
|
||||||
{
|
{
|
||||||
g_pWind = MakeLowLevelWindow();
|
g_pWind = LowLevelWindow::Create();
|
||||||
|
|
||||||
bool bIgnore = false;
|
bool bIgnore = false;
|
||||||
RString sError = SetVideoMode( p, bIgnore );
|
RString sError = SetVideoMode( p, bIgnore );
|
||||||
|
|||||||
@@ -984,7 +984,7 @@ int main(int argc, char* argv[])
|
|||||||
GAMESTATE = new GameState;
|
GAMESTATE = new GameState;
|
||||||
|
|
||||||
/* This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow. */
|
/* This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow. */
|
||||||
LoadingWindow *pLoadingWindow = MakeLoadingWindow();
|
LoadingWindow *pLoadingWindow = LoadingWindow::Create();
|
||||||
if( pLoadingWindow == NULL )
|
if( pLoadingWindow == NULL )
|
||||||
RageException::Throw( "%s", COULDNT_OPEN_LOADING_WINDOW.GetValue().c_str() );
|
RageException::Throw( "%s", COULDNT_OPEN_LOADING_WINDOW.GetValue().c_str() );
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ RegisterInputHandler::RegisterInputHandler( const istring &sName, CreateRageDriv
|
|||||||
}
|
}
|
||||||
|
|
||||||
static LocalizedString INPUT_HANDLERS_EMPTY( "Arch", "Input Handlers cannot be empty." );
|
static LocalizedString INPUT_HANDLERS_EMPTY( "Arch", "Input Handlers cannot be empty." );
|
||||||
void MakeInputHandlers( const RString &drivers_, vector<InputHandler *> &Add )
|
void InputHandler::Create( const RString &drivers_, vector<InputHandler *> &Add )
|
||||||
{
|
{
|
||||||
const RString drivers = drivers_.empty()? RString(DEFAULT_INPUT_DRIVER_LIST):drivers_;
|
const RString drivers = drivers_.empty()? RString(DEFAULT_INPUT_DRIVER_LIST):drivers_;
|
||||||
vector<RString> DriversToTry;
|
vector<RString> DriversToTry;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
class InputHandler: public RageDriver
|
class InputHandler: public RageDriver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static void Create( const RString &sDrivers, vector<InputHandler *> &apAdd );
|
||||||
|
|
||||||
InputHandler() { m_iInputsSinceUpdate = 0; }
|
InputHandler() { m_iInputsSinceUpdate = 0; }
|
||||||
virtual ~InputHandler() { }
|
virtual ~InputHandler() { }
|
||||||
virtual void Update() { }
|
virtual void Update() { }
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "arch/arch_default.h"
|
#include "arch/arch_default.h"
|
||||||
|
|
||||||
void MakeLightsDrivers( const RString &driver, vector<LightsDriver *> &Add )
|
void LightsDriver::Create( const RString &driver, vector<LightsDriver *> &Add )
|
||||||
{
|
{
|
||||||
LOG->Trace( "Initializing lights driver: %s", driver.c_str() );
|
LOG->Trace( "Initializing lights driver: %s", driver.c_str() );
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ struct LightsState;
|
|||||||
class LightsDriver
|
class LightsDriver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static void Create( const RString &sDriver, vector<LightsDriver *> &apAdd );
|
||||||
|
|
||||||
LightsDriver() {};
|
LightsDriver() {};
|
||||||
virtual ~LightsDriver() {};
|
virtual ~LightsDriver() {};
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "arch/arch_default.h"
|
#include "arch/arch_default.h"
|
||||||
|
|
||||||
LoadingWindow *MakeLoadingWindow()
|
LoadingWindow *LoadingWindow::Create()
|
||||||
{
|
{
|
||||||
if( !PREFSMAN->m_bShowLoadingWindow )
|
if( !PREFSMAN->m_bShowLoadingWindow )
|
||||||
return new LoadingWindow_Null;
|
return new LoadingWindow_Null;
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ struct RageSurface;
|
|||||||
class LoadingWindow
|
class LoadingWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static LoadingWindow *Create();
|
||||||
|
|
||||||
virtual RString Init() { return RString(); }
|
virtual RString Init() { return RString(); }
|
||||||
virtual ~LoadingWindow() { }
|
virtual ~LoadingWindow() { }
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include "LowLevelWindow.h"
|
#include "LowLevelWindow.h"
|
||||||
#include "arch/arch_default.h"
|
#include "arch/arch_default.h"
|
||||||
|
|
||||||
LowLevelWindow *MakeLowLevelWindow()
|
LowLevelWindow *LowLevelWindow::Create()
|
||||||
{
|
{
|
||||||
return new ARCH_LOW_LEVEL_WINDOW;
|
return new ARCH_LOW_LEVEL_WINDOW;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ struct RenderTargetParam;
|
|||||||
class LowLevelWindow
|
class LowLevelWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static LowLevelWindow *Create();
|
||||||
|
|
||||||
virtual ~LowLevelWindow() { }
|
virtual ~LowLevelWindow() { }
|
||||||
|
|
||||||
virtual void *GetProcAddress( RString s ) = 0;
|
virtual void *GetProcAddress( RString s ) = 0;
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ bool MemoryCardDriver::DoOneUpdate( bool bMount, vector<UsbStorageDevice>& vStor
|
|||||||
}
|
}
|
||||||
|
|
||||||
#include "arch/arch_default.h"
|
#include "arch/arch_default.h"
|
||||||
MemoryCardDriver *MakeMemoryCardDriver()
|
MemoryCardDriver *MemoryCardDriver::Create()
|
||||||
{
|
{
|
||||||
MemoryCardDriver *ret = NULL;
|
MemoryCardDriver *ret = NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ struct UsbStorageDevice
|
|||||||
class MemoryCardDriver
|
class MemoryCardDriver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static MemoryCardDriver *Create();
|
||||||
|
|
||||||
MemoryCardDriver() {}
|
MemoryCardDriver() {}
|
||||||
virtual ~MemoryCardDriver() {}
|
virtual ~MemoryCardDriver() {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user