Core: Apply DPI scaling to debug windows

This commit is contained in:
Connor McLaughlin
2020-02-28 16:59:51 +10:00
parent ce31c85983
commit 82eb14efb1
6 changed files with 30 additions and 19 deletions

View File

@ -789,7 +789,8 @@ static constexpr ADSRTableEntries ComputeADSRTableEntries()
{
entries[decreasing][rate].ticks = 1;
if (decreasing != 0)
entries[decreasing][rate].step = static_cast<s32>(static_cast<u32>(-8 + static_cast<s32>(rate & 3)) << (11 - (rate >> 2)));
entries[decreasing][rate].step =
static_cast<s32>(static_cast<u32>(-8 + static_cast<s32>(rate & 3)) << (11 - (rate >> 2)));
else
entries[decreasing][rate].step = (7 - static_cast<s32>(rate & 3)) << (11 - (rate >> 2));
}
@ -1146,8 +1147,9 @@ 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 = ImGui::GetIO().DisplayFramebufferScale.x;
ImGui::SetNextWindowSize(ImVec2(800, 600), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 600.0f * framebuffer_scale), ImGuiCond_FirstUseEver);
if (!ImGui::Begin("SPU State", &m_system->GetSettings().debugging.show_spu_state))
{
ImGui::End();
@ -1157,9 +1159,11 @@ void SPU::DrawDebugStateWindow()
// status
if (ImGui::CollapsingHeader("Status", ImGuiTreeNodeFlags_DefaultOpen))
{
static constexpr std::array<float, 6> offsets = {{100.0f, 200.0f, 300.0f, 420.0f, 500.0f, 600.0f}};
static constexpr std::array<const char*, 4> transfer_modes = {
{"Transfer Stopped", "Manual Write", "DMA Write", "DMA Read"}};
const std::array<float, 6> offsets = {{100.0f * framebuffer_scale, 200.0f * framebuffer_scale,
300.0f * framebuffer_scale, 420.0f * framebuffer_scale,
500.0f * framebuffer_scale, 600.0f * framebuffer_scale}};
ImGui::Text("Control: ");
ImGui::SameLine(offsets[0]);