Integrate C++11 branch into 5_1-new
This commit is contained in:
+11
-12
@@ -2,12 +2,11 @@
|
||||
#include "RageInput.h"
|
||||
#include "RageLog.h"
|
||||
#include "arch/InputHandler/InputHandler.h"
|
||||
#include "Foreach.h"
|
||||
#include "Preference.h"
|
||||
#include "LuaManager.h"
|
||||
#include "LocalizedString.h"
|
||||
|
||||
RageInput* INPUTMAN = NULL; // global and accessible from anywhere in our program
|
||||
RageInput* INPUTMAN = nullptr; // global and accessible from anywhere in our program
|
||||
|
||||
Preference<RString> g_sInputDrivers( "InputDrivers", "" ); // "" == DEFAULT_INPUT_DRIVER_LIST
|
||||
|
||||
@@ -101,7 +100,7 @@ void RageInput::WindowReset()
|
||||
|
||||
void RageInput::AddHandler( InputHandler *pHandler )
|
||||
{
|
||||
ASSERT( pHandler != NULL );
|
||||
ASSERT( pHandler != nullptr );
|
||||
|
||||
LoadedInputHandler hand;
|
||||
hand.m_pDevice = pHandler;
|
||||
@@ -109,8 +108,8 @@ void RageInput::AddHandler( InputHandler *pHandler )
|
||||
|
||||
vector<InputDeviceInfo> aDeviceInfo;
|
||||
hand.m_pDevice->GetDevicesAndDescriptions( aDeviceInfo );
|
||||
FOREACH_CONST( InputDeviceInfo, aDeviceInfo, idi )
|
||||
g_mapDeviceToHandler[idi->id] = pHandler;
|
||||
for (InputDeviceInfo const &idi : aDeviceInfo)
|
||||
g_mapDeviceToHandler[idi.id] = pHandler;
|
||||
}
|
||||
|
||||
/** @brief Return the first InputDriver for the requested InputDevice. */
|
||||
@@ -118,14 +117,14 @@ InputHandler *RageInput::GetHandlerForDevice( const InputDevice id )
|
||||
{
|
||||
map<InputDevice, InputHandler *>::iterator it = g_mapDeviceToHandler.find(id);
|
||||
if( it == g_mapDeviceToHandler.end() )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return it->second;
|
||||
}
|
||||
|
||||
RString RageInput::GetDeviceSpecificInputString( const DeviceInput &di )
|
||||
{
|
||||
InputHandler *pDriver = GetHandlerForDevice( di.device );
|
||||
if( pDriver != NULL )
|
||||
if( pDriver != nullptr )
|
||||
return pDriver->GetDeviceSpecificInputString(di);
|
||||
else
|
||||
return di.ToString();
|
||||
@@ -134,7 +133,7 @@ RString RageInput::GetDeviceSpecificInputString( const DeviceInput &di )
|
||||
RString RageInput::GetLocalizedInputString( const DeviceInput &di )
|
||||
{
|
||||
InputHandler *pDriver = GetHandlerForDevice( di.device );
|
||||
if( pDriver != NULL )
|
||||
if( pDriver != nullptr )
|
||||
return pDriver->GetLocalizedInputString(di);
|
||||
else
|
||||
return Capitalize( DeviceButtonToString(di.button) );
|
||||
@@ -143,7 +142,7 @@ RString RageInput::GetLocalizedInputString( const DeviceInput &di )
|
||||
wchar_t RageInput::DeviceInputToChar( DeviceInput di, bool bUseCurrentKeyModifiers )
|
||||
{
|
||||
InputHandler *pDriver = GetHandlerForDevice( di.device );
|
||||
if( pDriver != NULL )
|
||||
if( pDriver != nullptr )
|
||||
return pDriver->DeviceButtonToChar(di.button, bUseCurrentKeyModifiers);
|
||||
else
|
||||
return '\0';
|
||||
@@ -152,7 +151,7 @@ wchar_t RageInput::DeviceInputToChar( DeviceInput di, bool bUseCurrentKeyModifie
|
||||
InputDeviceState RageInput::GetInputDeviceState( InputDevice id )
|
||||
{
|
||||
InputHandler *pDriver = GetHandlerForDevice( id );
|
||||
if( pDriver != NULL )
|
||||
if( pDriver != nullptr )
|
||||
return pDriver->GetInputDeviceState(id);
|
||||
else
|
||||
return InputDeviceState_NoInputHandler;
|
||||
@@ -187,8 +186,8 @@ public:
|
||||
vector<InputDeviceInfo> vDevices;
|
||||
p->GetDevicesAndDescriptions( vDevices );
|
||||
vector<RString> vsDescriptions;
|
||||
FOREACH_CONST( InputDeviceInfo, vDevices, idi )
|
||||
vsDescriptions.push_back( idi->sDesc );
|
||||
for (InputDeviceInfo const &idi : vDevices)
|
||||
vsDescriptions.push_back( idi.sDesc );
|
||||
LuaHelpers::CreateTableFromArray( vsDescriptions, L );
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user