projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed another graphical bug when using smooth movements with BD engine
[rocksndiamonds.git]
/
src
/
game_bd
/
bd_graphics.c
diff --git
a/src/game_bd/bd_graphics.c
b/src/game_bd/bd_graphics.c
index b171b763b7ad261799cc12e4ac756befbde51924..b122219a6284575695f305040db1560830ccf96d 100644
(file)
--- a/
src/game_bd/bd_graphics.c
+++ b/
src/game_bd/bd_graphics.c
@@
-61,6
+61,8
@@
static int cell_size = 0;
// graphic info for game objects/frames and players/actions/frames
struct GraphicInfo_BD graphic_info_bd_object[O_MAX_ALL][8];
// graphic info for game objects/frames and players/actions/frames
struct GraphicInfo_BD graphic_info_bd_object[O_MAX_ALL][8];
+// graphic info for game graphics template for level-specific colors
+struct GraphicInfo_BD graphic_info_bd_color_template;
static inline int c64_png_colors(int r, int g, int b, int a)
{
static inline int c64_png_colors(int r, int g, int b, int a)
{
@@
-611,8
+613,8
@@
static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d
// redraw previous game element on the cave field the new element is moving to
int tile_last = game->last_element_buffer[y][x];
// redraw previous game element on the cave field the new element is moving to
int tile_last = game->last_element_buffer[y][x];
- // only redraw previous game element if it is
not collecti
ble (like dirt etc.)
- if (
is_collecti
ble(tile_last))
+ // only redraw previous game element if it is
digga
ble (like dirt etc.)
+ if (
!is_digga
ble(tile_last))
tile_last = O_SPACE;
struct GraphicInfo_BD *g_old = &graphic_info_bd_object[tile_last][frame];
tile_last = O_SPACE;
struct GraphicInfo_BD *g_old = &graphic_info_bd_object[tile_last][frame];
@@
-648,7
+650,9
@@
static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d
else
{
// if old tile also moving (like pushing player), do not redraw tile background
else
{
// if old tile also moving (like pushing player), do not redraw tile background
- game->last_element_buffer[old_y][old_x] |= SKIPPED;
+ // (but redraw if tile and old tile are moving/falling into different directions)
+ if (game->dir_buffer[old_y][old_x] == game->dir_buffer[y][x])
+ game->last_element_buffer[old_y][old_x] |= SKIPPED;
}
}
}
}