diff options
| author | Léo Lam <leo@leolam.fr> | 2020-10-20 02:10:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-20 02:10:29 +0200 |
| commit | fc3b474cceb2a24df21640140be4beb95b9b9fd1 (patch) | |
| tree | 84c89656ad79357c819b129a927db20cec1cdf9e /Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp | |
| parent | b26c2e7adb80436f131f1a50e462ee7c25792c48 (diff) | |
| parent | 4fff04db3ce16c72d8b3b95df2285a129605fde4 (diff) | |
Merge pull request #8318 from iwubcode/dynamic_input_textures
InputCommon: Dynamic Input Textures
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp index a9c5844b48..8fc54fde06 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp @@ -112,6 +112,12 @@ void EmulatedController::SetDefaultDevice(ciface::Core::DeviceQualifier devq) } } +void EmulatedController::SetDynamicInputTextureManager( + InputCommon::DynamicInputTextureManager* dynamic_input_tex_config_manager) +{ + m_dynamic_input_tex_config_manager = dynamic_input_tex_config_manager; +} + void EmulatedController::LoadConfig(IniFile::Section* sec, const std::string& base) { std::string defdev = GetDefaultDevice().ToString(); @@ -123,6 +129,11 @@ void EmulatedController::LoadConfig(IniFile::Section* sec, const std::string& ba for (auto& cg : groups) cg->LoadConfig(sec, defdev, base); + + if (base.empty()) + { + GenerateTextures(sec); + } } void EmulatedController::SaveConfig(IniFile::Section* sec, const std::string& base) @@ -133,6 +144,11 @@ void EmulatedController::SaveConfig(IniFile::Section* sec, const std::string& ba for (auto& ctrlGroup : groups) ctrlGroup->SaveConfig(sec, defdev, base); + + if (base.empty()) + { + GenerateTextures(sec); + } } void EmulatedController::LoadDefaults(const ControllerInterface& ciface) @@ -147,4 +163,12 @@ void EmulatedController::LoadDefaults(const ControllerInterface& ciface) SetDefaultDevice(default_device_string); } } + +void EmulatedController::GenerateTextures(IniFile::Section* sec) +{ + if (m_dynamic_input_tex_config_manager) + { + m_dynamic_input_tex_config_manager->GenerateTextures(sec, GetName()); + } +} } // namespace ControllerEmu |
