Port code to pas2c dialect
authorunc0rr
Mon, 06 May 2019 21:20:56 +0200
changeset 14894 9b292184d793
parent 14893 b5a9dd36c7ea
child 14895 ff2c19a462de
Port code to pas2c dialect
hedgewars/uMisc.pas
--- a/hedgewars/uMisc.pas	Mon May 06 01:25:50 2019 +0200
+++ b/hedgewars/uMisc.pas	Mon May 06 21:20:56 2019 +0200
@@ -173,7 +173,7 @@
 
 {$IFDEF USE_VIDEO_RECORDING}
 // make image k times smaller (useful for saving thumbnails)
-procedure ReduceImage(img: PByte; width, height, k: LongInt);
+procedure ReduceImage(img: PByteArray; width, height, k: LongInt);
 var i, j, i0, j0, w, h, r, g, b: LongInt;
 begin
     w:= width  div k;
@@ -191,14 +191,14 @@
                 for i0:= 0 to k-1 do
                     for j0:= 0 to k-1 do
                     begin
-                        inc(r, img[4*(width*(i*k+i0) + j*k+j0)+0]);
-                        inc(g, img[4*(width*(i*k+i0) + j*k+j0)+1]);
-                        inc(b, img[4*(width*(i*k+i0) + j*k+j0)+2]);
+                        inc(r, img^[4*(width*(i*k+i0) + j*k + j0)+0]);
+                        inc(g, img^[4*(width*(i*k+i0) + j*k + j0)+1]);
+                        inc(b, img^[4*(width*(i*k+i0) + j*k + j0)+2]);
                     end;
-                img[4*(w*i + j)+0]:= r div (k*k);
-                img[4*(w*i + j)+1]:= g div (k*k);
-                img[4*(w*i + j)+2]:= b div (k*k);
-                img[4*(w*i + j)+3]:= 255;
+                img^[4*(w*i + j)+0]:= r div (k*k);
+                img^[4*(w*i + j)+1]:= g div (k*k);
+                img^[4*(w*i + j)+2]:= b div (k*k);
+                img^[4*(w*i + j)+3]:= 255;
             end;
     end;
 end;