don't override user defined size when resizing
authornemo
Tue, 23 Aug 2011 09:12:45 -0400 (2011-08-23)
changeset 5672 34bb680476d4
parent 5670 e01f0b6f1969
child 5673 85336f377479
don't override user defined size when resizing
hedgewars/hwengine.pas
hedgewars/uVariables.pas
--- a/hedgewars/hwengine.pas	Tue Aug 23 12:53:47 2011 +0200
+++ b/hedgewars/hwengine.pas	Tue Aug 23 09:12:45 2011 -0400
@@ -177,10 +177,10 @@
                         end;
                 SDL_VIDEORESIZE: begin
                     // using lower values causes widget overlap and video issues
-                    if event.resize.w > 768 then cScreenWidth:= event.resize.w
-                    else cScreenWidth:= 768;
-                    if event.resize.h > 576 then cScreenHeight:= event.resize.h
-                    else cScreenHeight:= 576;
+                    if event.resize.w > cMinScreenWidth then cScreenWidth:= event.resize.w
+                    else cScreenWidth:= cMinScreenWidth;
+                    if event.resize.h > cMinScreenHeight then cScreenHeight:= event.resize.h
+                    else cScreenHeight:= cMinScreenHeight;
                     ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
                     WriteLnToConsole('window resize');
                     end;
@@ -239,6 +239,10 @@
     recordFileName:= gameArgs[10];
     cStereoMode:= smNone;
 {$ENDIF}
+    cMinScreenWidth:= cScreenWidth;
+    cMinScreenHeight:= cScreenHeight;
+    if 768 < cMinScreenWidth then cMinScreenWidth:= 768;
+    if 576 < cMinScreenHeight then cMinScreenHeight:= 576;
 
     initEverything(true);
 
--- a/hedgewars/uVariables.pas	Tue Aug 23 12:53:47 2011 +0200
+++ b/hedgewars/uVariables.pas	Tue Aug 23 09:12:45 2011 -0400
@@ -25,6 +25,8 @@
 
 var
 /////// init flags ///////
+    cMinScreenWidth  : LongInt     = 768;
+    cMinScreenHeight : LongInt     = 576;
     cScreenWidth    : LongInt     = 1024;
     cScreenHeight   : LongInt     = 768;
     cBits           : LongInt     = 32;