diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-01-20 16:40:46 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-01-20 16:40:46 -0600 |
| commit | d348bfea46120ee79ccdf859805263bdab2f11c6 (patch) | |
| tree | bee7209295e8874937478815ae3d9a62c7fa7e4d /Source/Core/VideoCommon/PostProcessing.cpp | |
| parent | 7f68a357ad64e965de8e339683906b3c6f8b775e (diff) | |
Fix the Post Processing shader configuration dialog.
On locales that don't use period as a separator this would break us.
For vector values in a configuration, we use comma as a separator which causes the configuration to balloon to massive sizes due to never saving them
correctly. Loading would then break since it would load a million configuration options.
Fixes issue #7569.
Diffstat (limited to 'Source/Core/VideoCommon/PostProcessing.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PostProcessing.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/PostProcessing.cpp b/Source/Core/VideoCommon/PostProcessing.cpp index 019001da15..b4ee1e8702 100644 --- a/Source/Core/VideoCommon/PostProcessing.cpp +++ b/Source/Core/VideoCommon/PostProcessing.cpp @@ -260,10 +260,16 @@ void PostProcessingShaderConfiguration::SaveOptionsConfiguration() break; case ConfigurationOption::OptionType::OPTION_FLOAT: { - std::string value = ""; + std::ostringstream value; + value.imbue(std::locale("C")); + for (size_t i = 0; i < it.second.m_float_values.size(); ++i) - value += StringFromFormat("%f%s", it.second.m_float_values[i], i == (it.second.m_float_values.size() - 1) ? "": ", "); - ini.GetOrCreateSection(section)->Set(it.second.m_option_name, value); + { + value << it.second.m_float_values[i]; + if (i != (it.second.m_float_values.size() - 1)) + value << ", "; + } + ini.GetOrCreateSection(section)->Set(it.second.m_option_name, value.str()); } break; } |
