don't hardcode screen sizes

This commit is contained in:
Arisotura 2019-05-16 00:46:50 +02:00
parent f2725791d8
commit f75106c61b
1 changed files with 6 additions and 4 deletions

View File

@ -223,8 +223,6 @@ void GLDrawing_DrawScreen()
glUnmapBuffer(GL_UNIFORM_BUFFER); glUnmapBuffer(GL_UNIFORM_BUFFER);
float scwidth, scheight; float scwidth, scheight;
scwidth = 512;
scheight = 384;
float x0, y0, x1, y1; float x0, y0, x1, y1;
float s0, s1, s2, s3; float s0, s1, s2, s3;
@ -241,6 +239,9 @@ void GLDrawing_DrawScreen()
x1 = TopScreenRect.X + TopScreenRect.Width; x1 = TopScreenRect.X + TopScreenRect.Width;
y1 = TopScreenRect.Y + TopScreenRect.Height; y1 = TopScreenRect.Y + TopScreenRect.Height;
scwidth = 256 << ScreenScale[0];
scheight = 192 << ScreenScale[0];
switch (ScreenRotation) switch (ScreenRotation)
{ {
case 0: case 0:
@ -279,13 +280,14 @@ void GLDrawing_DrawScreen()
SETVERTEX(4, x0, y1, s2, t2); SETVERTEX(4, x0, y1, s2, t2);
SETVERTEX(5, x1, y1, s3, t3); SETVERTEX(5, x1, y1, s3, t3);
// TODO: adjust scwidth/scheight
x0 = BottomScreenRect.X; x0 = BottomScreenRect.X;
y0 = BottomScreenRect.Y; y0 = BottomScreenRect.Y;
x1 = BottomScreenRect.X + BottomScreenRect.Width; x1 = BottomScreenRect.X + BottomScreenRect.Width;
y1 = BottomScreenRect.Y + BottomScreenRect.Height; y1 = BottomScreenRect.Y + BottomScreenRect.Height;
scwidth = 256 << ScreenScale[1];
scheight = 192 << ScreenScale[1];
switch (ScreenRotation) switch (ScreenRotation)
{ {
case 0: case 0: