hedgewars/uVariables.pas
branchflibqtfrontend
changeset 8363 0b4ac686fc44
parent 8358 274afc318dca
child 8373 209c9ba77a09
--- a/hedgewars/uVariables.pas	Tue Dec 18 20:48:37 2012 +0400
+++ b/hedgewars/uVariables.pas	Fri Jan 04 21:44:40 2013 +0400
@@ -27,14 +27,15 @@
 /////// init flags ///////
     cMinScreenWidth    : LongInt;
     cMinScreenHeight   : LongInt;
+    cFullscreenWidth   : LongInt;
+    cFullscreenHeight  : LongInt;
+    cWindowedWidth     : LongInt;
+    cWindowedHeight    : LongInt;
     cScreenWidth       : LongInt;
     cScreenHeight      : LongInt;
-    cOrigScreenWidth   : LongInt;
-    cOrigScreenHeight  : LongInt;
     cNewScreenWidth    : LongInt;
     cNewScreenHeight   : LongInt;
     cScreenResizeDelay : LongWord;
-    cBits              : LongInt;
     ipcPort            : Word;
     cFullScreen        : boolean;
     cLocaleFName       : shortstring;
@@ -2325,9 +2326,13 @@
 begin
     // initialisation flags - they are going to be overwritten by program args
 
-    cScreenWidth    := 1024;
-    cScreenHeight   := 768;
-    cBits           := 32;
+    cFullscreenWidth  := 0;
+    cFullscreenHeight := 0;
+    cWindowedWidth    := 1024;
+    cWindowedHeight   := 768;
+    cScreenWidth      := cWindowedWidth;
+    cScreenHeight     := cWindowedHeight;
+
     cShowFPS        := false;
     cAltDamage      := true;
     cTimerInterval  := 8;
@@ -2508,15 +2513,20 @@
     vobSDVelocity:= 15;
     vobSDFallSpeed:= 250;
 
-    cMinScreenWidth:= min(cScreenWidth, 640);
-    cMinScreenHeight:= min(cScreenHeight, 480);
-    cOrigScreenWidth:= cScreenWidth;
-    cOrigScreenHeight:= cScreenHeight;
+    cMinScreenWidth  := min(cScreenWidth, 640);
+    cMinScreenHeight := min(cScreenHeight, 480);
 
     cNewScreenWidth    := cScreenWidth;
     cNewScreenHeight   := cScreenHeight;
     cScreenResizeDelay := 0;
 
+    // make sure fullscreen resolution is always initialised somehow
+    if cFullscreenWidth = 0 then
+        cFullscreenWidth:= min(cWindowedWidth, 640);
+    if cFullscreenHeight = 0 then
+        cFullscreenHeight:= min(cWindowedHeight, 480);
+
+
     LuaGoals:= '';
     cMapName:= '';