From 18bcb92afcefa79b7710995201e0f5bdb418476a Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 3 Nov 2014 21:36:54 +1100 Subject: [PATCH] Used better variable name. --- lib/irrlicht/include/IEventReceiver.h | 4 ++-- lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp | 2 +- lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp | 2 +- lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp | 4 ++-- .../source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm | 2 +- src/input/device_manager.cpp | 10 ++++------ 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/irrlicht/include/IEventReceiver.h b/lib/irrlicht/include/IEventReceiver.h index ee47d091b..59b184fc8 100644 --- a/lib/irrlicht/include/IEventReceiver.h +++ b/lib/irrlicht/include/IEventReceiver.h @@ -483,11 +483,11 @@ struct SJoystickInfo } PovHat; //! Set if the name of the joystick is useful: - /** On windows the default name is useless, since it's always the same + /** On windows the generic name is useless, since it's always the same * indepentent of what joystick is connected ("Microsoft PC-joystick driver"). * We will try to get a better name from the registry, but if this should * fail this flag is set and used by STK. */ - bool HasNonDefaultName; + bool HasGenericName; }; // struct SJoystickInfo diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp index b04e92436..a867dd575 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp @@ -2038,7 +2038,7 @@ bool CIrrDeviceLinux::activateJoysticks(core::array & joystickInf ActiveJoysticks.push_back(info); - returnInfo.HasNonDefaultName = true; + returnInfo.HasGenericName = false; returnInfo.Joystick = joystick; returnInfo.PovHat = SJoystickInfo::POV_HAT_UNKNOWN; returnInfo.Axes = info.axes; diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp index 2ecf07c12..a4c2b5cb5 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp @@ -557,7 +557,7 @@ bool CIrrDeviceSDL::activateJoysticks(core::array & joystickInfo) SJoystickInfo info; info.Joystick = joystick; - info.HasNonDefaultName = true; + info.HasGenericName = false; info.Axes = SDL_JoystickNumAxes(Joysticks[joystick]); info.Buttons = SDL_JoystickNumButtons(Joysticks[joystick]); info.Name = SDL_JoystickName(joystick); diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp index 264ea3b8d..e0a602583 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp @@ -369,7 +369,7 @@ void setJoystickName(int index, const JOYCAPS &caps, SJoystickInfo *joystick) // As a default use the name given in the joystick structure // - though that is always the same name, independent of joystick :( joystick->Name = caps.szPname; - joystick->HasNonDefaultName = true; + joystick->HasGenericName = true; core::stringc key = core::stringc(REGSTR_PATH_JOYCONFIG)+"\\"+caps.szRegKey + "\\"+REGSTR_KEY_JOYCURR; @@ -413,7 +413,7 @@ void setJoystickName(int index, const JOYCAPS &caps, SJoystickInfo *joystick) regresult = RegQueryValueExA(hKey, REGSTR_VAL_JOYOEMNAME, 0, 0, (LPBYTE)name, ®size ); joystick->Name = name; - joystick->HasNonDefaultName = false; + joystick->HasGenericName = false; } // if name } // if SUCCESS RegCloseKey(hKey); diff --git a/lib/irrlicht/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm b/lib/irrlicht/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm index 4729618d8..d8371ddd0 100644 --- a/lib/irrlicht/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm +++ b/lib/irrlicht/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm @@ -1709,7 +1709,7 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array & joystickIn SJoystickInfo returnInfo; returnInfo.Joystick = jindex; - returnInfo..HasNonDefaultName = true; + returnInfo..HasGenericName = false; returnInfo.Axes = info.axes; //returnInfo.Hats = info.hats; returnInfo.Buttons = info.buttons; diff --git a/src/input/device_manager.cpp b/src/input/device_manager.cpp index bc2ce78a7..2f884ad1c 100644 --- a/src/input/device_manager.cpp +++ b/src/input/device_manager.cpp @@ -101,14 +101,12 @@ bool DeviceManager::initialize() // Some linux systems report a disk accelerometer as a gamepad, skip that if (name.find("LIS3LV02DL") != -1) continue; - if(!m_irrlicht_gamepads[id].HasNonDefaultName) + if(m_irrlicht_gamepads[id].HasGenericName) { // On Windows all gamepads are given the same name ('microsoft - // pc-joystick driver') - unless we add DirectInput or so as - // dependency. We can't test for the name, since the name is even - // translated. Irrlicht now tries to get a better name from the - // registry, but in case this should fail we still have all - // gamepads with the same name shown in the GUI. This makes + // pc-joystick driver'). Irrlicht now tries to get a better name + // from the registry, but in case this should fail we still have + // all gamepads with the same name shown in the GUI. This makes // configuration totally useless, so append an ID to the name. name = name + " " + StringUtils::toString(id).c_str(); }