diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2013-09-23 00:47:57 -0500 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2013-09-23 00:47:57 -0500 |
| commit | bab91494d53f15d804834ba5d11730b0e855ebd8 (patch) | |
| tree | a86cd67ea34aa3497955dceb501794275e4e7f04 /Source/Core/InputCommon | |
| parent | d84312c799816e8835e6bed562f216bf19725761 (diff) | |
| parent | 1da6469c62fa1b4fd669a48cb583e161d5cb2713 (diff) | |
Merge branch 'master' into android-core-control
Diffstat (limited to 'Source/Core/InputCommon')
4 files changed, 15 insertions, 12 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp index d2982bba24..bc1e115c17 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp @@ -178,11 +178,11 @@ bool ControllerInterface::UpdateOutput(const bool force) size_t ok_count = 0; - std::vector<Device*>::const_iterator - d = m_devices.begin(), - e = m_devices.end(); - for (;d != e; ++d) - (*d)->UpdateOutput(); + for (auto d = m_devices.cbegin(); d != m_devices.cend(); ++d) + { + if ((*d)->UpdateOutput()) + ++ok_count; + } return (m_devices.size() == ok_count); } @@ -196,7 +196,7 @@ bool ControllerInterface::UpdateOutput(const bool force) ControlState ControllerInterface::InputReference::State( const ControlState ignore ) { if (parsed_expression) - return parsed_expression->GetValue(); + return parsed_expression->GetValue() * range; else return 0.0f; } diff --git a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.h b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.h index 930f849a17..e5c2c1b3d4 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.h +++ b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.h @@ -26,7 +26,7 @@ private: public: std::string GetName() const; bool IsDetectable() { return false; } - Cursor(u8 index, const float& axis, const bool positive) : m_index(index), m_axis(axis), m_positive(positive) {} + Cursor(u8 index, const float& axis, const bool positive) : m_axis(axis), m_index(index), m_positive(positive) {} ControlState GetState() const; private: const float& m_axis; @@ -37,7 +37,7 @@ private: { public: std::string GetName() const; - Button(u8 index, const unsigned char& button) : m_index(index), m_button(button) {} + Button(u8 index, const unsigned char& button) : m_button(button), m_index(index) {} ControlState GetState() const; private: const unsigned char& m_button; @@ -63,7 +63,6 @@ private: const IOHIDDeviceRef m_device; const std::string m_device_name; int m_index; - void *m_window; uint32_t m_windowid; unsigned char m_mousebuttons[3]; }; diff --git a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.mm b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.mm index 003240d4a9..6473f00e77 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.mm +++ b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.mm @@ -16,7 +16,6 @@ Keyboard::Keyboard(IOHIDDeviceRef device, std::string name, int index, void *win : m_device(device) , m_device_name(name) , m_index(index) - , m_window(window) { // This class should only recieve Keyboard or Keypad devices // Now, filter on just the buttons we can handle sanely diff --git a/Source/Core/InputCommon/Src/InputConfig.cpp b/Source/Core/InputCommon/Src/InputConfig.cpp index 96fc6205db..9382138c43 100644 --- a/Source/Core/InputCommon/Src/InputConfig.cpp +++ b/Source/Core/InputCommon/Src/InputConfig.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include "InputConfig.h" +#include "CommonPaths.h" #include "../../Core/Src/ConfigManager.h" #include "../../Core/Src/HW/Wiimote.h" @@ -37,7 +38,8 @@ bool InputPlugin::LoadConfig(bool isGC) type = "Wiimote"; path = "Profiles/Wiimote/"; } - game_ini.Load(File::GetUserPath(D_GAMECONFIG_IDX) + SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID() + ".ini"); + game_ini.Load(File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID() + ".ini"); + game_ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID() + ".ini", true); for (int i = 0; i < 4; i++) { if (game_ini.Exists("Controls", (type + "Profile" + num[i]).c_str())) @@ -46,7 +48,10 @@ bool InputPlugin::LoadConfig(bool isGC) if (File::Exists(File::GetUserPath(D_CONFIG_IDX) + path + profile[i] + ".ini")) useProfile[i] = true; else + { + // TODO: Having a PanicAlert for this is dumb. PanicAlertT("Selected controller profile does not exist"); + } } } } @@ -94,6 +99,6 @@ void InputPlugin::SaveConfig() e = controllers.end(); for ( ; i!=e; ++i ) (*i)->SaveConfig(inifile.GetOrCreateSection((*i)->GetName().c_str())); - + inifile.Save(ini_filename); } |
