diff options
author | truelight <truelight@openttd.org> | 2004-09-25 18:30:19 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2004-09-25 18:30:19 +0000 |
commit | 12c91671bf6118c012df6f1bc9456df2e36f25f3 (patch) | |
tree | 974b99bd6bac2be3c8ee1ce8360e8d0b13726fe0 /screenshot.c | |
parent | 3dc8dcf3123c056f6ebd8fafa0640ef1866ea53e (diff) | |
download | openttd-12c91671bf6118c012df6f1bc9456df2e36f25f3.tar.xz |
(svn r321) -Fix: crash when making png screenshot with odd resolution (Tron)
-Fix: unable to select other screenshot format in Game Option
Diffstat (limited to 'screenshot.c')
-rw-r--r-- | screenshot.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/screenshot.c b/screenshot.c index c352844e5..fa94c8acd 100644 --- a/screenshot.c +++ b/screenshot.c @@ -376,8 +376,12 @@ void SetScreenshotFormat(int i) // 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); |