summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PostProcessing.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-11-22 17:10:41 -0500
committerLioncash <mathew1800@gmail.com>2019-11-23 16:00:45 -0500
commit6fbbc2683eeedf3767ea3d741c62555a30d3ff45 (patch)
tree746529d2d5408b83ec75e53e51e20a34b0571897 /Source/Core/VideoCommon/PostProcessing.cpp
parentbc449fb98f3b741f78d8881e2c02d588829aad74 (diff)
VideoCommon: Make use of fmt outside of shader generators
Migrates most of VideoCommon over to using fmt, with the exception being the shader generator code. The shader generators are quite large and have more corner cases to deal with in terms of conversion (shaders have braces in them, so we need to make sure to escape them). Because of the large amount of code that would need to be converted, the conversion of VideoCommon will be in two parts: - This change (which converts over the general case string formatting), - A follow up change that will specifically deal with converting over the shader generators.
Diffstat (limited to 'Source/Core/VideoCommon/PostProcessing.cpp')
-rw-r--r--Source/Core/VideoCommon/PostProcessing.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/PostProcessing.cpp b/Source/Core/VideoCommon/PostProcessing.cpp
index 23c0ded751..4d7b033f4e 100644
--- a/Source/Core/VideoCommon/PostProcessing.cpp
+++ b/Source/Core/VideoCommon/PostProcessing.cpp
@@ -8,6 +8,8 @@
#include <string>
#include <string_view>
+#include <fmt/format.h>
+
#include "Common/Assert.h"
#include "Common/CommonPaths.h"
#include "Common/CommonTypes.h"
@@ -286,8 +288,10 @@ void PostProcessingConfiguration::SaveOptionsConfiguration()
{
std::string value;
for (size_t i = 0; i < it.second.m_integer_values.size(); ++i)
- value += StringFromFormat("%d%s", it.second.m_integer_values[i],
- i == (it.second.m_integer_values.size() - 1) ? "" : ", ");
+ {
+ value += fmt::format("{}{}", it.second.m_integer_values[i],
+ i == (it.second.m_integer_values.size() - 1) ? "" : ", ");
+ }
ini.GetOrCreateSection(section)->Set(it.second.m_option_name, value);
}
break;
@@ -453,7 +457,7 @@ std::string PostProcessing::GetUniformBufferHeader() const
if (it.second.m_type ==
PostProcessingConfiguration::ConfigurationOption::OptionType::OPTION_BOOL)
{
- ss << StringFromFormat(" int %s;\n", it.first.c_str());
+ ss << fmt::format(" int {};\n", it.first);
for (u32 i = 0; i < 3; i++)
ss << " int ubo_align_" << unused_counter++ << "_;\n";
}
@@ -462,9 +466,9 @@ std::string PostProcessing::GetUniformBufferHeader() const
{
u32 count = static_cast<u32>(it.second.m_integer_values.size());
if (count == 1)
- ss << StringFromFormat(" int %s;\n", it.first.c_str());
+ ss << fmt::format(" int {};\n", it.first);
else
- ss << StringFromFormat(" int%u %s;\n", count, it.first.c_str());
+ ss << fmt::format(" int{} {};\n", count, it.first);
for (u32 i = count; i < 4; i++)
ss << " int ubo_align_" << unused_counter++ << "_;\n";
@@ -474,9 +478,9 @@ std::string PostProcessing::GetUniformBufferHeader() const
{
u32 count = static_cast<u32>(it.second.m_float_values.size());
if (count == 1)
- ss << StringFromFormat(" float %s;\n", it.first.c_str());
+ ss << fmt::format(" float {};\n", it.first);
else
- ss << StringFromFormat(" float%u %s;\n", count, it.first.c_str());
+ ss << fmt::format(" float{} {};\n", count, it.first);
for (u32 i = count; i < 4; i++)
ss << " float ubo_align_" << unused_counter++ << "_;\n";