projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c2bbcc
)
fixed element animation when collecting for BD engine
author
Holger Schemel
<info@artsoft.org>
Sat, 17 Feb 2024 13:09:39 +0000
(14:09 +0100)
committer
Holger Schemel
<info@artsoft.org>
Sun, 18 Feb 2024 15:17:00 +0000
(16:17 +0100)
src/game_bd/bd_graphics.c
patch
|
blob
|
history
diff --git
a/src/game_bd/bd_graphics.c
b/src/game_bd/bd_graphics.c
index 7472782eab2d1d754c8f645409c0d4259b28a645..89ada120cc6b5e7bc58b22517ef3d8111f203cf7 100644
(file)
--- a/
src/game_bd/bd_graphics.c
+++ b/
src/game_bd/bd_graphics.c
@@
-292,6
+292,12
@@
static boolean use_native_bd_graphics_engine(void)
}
#endif
}
#endif
+/* returns true if the element is collectible */
+static inline boolean is_collectible(const int element)
+{
+ return (gd_elements[element & O_MASK].properties & P_COLLECTIBLE) != 0;
+}
+
int gd_drawcave(Bitmap *dest, GdGame *game, boolean force_redraw)
{
GdCave *cave = game->cave;
int gd_drawcave(Bitmap *dest, GdGame *game, boolean force_redraw)
{
GdCave *cave = game->cave;
@@
-358,6
+364,11
@@
int gd_drawcave(Bitmap *dest, GdGame *game, boolean force_redraw)
{
/* redraw previous game element on the cave field the new element is moving to */
int tile_old = game->last_element_buffer[y][x];
{
/* redraw previous game element on the cave field the new element is moving to */
int tile_old = game->last_element_buffer[y][x];
+
+ /* only redraw previous game element if it is not collectible (like dirt etc.) */
+ if (is_collectible(tile_old))
+ tile_old = O_SPACE;
+
struct GraphicInfo_BD *g_old = &graphic_info_bd_object[tile_old][frame];
blit_bitmap(g_old->bitmap, dest, g_old->src_x, g_old->src_y, cell_size, cell_size,
struct GraphicInfo_BD *g_old = &graphic_info_bd_object[tile_old][frame];
blit_bitmap(g_old->bitmap, dest, g_old->src_x, g_old->src_y, cell_size, cell_size,