Remove more bad uses of dp_xres. Fix a data flow issue

(could end up with "feedback" if modifying the screen bounds)
This commit is contained in:
Henrik Rydgard
2014-02-10 15:55:21 +01:00
parent c6caff61bf
commit ca9d0ea5cf
8 changed files with 83 additions and 66 deletions
+7 -3
View File
@@ -210,6 +210,7 @@ namespace MainWindow
}
void ResizeDisplay(bool displayOSM = true, bool noWindowMovement = false) {
int width = PSP_CoreParameter().pixelWidth, height = PSP_CoreParameter().pixelHeight;
RECT rc;
GetClientRect(hwndMain, &rc);
if (!noWindowMovement) {
@@ -217,9 +218,10 @@ namespace MainWindow
(rc.bottom - rc.top) == PSP_CoreParameter().pixelHeight)
return;
PSP_CoreParameter().pixelWidth = rc.right - rc.left;
PSP_CoreParameter().pixelHeight = rc.bottom - rc.top;
MoveWindow(hwndDisplay, 0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight, TRUE);
width = rc.right - rc.left;
height = rc.bottom - rc.top;
// Moves the internal window, not the frame. TODO: Get rid of the internal window.
MoveWindow(hwndDisplay, 0, 0, width, height, TRUE);
}
// Round up to a zoom factor for the render size.
@@ -227,6 +229,7 @@ namespace MainWindow
if (zoom == 0) // auto mode
zoom = (rc.right - rc.left + 479) / 480;
// Actually, auto mode should be more granular...
PSP_CoreParameter().renderWidth = 480 * zoom;
PSP_CoreParameter().renderHeight = 272 * zoom;
@@ -239,6 +242,7 @@ namespace MainWindow
osm.Show(g->T(message), 2.0f);
}
UpdateScreenScale(width, height);
NativeMessageReceived("gpu resized", "");
}