From 9eb4ba2e639c16c6a5e72ddaeabfb455a85c66bf Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 13 Jan 2017 00:48:52 +0100 Subject: [PATCH] fixed nasty bug that stopped animations when defining 'door_2' off-screen --- src/tools.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); } -- 2.34.1