--- 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;