fix clouds/flakes area not being adjusted after ResizeLand()
authorsheepluva
Tue, 26 Apr 2016 14:22:54 +0200
changeset 11709 1694b379c83f
parent 11708 607e2e43acf0
child 11710 4b2179d9516c
fix clouds/flakes area not being adjusted after ResizeLand()
hedgewars/uLandUtils.pas
hedgewars/uVariables.pas
--- a/hedgewars/uLandUtils.pas	Tue Apr 26 12:27:17 2016 +0200
+++ b/hedgewars/uLandUtils.pas	Tue Apr 26 14:22:54 2016 +0200
@@ -30,6 +30,7 @@
     if (width div 4096 >= 2) or (height div 2048 >= 2) then cMaxZoomLevel:= cMaxZoomLevel/2;
     cMinMaxZoomLevelDelta:= cMaxZoomLevel - cMinZoomLevel
     end;
+initScreenSpaceVars();
 end;
 
 procedure InitWorldEdges();
--- 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;