# HG changeset patch # User nemo # Date 1508975082 14400 # Node ID d01e9dd5c439fbed202a42769f718691001a972d # Parent 272fcd3833d21d23d2a2ed2121cba2bde39d636c checksum immediately after loading because surface2tex does surface manipulation. also add some FIXMEs diff -r 272fcd3833d2 -r d01e9dd5c439 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Wed Oct 25 23:47:07 2017 +0200 +++ b/hedgewars/uStore.pas Wed Oct 25 19:44:42 2017 -0400 @@ -417,7 +417,10 @@ imflags := (imflags or ifCritical); // load the image - tmpsurf := LoadDataImageAltPath(Path, AltPath, FileName, imflags) + tmpsurf := LoadDataImageAltPath(Path, AltPath, FileName, imflags); + if (tmpsurf <> nil) and checkSum then + for y := 0 to tmpsurf^.h-1 do + syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(tmpsurf^.pixels)^[y*tmpsurf^.pitch], tmpsurf^.w*4) end; if tmpsurf <> nil then @@ -471,10 +474,6 @@ {$IFDEF USE_CONTEXT_RESTORE} Surface:= tmpsurf {$ELSE} - if checkSum then - for y := 0 to tmpsurf^.h-1 do - syncedPixelDigest:= Adler32Update(syncedPixelDigest, @PByteArray(tmpsurf^.pixels)^[y*tmpsurf^.pitch], tmpsurf^.w*4); - if saveSurf then Surface:= tmpsurf else diff -r 272fcd3833d2 -r d01e9dd5c439 hedgewars/uTextures.pas --- a/hedgewars/uTextures.pas Wed Oct 25 23:47:07 2017 +0200 +++ b/hedgewars/uTextures.pas Wed Oct 25 19:44:42 2017 -0400 @@ -244,9 +244,11 @@ fromP4:= Surf^.pixels; +// FIXME move out of surface2tex if GrayScale then Surface2GrayScale(Surf); +// FIXME move out of surface2tex PrettifySurfaceAlpha(surf, fromP4); if (not SupportNPOTT) and (not (isPowerOf2(Surf^.w) and isPowerOf2(Surf^.h))) then