the -1 was a bad idea
authornemo
Tue, 07 Jul 2009 01:53:44 +0000
changeset 2236 af8fc3311748
parent 2235 79c9542c1058
child 2237 cf0890ce8ea4
the -1 was a bad idea
hedgewars/uLandGraphics.pas
--- a/hedgewars/uLandGraphics.pas	Tue Jul 07 01:51:46 2009 +0000
+++ b/hedgewars/uLandGraphics.pas	Tue Jul 07 01:53:44 2009 +0000
@@ -361,8 +361,7 @@
 bpp:= Image^.format^.BytesPerPixel;
 TryDo(bpp = 4, 'It should be 32 bpp sprite', true);
 // Check that sprite fits free space
-//p:= @(PByteArray(Image^.pixels)^[Image^.pitch * ( col * h + row * w )]);
-p:= @(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 - 1 ]);
+p:= @(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]);
 case bpp of
      4: for y:= 0 to Pred(h) do
             begin
@@ -391,7 +390,7 @@
    end;
 
 // Checked, now place
-p:= @(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 - 1 ]);
+p:= @(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]);
 case bpp of
      4: for y:= 0 to Pred(h) do
             begin