hedgewars/uStore.pas
changeset 8354 c25bee85d6f8
parent 8309 edcfb5e43245
child 8359 9a7024b2a4d3
--- a/hedgewars/uStore.pas	Thu Jan 03 15:58:23 2013 +0200
+++ b/hedgewars/uStore.pas	Thu Jan 03 15:59:30 2013 +0200
@@ -1142,6 +1142,17 @@
     if Length(s) = 0 then
          cFullScreen:= (not cFullScreen)
     else cFullScreen:= s = '1';
+    
+    if cFullScreen then
+        begin
+        cScreenWidth:= cFullscreenWidth;
+        cScreenHeight:= cFullscreenHeight;
+        end
+    else
+        begin
+        cScreenWidth:= cWindowedWidth;
+        cScreenHeight:= cWindowedHeight;
+        end;
 
     AddFileLog('Preparing to change video parameters...');
 {$IFDEF SDL13}
@@ -1219,15 +1230,18 @@
 
     if SDLwindow = nil then
         if cFullScreen then
-            SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cOrigScreenWidth, cOrigScreenHeight, flags or SDL_WINDOW_FULLSCREEN)
+            SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, flags or SDL_WINDOW_FULLSCREEN)
         else
+            begin
             SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, flags);
+            end;
     SDLTry(SDLwindow <> nil, true);
 {$ELSE}
     flags:= SDL_OPENGL or SDL_RESIZABLE;
     if cFullScreen then
+        begin
         flags:= flags or SDL_FULLSCREEN;
-
+        end;
     if not cOnlyStats then
         begin
     {$IFDEF WIN32}