src/screenshot.cpp
branchgamebalance
changeset 9911 0b8b245a2391
parent 9910 0b2aebc8283e
child 9913 e79cd19772dd
--- a/src/screenshot.cpp	Wed Jun 13 11:17:30 2007 +0000
+++ b/src/screenshot.cpp	Wed Jun 13 11:45:14 2007 +0000
@@ -449,7 +449,7 @@
 static void CurrentScreenCallback(void *userdata, Pixel *buf, uint y, uint pitch, uint n)
 {
 	for (; n > 0; --n) {
-		memcpy(buf, _screen.dst_ptr + y * _screen.pitch, _screen.width);
+		memcpy(buf, _screen.dst_ptr + y * _screen.pitch, _screen.width * sizeof(Pixel));
 		++y;
 		buf += pitch;
 	}
@@ -469,7 +469,7 @@
 	dpi.height = n;
 	dpi.width = vp->width;
 	dpi.pitch = pitch;
-	dpi.zoom = 0;
+	dpi.zoom = ZOOM_LVL_WORLD_SCREENSHOT;
 	dpi.left = 0;
 	dpi.top = y;
 
@@ -479,10 +479,10 @@
 		left += wx;
 
 		ViewportDoDraw(vp,
-			((left - wx - vp->left) << vp->zoom) + vp->virtual_left,
-			((y - vp->top) << vp->zoom) + vp->virtual_top,
-			((left - vp->left) << vp->zoom) + vp->virtual_left,
-			(((y + n) - vp->top) << vp->zoom) + vp->virtual_top
+			ScaleByZoom(left - wx - vp->left, vp->zoom) + vp->virtual_left,
+			ScaleByZoom(y - vp->top, vp->zoom) + vp->virtual_top,
+			ScaleByZoom(left - vp->left, vp->zoom) + vp->virtual_left,
+			ScaleByZoom((y + n) - vp->top, vp->zoom) + vp->virtual_top
 		);
 	}
 
@@ -540,7 +540,7 @@
 	ViewPort vp;
 	const ScreenshotFormat *sf;
 
-	vp.zoom = 0;
+	vp.zoom = ZOOM_LVL_WORLD_SCREENSHOT;
 	vp.left = 0;
 	vp.top = 0;
 	vp.virtual_left = -(int)MapMaxX() * TILE_PIXELS;