Fix texture copying routine not taking pitch into account
authorunc0rr
Tue, 26 Jul 2022 12:37:17 +0200
changeset 15852 c4561095666a
parent 15851 9bb85e43e492
child 15858 3513c9122882
Fix texture copying routine not taking pitch into account
hedgewars/uRenderUtils.pas
--- a/hedgewars/uRenderUtils.pas	Fri May 20 17:24:14 2022 -0400
+++ b/hedgewars/uRenderUtils.pas	Tue Jul 26 12:37:17 2022 +0200
@@ -188,9 +188,9 @@
     for iY:= srcY to lY do
         begin
         // src pixel index
-        spi:= iY * src^.w  + iX;
+        spi:= iY * src^.pitch div 4  + iX;
         // dest pixel index
-        dpi:= (iY + dY) * dest^.w + (iX + dX);
+        dpi:= (iY + dY) * dest^.pitch div 4 + (iX + dX);
 
         // get src alpha (and set it as target alpha for now)
         aT:= (srcPixels^[spi] and AMask) shr AShift;