hedgewars/uLandObjects.pas
changeset 12711 20dbb3a03e61
parent 12593 d6bd8b327a09
child 12758 49c31d8cc740
--- a/hedgewars/uLandObjects.pas	Wed Oct 18 05:28:22 2017 +0200
+++ b/hedgewars/uLandObjects.pas	Wed Oct 18 20:33:20 2017 -0400
@@ -35,7 +35,7 @@
 implementation
 uses uStore, uConsts, uConsole, uRandom, uSound
      , uTypes, uVariables, uDebug, uUtils
-     , uPhysFSLayer;
+     , uPhysFSLayer, adler32;
 
 const MaxRects = 512;
       MAXOBJECTRECTS = 16;
@@ -261,6 +261,9 @@
 if girSurf = nil then
     girSurf:= LoadDataImageAltPath(ptCurrTheme, ptGraphics, 'Girder', ifCritical or ifColorKey or ifIgnoreCaps);
 
+for y := 0 to girsurf^.h-1 do
+    syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PLongWordArray(girsurf^.pixels)^[y*girsurf^.w], girsurf^.w);
+
 girderHeight:= girSurf^.h;
 
 y:= topY+150;
@@ -498,7 +501,7 @@
 procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects);
 var s, key: shortstring;
     f: PFSFile;
-    i: LongInt;
+    i, y: LongInt;
     ii, t: Longword;
     c2: TSDL_Color;
 begin
@@ -695,6 +698,8 @@
             Delete(s, 1, i);
             if (Maxcnt < 1) or (Maxcnt > MAXTHEMEOBJECTS) then
                 OutError('Object''s max count should be between 1 and '+ inttostr(MAXTHEMEOBJECTS) +' (it was '+ inttostr(Maxcnt) +').', true);
+            for y := 0 to Surf^.h-1 do
+                syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PLongWordArray(Surf^.pixels)^[y*Surf^.w], Surf^.w);
 
             inrectcnt := 0;