mirror of https://github.com/OpenTTD/OpenTTD
(svn r321) -Fix: crash when making png screenshot with odd resolution (Tron)
-Fix: unable to select other screenshot format in Game Optionrelease/0.4.5
parent
3dc8dcf312
commit
12c91671bf
|
@ -376,8 +376,12 @@ void SetScreenshotFormat(int i)
|
||||||
// screenshot generator that dumps the current video buffer
|
// screenshot generator that dumps the current video buffer
|
||||||
void CurrentScreenCallback(void *userdata, byte *buf, uint y, uint pitch, uint n)
|
void CurrentScreenCallback(void *userdata, byte *buf, uint y, uint pitch, uint n)
|
||||||
{
|
{
|
||||||
assert(_screen.pitch == (int)pitch);
|
for (; n > 0; --n)
|
||||||
memcpy(buf, _screen.dst_ptr + y * _screen.pitch, n * _screen.pitch);
|
{
|
||||||
|
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);
|
extern void ViewportDoDraw(ViewPort *vp, int left, int top, int right, int bottom);
|
||||||
|
|
|
@ -174,7 +174,7 @@ static void GameOptionsWndProc(Window *w, WindowEvent *e)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// change screenshot format
|
// change screenshot format
|
||||||
case 30:
|
case 31:
|
||||||
SetScreenshotFormat(e->dropdown.index);
|
SetScreenshotFormat(e->dropdown.index);
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue