Wrap the display globals in a struct (#16998)

* Wrap the display globals in a struct

Makes it easier to search/replace these, for future refactorings.

* Some renaming

* Qt buildfix, also fix the Qt build on Mac (got broken with battery changes)

* Attempt at buildfixing ios

* UWP buildfix
This commit is contained in:
Henrik Rydgård
2023-02-25 13:09:44 +01:00
committed by GitHub
parent 3e98d313a8
commit 8b431b39ba
48 changed files with 319 additions and 313 deletions
+5 -5
View File
@@ -50,10 +50,10 @@ enum Mode {
static Bounds FRectToBounds(FRect rc) {
Bounds b;
b.x = rc.x * g_dpi_scale_x;
b.y = rc.y * g_dpi_scale_y;
b.w = rc.w * g_dpi_scale_x;
b.h = rc.h * g_dpi_scale_y;
b.x = rc.x * g_display.dpi_scale_x;
b.y = rc.y * g_display.dpi_scale_y;
b.w = rc.w * g_display.dpi_scale_x;
b.h = rc.h * g_display.dpi_scale_y;
return b;
}
@@ -132,7 +132,7 @@ void DisplayLayoutScreen::DrawBackground(UIContext &dc) {
// we have to draw a substitute ourselves.
// TODO: Clean this up a bit, this GetScreenFrame/CenterDisplay combo is too common.
FRect screenFrame = GetScreenFrame(pixel_xres, pixel_yres);
FRect screenFrame = GetScreenFrame(g_display.pixel_xres, g_display.pixel_yres);
FRect rc;
CenterDisplayOutputRect(&rc, 480.0f, 272.0f, screenFrame, g_Config.iInternalScreenRotation);