hedgewars/uMisc.pas
changeset 3765 ebfe7c9b3085
parent 3764 eb91c02f2d84
child 3774 af0e68ca273e
--- a/hedgewars/uMisc.pas	Tue Aug 24 17:03:44 2010 +0200
+++ b/hedgewars/uMisc.pas	Wed Aug 25 00:17:51 2010 +0200
@@ -74,11 +74,11 @@
     // originally from uConsts
     Pathz: array[TPathType] of shortstring;
     CountTexz: array[1..Pred(AMMO_INFINITE)] of PTexture;
-    LAND_WIDTH  :longint;
-    LAND_HEIGHT :longint;
-    LAND_WIDTH_MASK  :longWord;
-    LAND_HEIGHT_MASK :longWord;
-    cMaxCaptions : LongInt;
+    LAND_WIDTH       : LongInt;
+    LAND_HEIGHT      : LongInt;
+    LAND_WIDTH_MASK  : LongWord;
+    LAND_HEIGHT_MASK : LongWord;
+    cMaxCaptions     : LongInt;
 
     // init flags
     cScreenWidth    : LongInt = 1024;
@@ -98,9 +98,9 @@
     //userNick is in uChat
     recordFileName  : shortstring = '';
 
-    cLeftScreenBorder     : LongInt = 0;
-    cRightScreenBorder    : LongInt = 0;
-    cScreenSpace          : LongInt = 0;
+    cLeftScreenBorder     : LongInt;
+    cRightScreenBorder    : LongInt;
+    cScreenSpace          : LongInt;
 
     cCaseFactor     : Longword;
     cLandAdditions  : Longword;
@@ -786,6 +786,11 @@
 
     ScreenFade      := sfNone;
 
+    // those values still aren't perfect
+    cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
+    cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH);
+    cScreenSpace:= cRightScreenBorder - cLeftScreenBorder;
+
 {$IFDEF IPHONEOS}
     if isPhone() then
         cMaxCaptions:= 3