diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 3ae08dd0c..42b1f2220 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -3715,7 +3715,7 @@ void CDROM::DrawDebugWindow() { static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; - const float framebuffer_scale = Host::GetOSDScale(); + const float framebuffer_scale = ImGuiManager::GetGlobalScale(); ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 580.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("CDROM State", nullptr)) diff --git a/src/core/dma.cpp b/src/core/dma.cpp index 2d904b83e..589d0a0f2 100644 --- a/src/core/dma.cpp +++ b/src/core/dma.cpp @@ -6,7 +6,6 @@ #include "cdrom.h" #include "cpu_core.h" #include "gpu.h" -#include "host.h" #include "imgui.h" #include "interrupt_controller.h" #include "mdec.h" @@ -918,7 +917,7 @@ void DMA::DrawDebugStateWindow() {"#", "Req", "Direction", "Chopping", "Mode", "Busy", "Enable", "Priority", "IRQ", "Flag"}}; static constexpr std::array sync_mode_names = {{"Manual", "Request", "LinkedList", "Reserved"}}; - const float framebuffer_scale = Host::GetOSDScale(); + const float framebuffer_scale = ImGuiManager::GetGlobalScale(); ImGui::SetNextWindowSize(ImVec2(850.0f * framebuffer_scale, 250.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("DMA State", nullptr)) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index 5c9dcacdd..0c7ae279a 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -5,7 +5,6 @@ #include "dma.h" #include "gpu_shadergen.h" #include "host.h" -#include "imgui.h" #include "interrupt_controller.h" #include "settings.h" #include "system.h" @@ -30,6 +29,7 @@ #include "IconsEmoji.h" #include "fmt/format.h" +#include "imgui.h" #include #include @@ -2875,7 +2875,7 @@ bool GPU::DumpVRAMToFile(const char* filename, u32 width, u32 height, u32 stride void GPU::DrawDebugStateWindow() { - const float framebuffer_scale = Host::GetOSDScale(); + const float framebuffer_scale = ImGuiManager::GetGlobalScale(); ImGui::SetNextWindowSize(ImVec2(450.0f * framebuffer_scale, 550.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("GPU", nullptr)) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index d2e465821..2a98d7ca5 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -3961,7 +3961,7 @@ void GPU_HW::DrawRendererStats() static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; ImGui::Columns(2); - ImGui::SetColumnWidth(0, 200.0f * Host::GetOSDScale()); + ImGui::SetColumnWidth(0, 200.0f * ImGuiManager::GetGlobalScale()); ImGui::TextUnformatted("Resolution Scale:"); ImGui::NextColumn(); diff --git a/src/core/mdec.cpp b/src/core/mdec.cpp index 74c2284b7..19e5f2aa7 100644 --- a/src/core/mdec.cpp +++ b/src/core/mdec.cpp @@ -4,7 +4,6 @@ #include "mdec.h" #include "cpu_core.h" #include "dma.h" -#include "host.h" #include "system.h" #include "timing_event.h" @@ -1058,7 +1057,7 @@ void MDEC::SetScaleMatrix(const u16* values) void MDEC::DrawDebugStateWindow() { - const float framebuffer_scale = Host::GetOSDScale(); + const float framebuffer_scale = ImGuiManager::GetGlobalScale(); ImGui::SetNextWindowSize(ImVec2(300.0f * framebuffer_scale, 350.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("MDEC State", nullptr)) diff --git a/src/core/spu.cpp b/src/core/spu.cpp index 33e5e1959..6844d3d31 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -2500,7 +2500,7 @@ void SPU::DrawDebugStateWindow() { static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; - const float framebuffer_scale = Host::GetOSDScale(); + const float framebuffer_scale = ImGuiManager::GetGlobalScale(); ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 800.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("SPU State", nullptr)) diff --git a/src/core/timers.cpp b/src/core/timers.cpp index 3dc0ff66d..3d85b54f5 100644 --- a/src/core/timers.cpp +++ b/src/core/timers.cpp @@ -3,7 +3,6 @@ #include "timers.h" #include "gpu.h" -#include "host.h" #include "interrupt_controller.h" #include "system.h" @@ -501,7 +500,7 @@ void Timers::DrawDebugStateWindow() {{"SysClk", "HBlank", "SysClk", "HBlank"}}, {{"SysClk", "DotClk", "SysClk/8", "SysClk/8"}}}}; - const float framebuffer_scale = Host::GetOSDScale(); + const float framebuffer_scale = ImGuiManager::GetGlobalScale(); ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 115.0f * framebuffer_scale), ImGuiCond_FirstUseEver); if (!ImGui::Begin("Timer State", nullptr)) diff --git a/src/util/imgui_manager.cpp b/src/util/imgui_manager.cpp index 824535705..c71d3580c 100644 --- a/src/util/imgui_manager.cpp +++ b/src/util/imgui_manager.cpp @@ -937,11 +937,6 @@ float ImGuiManager::GetGlobalScale() return s_global_scale; } -float Host::GetOSDScale() -{ - return ImGuiManager::s_global_scale; -} - ImFont* ImGuiManager::GetStandardFont() { return s_standard_font; diff --git a/src/util/imgui_manager.h b/src/util/imgui_manager.h index 35b886fd8..5eecb0005 100644 --- a/src/util/imgui_manager.h +++ b/src/util/imgui_manager.h @@ -130,9 +130,6 @@ static constexpr float OSD_WARNING_DURATION = 10.0f; static constexpr float OSD_INFO_DURATION = 5.0f; static constexpr float OSD_QUICK_DURATION = 2.5f; -/// Returns the scale of OSD elements. -float GetOSDScale(); - /// Adds OSD messages, duration is in seconds. void AddOSDMessage(std::string message, float duration = 2.0f); void AddKeyedOSDMessage(std::string key, std::string message, float duration = 2.0f);