(svn r321) -Fix: crash when making png screenshot with odd resolution (Tron)
authortruelight
Sat, 25 Sep 2004 18:30:19 +0000
changeset 315 e008762a8689
parent 314 a71488713a05
child 316 58a46fe09c50
(svn r321) -Fix: crash when making png screenshot with odd resolution (Tron)
-Fix: unable to select other screenshot format in Game Option
screenshot.c
settings_gui.c
--- a/screenshot.c	Sat Sep 25 17:37:32 2004 +0000
+++ b/screenshot.c	Sat Sep 25 18:30:19 2004 +0000
@@ -376,8 +376,12 @@
 // screenshot generator that dumps the current video buffer
 void CurrentScreenCallback(void *userdata, byte *buf, uint y, uint pitch, uint n)
 {
-	assert(_screen.pitch == (int)pitch);
-	memcpy(buf, _screen.dst_ptr + y * _screen.pitch, n * _screen.pitch);
+	for (; n > 0; --n)
+	{
+		memcpy(buf, _screen.dst_ptr + y * _screen.pitch, _screen.width);
+		++y;
+		buf += pitch;
+	}
 }
 
 extern void ViewportDoDraw(ViewPort *vp, int left, int top, int right, int bottom);
--- a/settings_gui.c	Sat Sep 25 17:37:32 2004 +0000
+++ b/settings_gui.c	Sat Sep 25 18:30:19 2004 +0000
@@ -174,7 +174,7 @@
 			break;
 
 		// change screenshot format
-		case 30:
+		case 31:
 			SetScreenshotFormat(e->dropdown.index);
 			SetWindowDirty(w);
 			break;