rnd-20030730-1-src
[rocksndiamonds.git] / src / libgame / image.c
index c841ffed244c9fc66fecc62feda0c463a59120df..925147aba8908c58d4f07180eb3f4199d9e8f010 100644 (file)
@@ -699,7 +699,7 @@ int Read_PCX_to_Pixmap(Display *display, Window window, GC gc, char *filename,
 
 
 /* ========================================================================= */
-/* PLATFORM INDEPENDANT IMAGE FUNCTIONS                                      */
+/* PLATFORM INDEPENDENT IMAGE FUNCTIONS                                      */
 /* ========================================================================= */
 
 struct ImageInfo
@@ -800,9 +800,16 @@ Bitmap *getBitmapFromImageID(int pos)
 
 char *getTokenFromImageID(int graphic)
 {
+#if 0
+  /* !!! this does not work for dynamic artwork (crash!) !!! */
   struct FileInfo *file_list = (struct FileInfo *)image_info->file_list;
 
   return file_list[graphic].token;
+#else
+  struct FileInfo *file_list = getImageListEntry(graphic);
+
+  return (file_list != NULL ? file_list->token : NULL);
+#endif
 }
 
 char *getImageConfigFilename()