mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
win32: Save/restore window position
This commit is contained in:
parent
0b87abe945
commit
e78193b907
@ -58,6 +58,9 @@ void Config::Load(const char *iniFileName)
|
||||
// "default" means let emulator decide, "" means disable.
|
||||
general->Get("ReportHost", &sReportHost, "default");
|
||||
general->Get("Recent", recentIsos);
|
||||
general->Get("WindowX", &iWindowX, 40);
|
||||
general->Get("WindowY", &iWindowY, 100);
|
||||
|
||||
if (recentIsos.size() > MAX_RECENT)
|
||||
recentIsos.resize(MAX_RECENT);
|
||||
|
||||
@ -134,6 +137,8 @@ void Config::Save()
|
||||
general->Set("ShowDebuggerOnLoad", bShowDebuggerOnLoad);
|
||||
general->Set("ReportHost", sReportHost);
|
||||
general->Set("Recent", recentIsos);
|
||||
general->Set("WindowX", iWindowX);
|
||||
general->Set("WindowY", iWindowY);
|
||||
|
||||
IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
|
||||
cpu->Set("Jit", bJit);
|
||||
|
@ -58,6 +58,8 @@ public:
|
||||
int iFrameSkip; // 0 = off; 1 = auto; (future: 2 = skip every 2nd frame; 3 = skip every 3rd frame etc).
|
||||
bool bUseMediaEngine;
|
||||
|
||||
int iWindowX;
|
||||
int iWindowY;
|
||||
int iWindowZoom; // for Windows
|
||||
bool SSAntiAliasing; //for Windows, too
|
||||
bool bVertexCache;
|
||||
|
@ -108,8 +108,8 @@ namespace MainWindow
|
||||
|
||||
void GetWindowRectAtZoom(int zoom, RECT &rcInner, RECT &rcOuter) {
|
||||
// GetWindowRect(hwndMain, &rcInner);
|
||||
rcInner.left = 20;
|
||||
rcInner.top = 120;
|
||||
rcInner.left = g_Config.iWindowX;
|
||||
rcInner.top = g_Config.iWindowY;
|
||||
|
||||
rcInner.right=480*zoom + rcInner.left;//+client edge
|
||||
rcInner.bottom=272*zoom + rcInner.top; //+client edge
|
||||
@ -118,6 +118,17 @@ namespace MainWindow
|
||||
AdjustWindowRect(&rcOuter, WS_OVERLAPPEDWINDOW, TRUE);
|
||||
}
|
||||
|
||||
void SavePosition() {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void ResizeDisplay(bool noWindowMovement = false) {
|
||||
RECT rc;
|
||||
GetClientRect(hwndMain, &rc);
|
||||
@ -291,10 +302,12 @@ namespace MainWindow
|
||||
break;
|
||||
|
||||
case WM_MOVE:
|
||||
SavePosition();
|
||||
ResizeDisplay();
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
SavePosition();
|
||||
ResizeDisplay();
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user