From 2c9774f89c3ec636286d9342729d5ecf94454afa Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 20 Mar 2005 04:09:15 +0000 Subject: [PATCH] move MakeArchHooks and MakeDialogDriver back into their own files; the tests need this (to be able to use a couple arch systems without having to link them all) --- stepmania/src/arch/ArchHooks/ArchHooks.cpp | 6 +++ stepmania/src/arch/Dialog/Dialog.cpp | 43 +++++++++++++++++++ stepmania/src/arch/arch.cpp | 49 ---------------------- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/stepmania/src/arch/ArchHooks/ArchHooks.cpp b/stepmania/src/arch/ArchHooks/ArchHooks.cpp index 45c8fcca52..0975bac3f2 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks.cpp @@ -3,6 +3,12 @@ ArchHooks *HOOKS = NULL; +#include "Selector_ArchHooks.h" +ArchHooks *MakeArchHooks() +{ + return new ARCH_HOOKS; +} + /* * This is a helper for GetMicrosecondsSinceStart on systems with a system * timer that may loop or move backwards. diff --git a/stepmania/src/arch/Dialog/Dialog.cpp b/stepmania/src/arch/Dialog/Dialog.cpp index f709e507db..ace59a806f 100644 --- a/stepmania/src/arch/Dialog/Dialog.cpp +++ b/stepmania/src/arch/Dialog/Dialog.cpp @@ -7,6 +7,49 @@ #include "arch/arch.h" +#include "Selector_Dialog.h" +DialogDriver *MakeDialogDriver() +{ + CString drivers = "win32,cocoa,null"; + CStringArray DriversToTry; + split(drivers, ",", DriversToTry, true); + + ASSERT( DriversToTry.size() != 0 ); + + CString Driver; + DialogDriver *ret = NULL; + + for( unsigned i = 0; ret == NULL && i < DriversToTry.size(); ++i ) + { + Driver = DriversToTry[i]; + +#ifdef USE_DIALOG_DRIVER_COCOA + if( !DriversToTry[i].CompareNoCase("Cocoa") ) ret = new DialogDriver_Cocoa; +#endif +#ifdef USE_DIALOG_DRIVER_NULL + if( !DriversToTry[i].CompareNoCase("Null") ) ret = new DialogDriver_Null; +#endif +#ifdef USE_DIALOG_DRIVER_WIN32 + if( !DriversToTry[i].CompareNoCase("Win32") ) ret = new DialogDriver_Win32; +#endif + + if( ret == NULL ) + { + continue; + } + + CString sError = ret->Init(); + if( sError != "" ) + { + if( LOG ) + LOG->Info( "Couldn't load driver %s: %s", DriversToTry[i].c_str(), sError.c_str() ); + SAFE_DELETE( ret ); + } + } + + return ret; +} + static DialogDriver *g_pImpl = NULL; static DialogDriver_Null g_NullDriver; static bool g_bWindowed = true; // Start out true so that we'll show errors before DISPLAY is init'd. diff --git a/stepmania/src/arch/arch.cpp b/stepmania/src/arch/arch.cpp index b87026b505..53491d4cb1 100644 --- a/stepmania/src/arch/arch.cpp +++ b/stepmania/src/arch/arch.cpp @@ -10,55 +10,6 @@ #include "arch.h" #include "arch_platform.h" -#include "ArchHooks/Selector_ArchHooks.h" -ArchHooks *MakeArchHooks() -{ - return new ARCH_HOOKS; -} - -#include "Dialog/Selector_Dialog.h" -DialogDriver *MakeDialogDriver() -{ - CString drivers = "win32,cocoa,null"; - CStringArray DriversToTry; - split(drivers, ",", DriversToTry, true); - - ASSERT( DriversToTry.size() != 0 ); - - CString Driver; - DialogDriver *ret = NULL; - - for( unsigned i = 0; ret == NULL && i < DriversToTry.size(); ++i ) - { - Driver = DriversToTry[i]; - -#ifdef USE_DIALOG_DRIVER_COCOA - if( !DriversToTry[i].CompareNoCase("Cocoa") ) ret = new DialogDriver_Cocoa; -#endif -#ifdef USE_DIALOG_DRIVER_NULL - if( !DriversToTry[i].CompareNoCase("Null") ) ret = new DialogDriver_Null; -#endif -#ifdef USE_DIALOG_DRIVER_WIN32 - if( !DriversToTry[i].CompareNoCase("Win32") ) ret = new DialogDriver_Win32; -#endif - - if( ret == NULL ) - { - continue; - } - - CString sError = ret->Init(); - if( sError != "" ) - { - if( LOG ) - LOG->Info( "Couldn't load driver %s: %s", DriversToTry[i].c_str(), sError.c_str() ); - SAFE_DELETE( ret ); - } - } - - return ret; -} - #include "InputHandler/Selector_InputHandler.h" void MakeInputHandlers(CString drivers, vector &Add) {