added setup option to show invisible exit in BD engine
[rocksndiamonds.git] / src / game_bd / bd_gameplay.c
index 9f1d96e6d30ae4f7f57077cbdda07179dc5fbb51..7a4d889c051d49dcc237bef31f3181496f00f2d8 100644 (file)
 #include "main_bd.h"
 
 
-// universal settings
-static boolean gd_no_invisible_outbox = FALSE;
-
-
 void gd_game_free(GdGame *game)
 {
   // stop sounds
@@ -116,6 +112,10 @@ static void load_cave(GdGame *game)
 
   game->cave = gd_get_prepared_cave(game->original_cave, game->level_num);
 
+  // if requested, recolor cave (cave is a copy only, so no worries)
+  if (setup.bd_random_colors)
+    gd_cave_set_random_colors(game->cave, setup.bd_default_color_type);
+
   if (game->cave->intermission && game->cave->intermission_instantlife)
     add_bonus_life(game, FALSE);
 
@@ -383,7 +383,7 @@ static GdGameState gd_game_main_int(GdGame *game, boolean allow_iterate, boolean
       {
        for (x = 0; x < game->cave->w; x++)
        {
-         game->last_element_buffer[y][x] = game->element_buffer[y][x];
+         game->last_element_buffer[y][x] = game->element_buffer[y][x] & ~SKIPPED;
          game->dir_buffer[y][x] = GD_MV_STILL;
        }
       }
@@ -567,8 +567,8 @@ static GdGameState gd_game_main_int(GdGame *game, boolean allow_iterate, boolean
   // always render the cave to the gfx buffer;
   // however it may do nothing if animcycle was not changed.
   if (game->element_buffer && game->gfx_buffer)
-    gd_drawcave_game(game->cave, game->element_buffer, game->gfx_buffer,
-                    game->bonus_life_flash != 0, game->animcycle, gd_no_invisible_outbox);
+    gd_drawcave_game(game->cave, game->element_buffer, game->last_element_buffer, game->gfx_buffer,
+                    game->bonus_life_flash != 0, game->animcycle, setup.bd_show_invisible_outbox);
 
   game->state_counter = counter_next;