w is in pixels, so presumably this needs to be *4
authornemo
Tue, 24 Oct 2017 18:55:19 -0400
changeset 12764 df9d9d19406a
parent 12763 49c31d8cc740
child 12765 5acf6b91df76
w is in pixels, so presumably this needs to be *4
hedgewars/uLandObjects.pas
hedgewars/uStore.pas
--- a/hedgewars/uLandObjects.pas	Tue Oct 24 18:28:59 2017 -0400
+++ b/hedgewars/uLandObjects.pas	Tue Oct 24 18:55:19 2017 -0400
@@ -262,7 +262,7 @@
     girSurf:= LoadDataImageAltPath(ptCurrTheme, ptGraphics, 'Girder', ifCritical or ifColorKey or ifIgnoreCaps);
 
 for y := 0 to girsurf^.h-1 do
-    syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(girsurf^.pixels)^[y*girsurf^.pitch], girsurf^.w);
+    syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(girsurf^.pixels)^[y*girsurf^.pitch], girsurf^.w*4);
 
 girderHeight:= girSurf^.h;
 
@@ -699,7 +699,7 @@
             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, @PByteArray(Surf^.pixels)^[y*Surf^.pitch], Surf^.w);
+                syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(Surf^.pixels)^[y*Surf^.pitch], Surf^.w*4);
 
             inrectcnt := 0;
 
--- a/hedgewars/uStore.pas	Tue Oct 24 18:28:59 2017 -0400
+++ b/hedgewars/uStore.pas	Tue Oct 24 18:55:19 2017 -0400
@@ -473,7 +473,7 @@
 {$ELSE}
                     if checkSum then
                         for y := 0 to tmpsurf^.h-1 do
-                            syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(tmpsurf^.pixels)^[y*tmpsurf^.pitch], tmpsurf^.w);
+                            syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(tmpsurf^.pixels)^[y*tmpsurf^.pitch], tmpsurf^.w*4);
 
                     if saveSurf then
                         Surface:= tmpsurf