rnd-20030118-6-src
[rocksndiamonds.git] / src / libgame / image.c
index 8e69de5460a4b518d0c4fb40320abacc0bbd5078..c4d3080805ec3f685b1494a0010b35e990869fbb 100644 (file)
@@ -14,6 +14,7 @@
 #include "image.h"
 #include "pcx.h"
 #include "misc.h"
+#include "setup.h"
 
 
 /* ========================================================================= */
@@ -704,7 +705,19 @@ Bitmap *getBitmapFromImageID(int graphic)
 {
   ImageInfo **img_info = (ImageInfo **)image_info->artwork_list;
 
-  return img_info[graphic]->bitmap;
+  return (img_info[graphic] != NULL ? img_info[graphic]->bitmap : NULL);
+}
+
+char *getTokenFromImageID(int graphic)
+{
+  struct FileInfo *file_list = (struct FileInfo *)image_info->file_list;
+
+  return file_list[graphic].token;
+}
+
+char *getImageConfigFilename()
+{
+  return getCustomArtworkConfigFilename(image_info->type);
 }
 
 void InitImageList(struct ConfigInfo *config_list,
@@ -726,6 +739,7 @@ void InitImageList(struct ConfigInfo *config_list,
     getFileListFromConfigList(config_list, config_suffix_list,
                              num_file_list_entries);
   image_info->suffix_list = config_suffix_list;
+  image_info->custom_setup_list = NULL;
 
   image_info->artwork_list =
     checked_calloc(num_file_list_entries * sizeof(ImageInfo *));
@@ -742,6 +756,7 @@ void ReloadCustomImages()
   printf("DEBUG: reloading images '%s' ...\n", artwork.gfx_current_identifier);
 #endif
 
+  LoadArtworkConfig(image_info);
   ReloadCustomArtworkList(image_info);
 }