X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_bd%2Fmain_bd.c;h=fcd2a23dd4287ecb768c202c33afceea142c77c8;hb=b69c3444331f8d83177e21162fa5313c101e1afc;hp=da296229a6652392b2ecd6f56ea05f05b49e304a;hpb=10547cdd1dfb8b60766e04f26adc58fb3a31197b;p=rocksndiamonds.git diff --git a/src/game_bd/main_bd.c b/src/game_bd/main_bd.c index da296229..fcd2a23d 100644 --- a/src/game_bd/main_bd.c +++ b/src/game_bd/main_bd.c @@ -248,6 +248,30 @@ static void UpdateGameDoorValues_BD(void) } } +static void PrepareGameTileBitmap_BD(void) +{ + struct GraphicInfo_BD *g_template = &graphic_info_bd_color_template; + struct GraphicInfo_BD *g_default = &graphic_info_bd_object[O_STONE][0]; + + gd_prepare_tile_bitmap(native_bd_level.cave, g_template->bitmap, 1); + gd_set_tile_bitmap_reference(g_default->bitmap); +} + +void PreparePreviewTileBitmap_BD(Bitmap *bitmap, int scale_down_factor) +{ + gd_prepare_tile_bitmap(native_bd_level.cave, bitmap, scale_down_factor); +} + +void SetPreviewTileBitmapReference_BD(Bitmap *bitmap) +{ + gd_set_tile_bitmap_reference(bitmap); +} + +Bitmap *GetPreviewTileBitmap_BD(Bitmap *bitmap) +{ + return gd_get_tile_bitmap(bitmap); +} + unsigned int InitEngineRandom_BD(int seed) { if (seed == NEW_RANDOMIZE) @@ -283,6 +307,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;