win32: fix bug where screen scale and size are not correctly handled when relaunching emulator

This commit is contained in:
zeromus 2009-07-16 05:10:39 +00:00
parent 71441a541d
commit 3c0646c423
1 changed files with 16 additions and 19 deletions

View File

@ -375,14 +375,21 @@ VOID CALLBACK KeyInputTimer( UINT idEvent, UINT uMsg, DWORD_PTR dwUser, DWORD_PT
}
void ScaleScreen(float factor)
{
if(windowSize == 0)
{
int w = GetPrivateProfileInt("Video", "Window width", 256, IniName);
int h = GetPrivateProfileInt("Video", "Window height", 384, IniName);
MainWindow->setClientSize(w, h);
}
else
{
if(factor==65535)
factor = 1.5f;
else if(factor==65534)
factor = 2.5f;
MainWindow->setClientSize((video.rotatedwidthgap() * factor), (video.rotatedheightgap() * factor));
}
}
void translateXY(s32& x, s32& y)
@ -1439,18 +1446,7 @@ int _main()
MainWindow->setMinSize(video.rotatedwidthgap(), video.rotatedheightgap());
{
if(windowSize == 0)
{
int w = GetPrivateProfileInt("Video", "Window width", 256, IniName);
int h = GetPrivateProfileInt("Video", "Window height", 384, IniName);
MainWindow->setClientSize(w, h);
}
else
{
ScaleScreen(windowSize);
}
}
DragAcceptFiles(MainWindow->getHWnd(), TRUE);
@ -2374,6 +2370,7 @@ void FilterUpdate (HWND hwnd){
UpdateWndRects(hwnd);
SetScreenGap(video.screengap);
SetRotate(hwnd, video.rotation);
ScaleScreen(windowSize);
WritePrivateProfileInt("Video", "Filter", video.currentfilter, IniName);
WritePrivateProfileInt("Video", "Width", video.width, IniName);
WritePrivateProfileInt("Video", "Height", video.height, IniName);