mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
@@ -328,6 +328,7 @@ static const ConfigSetting generalSettings[] = {
|
||||
ConfigSetting("WindowY", SETTING(g_Config, iWindowY), -1, CfgFlag::DEFAULT),
|
||||
ConfigSetting("WindowWidth", SETTING(g_Config, iWindowWidth), 0, CfgFlag::DEFAULT), // 0 will be automatically reset later (need to do the AdjustWindowRect dance).
|
||||
ConfigSetting("WindowHeight", SETTING(g_Config, iWindowHeight), 0, CfgFlag::DEFAULT),
|
||||
ConfigSetting("WindowSizeState", SETTING(g_Config, iWindowSizeState), (int)WindowSizeState::Normal, CfgFlag::DEFAULT),
|
||||
ConfigSetting("ShrinkIfWindowSmall", SETTING(g_Config, bShrinkIfWindowSmall), false, CfgFlag::DEFAULT),
|
||||
#endif
|
||||
|
||||
|
||||
@@ -293,6 +293,8 @@ public:
|
||||
int iWindowY;
|
||||
int iWindowWidth; // Windows and other windowed environments
|
||||
int iWindowHeight;
|
||||
int iWindowSizeState; // WindowSizeState enum
|
||||
|
||||
bool bShowMenuBar; // Windows-only
|
||||
|
||||
float fUITint;
|
||||
|
||||
@@ -97,6 +97,13 @@ enum TextureFiltering {
|
||||
TEX_FILTER_AUTO_MAX_QUALITY = 4,
|
||||
};
|
||||
|
||||
// Can't be named WindowState due to collision with SDL.
|
||||
enum class WindowSizeState {
|
||||
Normal = 0,
|
||||
Minimized = 1,
|
||||
Maximized = 2,
|
||||
};
|
||||
|
||||
enum ReplacementTextureLoadSpeed {
|
||||
SLOW = 0,
|
||||
MEDIUM = 1,
|
||||
|
||||
+35
-7
@@ -188,14 +188,22 @@ namespace MainWindow
|
||||
|
||||
WINDOWPLACEMENT placement{};
|
||||
GetWindowPlacement(hwndMain, &placement);
|
||||
if (placement.showCmd == SW_SHOWNORMAL) {
|
||||
RECT rc;
|
||||
GetWindowRect(hwndMain, &rc);
|
||||
g_Config.iWindowX = rc.left;
|
||||
g_Config.iWindowY = rc.top;
|
||||
g_Config.iWindowWidth = rc.right - rc.left;
|
||||
g_Config.iWindowHeight = rc.bottom - rc.top;
|
||||
switch (placement.showCmd) {
|
||||
case SW_SHOWMAXIMIZED:
|
||||
g_Config.iWindowSizeState = (int)WindowSizeState::Maximized;
|
||||
break;
|
||||
case SW_SHOWMINIMIZED:
|
||||
g_Config.iWindowSizeState = (int)WindowSizeState::Minimized;
|
||||
break;
|
||||
case SW_SHOWNORMAL:
|
||||
g_Config.iWindowSizeState = (int)WindowSizeState::Normal;
|
||||
break;
|
||||
}
|
||||
|
||||
g_Config.iWindowX = placement.rcNormalPosition.left;
|
||||
g_Config.iWindowY = placement.rcNormalPosition.top;
|
||||
g_Config.iWindowWidth = placement.rcNormalPosition.right - placement.rcNormalPosition.left;
|
||||
g_Config.iWindowHeight = placement.rcNormalPosition.bottom - placement.rcNormalPosition.top;
|
||||
}
|
||||
|
||||
static void GetWindowSizeAtResolution(int xres, int yres, int *windowWidth, int *windowHeight) {
|
||||
@@ -475,6 +483,25 @@ namespace MainWindow
|
||||
|
||||
hwndMain = CreateWindowEx(0, szWindowClass, L"", style,
|
||||
rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, hInstance, NULL);
|
||||
|
||||
WINDOWPLACEMENT placement = {sizeof(WINDOWPLACEMENT)};
|
||||
placement.showCmd = SW_SHOWNORMAL;
|
||||
switch ((WindowSizeState)g_Config.iWindowSizeState) {
|
||||
case WindowSizeState::Maximized:
|
||||
placement.showCmd = SW_SHOWMAXIMIZED;
|
||||
break;
|
||||
case WindowSizeState::Minimized:
|
||||
placement.showCmd = SW_SHOWMINIMIZED;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
placement.rcNormalPosition.left = g_Config.iWindowX;
|
||||
placement.rcNormalPosition.top = g_Config.iWindowY;
|
||||
placement.rcNormalPosition.right = g_Config.iWindowX + g_Config.iWindowWidth;
|
||||
placement.rcNormalPosition.bottom = g_Config.iWindowY + g_Config.iWindowHeight;
|
||||
SetWindowPlacement(hwndMain, &placement);
|
||||
|
||||
if (!hwndMain)
|
||||
return FALSE;
|
||||
|
||||
@@ -874,6 +901,7 @@ namespace MainWindow
|
||||
default:
|
||||
break;
|
||||
}
|
||||
SavePosition();
|
||||
break;
|
||||
|
||||
// Wheel events have to stay in WndProc for compatibility with older Windows(7). See #12156
|
||||
|
||||
+1
-1
Submodule ext/aemu_postoffice updated: e51fb68b7a...098039af82
Reference in New Issue
Block a user