From: Holger Schemel Date: Thu, 12 Jan 2017 23:48:52 +0000 (+0100) Subject: fixed nasty bug that stopped animations when defining 'door_2' off-screen X-Git-Tag: 4.0.0.2~38 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9eb4ba2e639c16c6a5e72ddaeabfb455a85c66bf;p=rocksndiamonds.git fixed nasty bug that stopped animations when defining 'door_2' off-screen --- diff --git a/src/tools.c b/src/tools.c index b07e19d3..55a28fc4 100644 --- a/src/tools.c +++ b/src/tools.c @@ -759,6 +759,13 @@ void BackToFront() y2 = MAX(y2, EY + EYSIZE); } + // make sure that at least one pixel is blitted, and inside the screen + // (else nothing is blitted, causing the animations not to be updated) + x1 = MIN(MAX(0, x1), WIN_XSIZE - 1); + y1 = MIN(MAX(0, y1), WIN_YSIZE - 1); + x2 = MIN(MAX(1, x2), WIN_XSIZE); + y2 = MIN(MAX(1, y2), WIN_YSIZE); + BlitBitmap(backbuffer, window, x1, y1, x2 - x1, y2 - y1, x1, y1); }