hedgewars/uStore.pas
changeset 15348 ae4c5738e8cb
parent 15345 4e91a7050add
child 15349 9fca575e3c88
equal deleted inserted replaced
15347:0230c4766aa6 15348:ae4c5738e8cb
   383 
   383 
   384 procedure StoreLoad(reload: boolean);
   384 procedure StoreLoad(reload: boolean);
   385 var ii: TSprite;
   385 var ii: TSprite;
   386     ai: TAmmoType;
   386     ai: TAmmoType;
   387     tmpsurf, tmpoverlay: PSDL_Surface;
   387     tmpsurf, tmpoverlay: PSDL_Surface;
   388     i, y, imflags: LongInt;
   388     i, y, x, imflags: LongInt;
       
   389     rowData: PByte;
   389     keyConfirm, keyQuit: shortstring;
   390     keyConfirm, keyQuit: shortstring;
   390 begin
   391 begin
   391 AddFileLog('StoreLoad()');
   392 AddFileLog('StoreLoad()');
   392 
   393 
   393 if not cOnlyStats then
   394 if not cOnlyStats then
   430                     imflags := (imflags or ifCritical);
   431                     imflags := (imflags or ifCritical);
   431 
   432 
   432                 // load the image
   433                 // load the image
   433                 tmpsurf := LoadDataImageAltPath(Path, AltPath, FileName, imflags);
   434                 tmpsurf := LoadDataImageAltPath(Path, AltPath, FileName, imflags);
   434                 if (tmpsurf <> nil) and checkSum then
   435                 if (tmpsurf <> nil) and checkSum then
       
   436                     begin
       
   437                     rowData := GetMem(tmpsurf^.w);
   435                     for y := 0 to tmpsurf^.h-1 do
   438                     for y := 0 to tmpsurf^.h-1 do
   436                         begin
   439                         begin
   437                         syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(tmpsurf^.pixels)^[y*tmpsurf^.pitch], tmpsurf^.w*4);
   440                         for x := 0 to tmpsurf^.w - 1 do
       
   441                             (rowData + x)^:= (PByte(tmpsurf^.pixels) + y * tmpsurf^.pitch + x * 4 + AByteIndex)^;
       
   442                         syncedPixelDigest:= Adler32Update(syncedPixelDigest, rowData, tmpsurf^.w);
   438                         AddFileLog(FileName + ': ' + IntToStr(syncedPixelDigest));
   443                         AddFileLog(FileName + ': ' + IntToStr(syncedPixelDigest));
   439                         end;
   444                         end;
       
   445                     FreeMem(rowData, tmpsurf^.w);
       
   446                     end;
   440                 end;
   447                 end;
   441 
   448 
   442             if tmpsurf <> nil then
   449             if tmpsurf <> nil then
   443                 begin
   450                 begin
   444                 if getImageDimensions then
   451                 if getImageDimensions then