hedgewars/uVariables.pas
changeset 11704 1694b379c83f
parent 11520 663ecfb05df6
child 11734 f48408dcea36
--- a/hedgewars/uVariables.pas	Tue Apr 26 12:27:17 2016 +0200
+++ b/hedgewars/uVariables.pas	Tue Apr 26 14:22:54 2016 +0200
@@ -23,6 +23,8 @@
 
 uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uUtils{$IFDEF GL2}, uMatrix{$ENDIF};
 
+procedure initScreenSpaceVars();
+
 var
 /////// init flags ///////
     cMinScreenWidth    : LongInt;
@@ -2514,6 +2516,14 @@
     cTagsMask:= htTeamName or htName or htHealth;
 end;
 
+procedure initScreenSpaceVars();
+begin
+    // those values still are not perfect
+    cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
+    cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH);
+    cScreenSpace:= cRightScreenBorder - cLeftScreenBorder;
+end;
+
 procedure initModule;
 var s: shortstring;
     i: integer;
@@ -2694,10 +2704,7 @@
     CinematicBarH   := 0;
     CinematicScript := false;
 
-    // those values still are not perfect
-    cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
-    cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH);
-    cScreenSpace:= cRightScreenBorder - cLeftScreenBorder;
+    initScreenSpaceVars();
 
     dirtyLandTexCount:= 0;