From 32d584a0f5f58ff80ab9ad95ff3d1b10e30d108f Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sat, 27 Feb 2021 16:41:50 -0600 Subject: InputCommon: reduce number of image loads and texture cache invalidations by only running dynamic input textures once for all controllers --- .../InputCommon/ControllerEmu/ControllerEmu.cpp | 24 ---------------------- .../Core/InputCommon/ControllerEmu/ControllerEmu.h | 4 ---- 2 files changed, 28 deletions(-) (limited to 'Source/Core/InputCommon/ControllerEmu') diff --git a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp index 8fc54fde06..a9c5844b48 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp @@ -112,12 +112,6 @@ 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(); @@ -129,11 +123,6 @@ 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) @@ -144,11 +133,6 @@ 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) @@ -163,12 +147,4 @@ 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 diff --git a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.h b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.h index 00f750088a..291e707f25 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.h +++ b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.h @@ -17,7 +17,6 @@ #include "Common/MathUtil.h" #include "InputCommon/ControlReference/ExpressionParser.h" #include "InputCommon/ControllerInterface/CoreDevice.h" -#include "InputCommon/DynamicInputTextureManager.h" class ControllerInterface; @@ -183,7 +182,6 @@ public: const ciface::Core::DeviceQualifier& GetDefaultDevice() const; void SetDefaultDevice(const std::string& device); void SetDefaultDevice(ciface::Core::DeviceQualifier devq); - void SetDynamicInputTextureManager(InputCommon::DynamicInputTextureManager*); void UpdateReferences(const ControllerInterface& devi); void UpdateSingleControlReference(const ControllerInterface& devi, ControlReference* ref); @@ -226,8 +224,6 @@ protected: void UpdateReferences(ciface::ExpressionParser::ControlEnvironment& env); private: - void GenerateTextures(IniFile::Section* sec); - InputCommon::DynamicInputTextureManager* m_dynamic_input_tex_config_manager = nullptr; ciface::Core::DeviceQualifier m_default_device; bool m_default_device_is_connected{false}; }; -- cgit v1.2.3