From f75106c61b5e5baf71c47d9e17e759044a019989 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Thu, 16 May 2019 00:46:50 +0200 Subject: [PATCH] don't hardcode screen sizes --- src/libui_sdl/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 23e66173..dc67bb2f 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -223,8 +223,6 @@ void GLDrawing_DrawScreen() glUnmapBuffer(GL_UNIFORM_BUFFER); float scwidth, scheight; - scwidth = 512; - scheight = 384; float x0, y0, x1, y1; float s0, s1, s2, s3; @@ -241,6 +239,9 @@ void GLDrawing_DrawScreen() x1 = TopScreenRect.X + TopScreenRect.Width; y1 = TopScreenRect.Y + TopScreenRect.Height; + scwidth = 256 << ScreenScale[0]; + scheight = 192 << ScreenScale[0]; + switch (ScreenRotation) { case 0: @@ -279,13 +280,14 @@ void GLDrawing_DrawScreen() SETVERTEX(4, x0, y1, s2, t2); SETVERTEX(5, x1, y1, s3, t3); - // TODO: adjust scwidth/scheight - x0 = BottomScreenRect.X; y0 = BottomScreenRect.Y; x1 = BottomScreenRect.X + BottomScreenRect.Width; y1 = BottomScreenRect.Y + BottomScreenRect.Height; + scwidth = 256 << ScreenScale[1]; + scheight = 192 << ScreenScale[1]; + switch (ScreenRotation) { case 0: