mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-14 15:12:46 +00:00
Core / DolphinQt / InputCommon: reduce the number disk writes when using DynamicInputTextures
This commit is contained in:
parent
18979129f3
commit
d03f9032c1
15 changed files with 102 additions and 42 deletions
|
@ -35,8 +35,6 @@ bool InputConfig::LoadConfig()
|
|||
static constexpr std::array<std::string_view, MAX_BBMOTES> num = {"1", "2", "3", "4", "BB"};
|
||||
std::string profile[MAX_BBMOTES];
|
||||
|
||||
m_dynamic_input_tex_config_manager.Load();
|
||||
|
||||
if (SConfig::GetInstance().GetGameID() != "00000000")
|
||||
{
|
||||
const std::string profile_directory = GetUserProfileDirectoryPath();
|
||||
|
@ -102,8 +100,6 @@ bool InputConfig::LoadConfig()
|
|||
// Next profile
|
||||
n++;
|
||||
}
|
||||
|
||||
m_dynamic_input_tex_config_manager.GenerateTextures(inifile, controller_names);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -139,8 +135,6 @@ void InputConfig::SaveConfig()
|
|||
controller_names.push_back(controller->GetName());
|
||||
}
|
||||
|
||||
m_dynamic_input_tex_config_manager.GenerateTextures(inifile, controller_names);
|
||||
|
||||
inifile.Save(ini_filename);
|
||||
}
|
||||
|
||||
|
@ -210,6 +204,8 @@ bool InputConfig::IsControllerControlledByGamepadDevice(int index) const
|
|||
|
||||
void InputConfig::GenerateControllerTextures(const Common::IniFile& file)
|
||||
{
|
||||
m_dynamic_input_tex_config_manager.Load();
|
||||
|
||||
std::vector<std::string> controller_names;
|
||||
for (auto& controller : m_controllers)
|
||||
{
|
||||
|
@ -218,3 +214,18 @@ void InputConfig::GenerateControllerTextures(const Common::IniFile& file)
|
|||
|
||||
m_dynamic_input_tex_config_manager.GenerateTextures(file, controller_names);
|
||||
}
|
||||
|
||||
void InputConfig::GenerateControllerTextures()
|
||||
{
|
||||
const std::string ini_filename = File::GetUserPath(D_CONFIG_IDX) + m_ini_name + ".ini";
|
||||
|
||||
Common::IniFile inifile;
|
||||
inifile.Load(ini_filename);
|
||||
|
||||
for (auto& controller : m_controllers)
|
||||
{
|
||||
controller->SaveConfig(inifile.GetOrCreateSection(controller->GetName()));
|
||||
}
|
||||
|
||||
GenerateControllerTextures(inifile);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue