X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_bd%2Fmain_bd.c;h=e7844fcb6e2a4922c6d21552438f31ec564cf08f;hb=baaeb610c5e1390ebfd7616f8ea17c00221d8503;hp=3cda1ac5cea5655f2ddcc84a4b95a2f83bbf04ec;hpb=157fb76461d332a22233e6664cd294d7db5d3558;p=rocksndiamonds.git diff --git a/src/game_bd/main_bd.c b/src/game_bd/main_bd.c index 3cda1ac5..e7844fcb 100644 --- a/src/game_bd/main_bd.c +++ b/src/game_bd/main_bd.c @@ -156,6 +156,11 @@ boolean LoadNativeLevel_BD(char *filename, int level_pos, boolean level_info_onl boolean SaveNativeLevel_BD(char *filename) { + GdCave *cave = gd_cave_new_from_cave(native_bd_level.cave); + + gd_caveset_clear(); + gd_caveset = list_append(gd_caveset, cave); + return gd_caveset_save_to_file(filename); } @@ -243,6 +248,13 @@ static void UpdateGameDoorValues_BD(void) } } +static void PrepareGameTileBitmap_BD(void) +{ + struct GraphicInfo_BD *g = &graphic_info_bd_object[O_STONE][0]; + + gd_prepare_tile_bitmap(native_bd_level.cave, g->bitmap, 1); +} + unsigned int InitEngineRandom_BD(int seed) { if (seed == NEW_RANDOMIZE) @@ -278,6 +290,9 @@ void InitGameEngine_BD(void) game_bd.game->itermax = 8; // default; dynamically changed at runtime game_bd.game->itermax_last = game_bd.game->itermax; + // prepare tile bitmap with level-specific colors, if available + PrepareGameTileBitmap_BD(); + // default: start with completely covered playfield int next_state = GAME_INT_START_UNCOVER + 1;