projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8940188
)
fixed nasty bug that stopped animations when defining 'door_2' off-screen
author
Holger Schemel
<info@artsoft.org>
Thu, 12 Jan 2017 23:48:52 +0000
(
00:48
+0100)
committer
Holger Schemel
<info@artsoft.org>
Thu, 12 Jan 2017 23:48:52 +0000
(
00:48
+0100)
src/tools.c
patch
|
blob
|
history
diff --git
a/src/tools.c
b/src/tools.c
index b07e19d37ee75fd9b92f6835d43513a67fa55f74..55a28fc40d0cf13ef90ec1df29c3910bb15e5661 100644
(file)
--- 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);
}