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)
This commit is contained in:
@@ -3,6 +3,12 @@
|
|||||||
|
|
||||||
ArchHooks *HOOKS = NULL;
|
ArchHooks *HOOKS = NULL;
|
||||||
|
|
||||||
|
#include "Selector_ArchHooks.h"
|
||||||
|
ArchHooks *MakeArchHooks()
|
||||||
|
{
|
||||||
|
return new ARCH_HOOKS;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a helper for GetMicrosecondsSinceStart on systems with a system
|
* This is a helper for GetMicrosecondsSinceStart on systems with a system
|
||||||
* timer that may loop or move backwards.
|
* timer that may loop or move backwards.
|
||||||
|
|||||||
@@ -7,6 +7,49 @@
|
|||||||
|
|
||||||
#include "arch/arch.h"
|
#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 *g_pImpl = NULL;
|
||||||
static DialogDriver_Null g_NullDriver;
|
static DialogDriver_Null g_NullDriver;
|
||||||
static bool g_bWindowed = true; // Start out true so that we'll show errors before DISPLAY is init'd.
|
static bool g_bWindowed = true; // Start out true so that we'll show errors before DISPLAY is init'd.
|
||||||
|
|||||||
@@ -10,55 +10,6 @@
|
|||||||
#include "arch.h"
|
#include "arch.h"
|
||||||
#include "arch_platform.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"
|
#include "InputHandler/Selector_InputHandler.h"
|
||||||
void MakeInputHandlers(CString drivers, vector<InputHandler *> &Add)
|
void MakeInputHandlers(CString drivers, vector<InputHandler *> &Add)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user