mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
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.
This commit is contained in:
@ -2,21 +2,21 @@
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <imgui.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/Timer.h"
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
|
||||
namespace OSD
|
||||
{
|
||||
constexpr float LEFT_MARGIN = 10.0f; // Pixels to the left of OSD messages.
|
||||
@ -49,7 +49,7 @@ static float DrawMessage(int index, const Message& msg, const ImVec2& position,
|
||||
{
|
||||
// We have to provide a window name, and these shouldn't be duplicated.
|
||||
// So instead, we generate a name based on the number of messages drawn.
|
||||
const std::string window_name = StringFromFormat("osd_%d", index);
|
||||
const std::string window_name = fmt::format("osd_{}", index);
|
||||
|
||||
// The size must be reset, otherwise the length of old messages could influence new ones.
|
||||
ImGui::SetNextWindowPos(position);
|
||||
|
Reference in New Issue
Block a user