# HG changeset patch # User alfadur # Date 1566229691 -10800 # Node ID ae4c5738e8cbf23c625d2281c2b95f9ef729abea # Parent 0230c4766aa661eda278ca6071159db791aefb47 copy alpha extraction to the other digest computation diff -r 0230c4766aa6 -r ae4c5738e8cb hedgewars/uStore.pas --- a/hedgewars/uStore.pas Mon Aug 19 11:41:59 2019 -0400 +++ b/hedgewars/uStore.pas Mon Aug 19 18:48:11 2019 +0300 @@ -385,7 +385,8 @@ var ii: TSprite; ai: TAmmoType; tmpsurf, tmpoverlay: PSDL_Surface; - i, y, imflags: LongInt; + i, y, x, imflags: LongInt; + rowData: PByte; keyConfirm, keyQuit: shortstring; begin AddFileLog('StoreLoad()'); @@ -432,11 +433,17 @@ // load the image tmpsurf := LoadDataImageAltPath(Path, AltPath, FileName, imflags); if (tmpsurf <> nil) and checkSum then + begin + rowData := GetMem(tmpsurf^.w); for y := 0 to tmpsurf^.h-1 do begin - syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(tmpsurf^.pixels)^[y*tmpsurf^.pitch], tmpsurf^.w*4); + for x := 0 to tmpsurf^.w - 1 do + (rowData + x)^:= (PByte(tmpsurf^.pixels) + y * tmpsurf^.pitch + x * 4 + AByteIndex)^; + syncedPixelDigest:= Adler32Update(syncedPixelDigest, rowData, tmpsurf^.w); AddFileLog(FileName + ': ' + IntToStr(syncedPixelDigest)); end; + FreeMem(rowData, tmpsurf^.w); + end; end; if tmpsurf <> nil then