rnd-20020904-1-src
[rocksndiamonds.git] / src / libgame / misc.c
index 6db94000c6a955dc0c053639f310fef91b8e0c70..f222f31ea3bc4fdb0672245e12bdb50dee6556a7 100644 (file)
@@ -1500,7 +1500,7 @@ void LoadArtworkToList(struct ArtworkListInfo *artwork_info,
 #endif
 }
 
-void ReloadCustomArtworkFiles(struct ArtworkListInfo *artwork_info)
+void ReloadCustomArtworkList(struct ArtworkListInfo *artwork_info)
 {
   static struct
   {
@@ -1519,14 +1519,6 @@ void ReloadCustomArtworkFiles(struct ArtworkListInfo *artwork_info)
   struct ArtworkConfigInfo *config_list = artwork_info->config_list;
   int i;
 
-#if 0
-  Delay(5000);
-#endif
-
-#if 0
-  printf("DEBUG: reloading sounds '%s' ...\n",artwork.snd_current_identifier);
-#endif
-
   LoadArtworkConfig(artwork_info);
 
   if (draw_init[artwork_info->type].do_it)
@@ -1558,6 +1550,32 @@ void ReloadCustomArtworkFiles(struct ArtworkListInfo *artwork_info)
 #endif
 }
 
+void FreeCustomArtworkList(struct ArtworkListInfo *artwork_info)
+{
+  int i;
+
+  if (artwork_info->artwork_list == NULL)
+    return;
+
+#if 0
+  printf("%s: FREEING ARTWORK ...\n",
+        IS_CHILD_PROCESS(audio.mixer_pid) ? "CHILD" : "PARENT");
+#endif
+
+  for(i=0; i<artwork_info->num_list_entries; i++)
+    deleteArtworkListEntry(artwork_info, &artwork_info->artwork_list[i]);
+
+#if 0
+  printf("%s: FREEING ARTWORK -- DONE\n",
+        IS_CHILD_PROCESS(audio.mixer_pid) ? "CHILD" : "PARENT");
+#endif
+
+  free(artwork_info->artwork_list);
+
+  artwork_info->artwork_list = NULL;
+  artwork_info->num_list_entries = 0;
+}
+
 
 /* ========================================================================= */
 /* functions only needed for non-Unix (non-command-line) systems             */