src/gfx.cpp
changeset 7111 269c76b5b987
parent 6987 b0f13039bda2
child 7120 e31767effc16
--- a/src/gfx.cpp	Mon May 14 14:06:46 2007 +0000
+++ b/src/gfx.cpp	Mon May 14 15:20:50 2007 +0000
@@ -64,12 +64,12 @@
 
 void memcpy_pitch(void *dst, void *src, int w, int h, int srcpitch, int dstpitch)
 {
-	byte *dstp = (byte*)dst;
-	byte *srcp = (byte*)src;
+	Pixel *dstp = (Pixel *)dst;
+	Pixel *srcp = (Pixel *)src;
 
 	assert(h >= 0);
 	for (; h != 0; --h) {
-		memcpy(dstp, srcp, w);
+		memcpy(dstp, srcp, w * sizeof(Pixel));
 		dstp += dstpitch;
 		srcp += srcpitch;
 	}
@@ -110,7 +110,7 @@
 		}
 
 		for (ht = height; ht > 0; --ht) {
-			memcpy(dst, src, width);
+			memcpy(dst, src, width * sizeof(Pixel));
 			src -= p;
 			dst -= p;
 		}
@@ -136,7 +136,7 @@
 		/* the y-displacement may be 0 therefore we have to use memmove,
 		 * because source and destination may overlap */
 		for (ht = height; ht > 0; --ht) {
-			memmove(dst, src, width);
+			memmove(dst, src, width * sizeof(Pixel));
 			src += p;
 			dst += p;
 		}
@@ -175,7 +175,7 @@
 	if (!HASBIT(color, PALETTE_MODIFIER_GREYOUT)) {
 		if (!HASBIT(color, USE_COLORTABLE)) {
 			do {
-				memset(dst, color, right);
+				memset(dst, color, right * sizeof(Pixel));
 				dst += dpi->pitch;
 			} while (--bottom);
 		} else {