rnd-20020329-2-src
[rocksndiamonds.git] / src / libgame / system.c
index 423570ddf4536407ecee19db0cf22e5045236797..f5125c611a14e5f21b600873ddef0cec3024bd0e 100644 (file)
@@ -299,6 +299,9 @@ inline void FreeBitmap(Bitmap *bitmap)
     XFreeGC(display, bitmap->stored_clip_gc);
 #endif
 
+  if (bitmap->source_filename)
+    free(bitmap->source_filename);
+
   free(bitmap);
 }
 
@@ -606,6 +609,19 @@ Bitmap *LoadImage(char *filename)
   return new_bitmap;
 }
 
+Bitmap *LoadCustomImage(char *basename)
+{
+  char *filename = getStringCopy(getCustomImageFilename(basename));
+  Bitmap *new_bitmap;
+
+  if ((new_bitmap = LoadImage(filename)) == NULL)
+    Error(ERR_EXIT, "LoadImage() failed: %s", GetError());
+
+  new_bitmap->source_filename = filename;
+
+  return new_bitmap;
+}
+
 
 /* ========================================================================= */
 /* audio functions                                                           */