X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftools.c;h=55a28fc40d0cf13ef90ec1df29c3910bb15e5661;hp=b07e19d37ee75fd9b92f6835d43513a67fa55f74;hb=9eb4ba2e639c16c6a5e72ddaeabfb455a85c66bf;hpb=89401883eeb279c7101b1c635477a9bccc123d21 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); }