added function parameters for hash table creation to free keys or values
[rocksndiamonds.git] / src / tools.c
index cdb7b4cb70bc20bf5a75af60be8df3387c9f7890..1d3607e446eb94000aace0fbc45a0439f6906f5c 100644 (file)
@@ -500,7 +500,9 @@ void RedrawPlayfield(void)
   if (game_status != GAME_MODE_PLAYING)
     return;
 
-  if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
+  if (level.game_engine_type == GAME_ENGINE_TYPE_BD)
+    RedrawPlayfield_BD(TRUE);
+  else if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
     RedrawPlayfield_EM(TRUE);
   else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
     RedrawPlayfield_SP(TRUE);
@@ -668,7 +670,9 @@ void BlitScreenToBitmap_RND(Bitmap *target_bitmap)
 
 void BlitScreenToBitmap(Bitmap *target_bitmap)
 {
-  if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
+  if (level.game_engine_type == GAME_ENGINE_TYPE_BD)
+    BlitScreenToBitmap_BD(target_bitmap);
+  else if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
     BlitScreenToBitmap_EM(target_bitmap);
   else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
     BlitScreenToBitmap_SP(target_bitmap);
@@ -1026,6 +1030,10 @@ void FadeOut(int fade_mask)
       fade_type_skip != FADE_MODE_SKIP_FADE_OUT)
     BackToFront();
 
+  // when using BD game engine, cover playfield before fading out after a game
+  if (game_bd.cover_screen)
+    CoverScreen_BD();
+
   SetScreenStates_BeforeFadingOut();
 
   SetTileCursorActive(FALSE);
@@ -9678,7 +9686,9 @@ boolean isActivePlayer_EM(int player_nr)
 
 unsigned int InitRND(int seed)
 {
-  if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
+  if (level.game_engine_type == GAME_ENGINE_TYPE_BD)
+    return InitEngineRandom_BD(seed);
+  else if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
     return InitEngineRandom_EM(seed);
   else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
     return InitEngineRandom_SP(seed);
@@ -11307,9 +11317,9 @@ static unsigned int test_uuid_random_function_better(int max)
 static void TestGeneratingUUIDs_RunTest(int nr, int always_seed, int num_uuids)
 {
   struct hashtable *hash_seeds =
-    create_hashtable(16, 0.75, get_hash_from_key, hash_keys_are_equal);
+    create_hashtable(get_hash_from_string, hash_key_strings_are_equal, free, NULL);
   struct hashtable *hash_uuids =
-    create_hashtable(16, 0.75, get_hash_from_key, hash_keys_are_equal);
+    create_hashtable(get_hash_from_string, hash_key_strings_are_equal, free, NULL);
   static char message[100];
   int i;
 
@@ -11388,8 +11398,8 @@ static void TestGeneratingUUIDs_RunTest(int nr, int always_seed, int num_uuids)
 
   Request(message, REQ_CONFIRM);
 
-  hashtable_destroy(hash_seeds, 0);
-  hashtable_destroy(hash_uuids, 0);
+  hashtable_destroy(hash_seeds);
+  hashtable_destroy(hash_uuids);
 }
 
 void TestGeneratingUUIDs(void)