added support for scanned BD elements in editor (but not in game yet)
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 27 Aug 2024 21:29:33 +0000 (23:29 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Wed, 28 Aug 2024 11:27:12 +0000 (13:27 +0200)
This change still converts all scanned BD elements to their unscanned
counterparts when playing a game using the BD engine, but now supports
handling of scanned elements in the level editior.

src/game_bd/bd_caveset.c
src/game_bd/bd_gameplay.c

index 3939160058914054421b97f1fb73cfad227d75a2..55053040c1b151e485d7f72fc76f6bd5698ad1cb 100644 (file)
@@ -251,9 +251,6 @@ GdCave *gd_get_prepared_cave(const GdCave *original_cave, const int level)
   // initialize some cave variables (like player position)
   gd_cave_setup_for_game(prepared_cave);
 
-  // temporary workaround: set all elements in a cave to their non-scanned counterparts
-  unscan_cave(prepared_cave);
-
   return prepared_cave;
 }
 
index 629e03620da17c6fcd295f93cdff9aecef01a3a2..1fb424d947fe6ae8f37c8b387a9a263382dcb662 100644 (file)
@@ -140,6 +140,9 @@ static void load_cave(GdGame *game)
 
   game->cave = gd_get_prepared_cave(game->original_cave, game->level_num);
 
+  // temporary workaround: set all elements in a cave to their non-scanned counterparts
+  unscan_cave(game->cave);
+
   // 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);