Fixed window size problem when Celestia is launched in fullscreen mode. Switching from fullscreen mode to windowed mode now uses the window size parameters stored in the registry. RECT = {0, 0, 0, 0} was being used before.

ver1_5_1
Clint Weisbrod 2002-01-14 02:47:03 +00:00
parent cbc9c3d5ab
commit e84515e58c
1 changed files with 13 additions and 0 deletions

View File

@ -1802,6 +1802,15 @@ int APIENTRY WinMain(HINSTANCE hInstance,
prefs.winY = screenHeight - prefs.winHeight;
}
//Make sure windowRect contains default window size in case Celestia is
//launched in fullscreen mode. Without this code, CreateOpenGLWindow() will
//be called with windowRect = {0, 0, 0, 0} when the user switches to
//windowed mode.
windowRect.left = prefs.winX;
windowRect.top = prefs.winY;
windowRect.right = windowRect.left + prefs.winWidth;
windowRect.bottom = windowRect.top + prefs.winHeight;
bool startFullscreen;
if (strstr(lpCmdLine, "-fullscreen"))
startFullscreen = true;
@ -1841,6 +1850,10 @@ int APIENTRY WinMain(HINSTANCE hInstance,
{
hWnd = CreateOpenGLWindow(0, 0, 800, 600,
lastFullScreenMode, currentScreenMode);
//Prevent unnecessary destruction and recreation of OpenGLWindow in
//while() loop below.
newScreenMode = currentScreenMode;
}
else
{