rnd-20021129-2-src
[rocksndiamonds.git] / src / libgame / image.c
index 3ec55f390ff6b313d64ac5f8f269904ac269745d..8e69de5460a4b518d0c4fb40320abacc0bbd5078 100644 (file)
@@ -37,8 +37,8 @@ Image *newImage(unsigned int width, unsigned int height, unsigned int depth)
   depth = 8;
 #endif
 
-  image = checked_malloc(sizeof(Image));
-  image->data = checked_malloc(width * height * bytes_per_pixel);
+  image = checked_calloc(sizeof(Image));
+  image->data = checked_calloc(width * height * bytes_per_pixel);
   image->width = width;
   image->height = height;
   image->depth = depth;
@@ -700,6 +700,13 @@ struct FileInfo *getCurrentImageList()
   return image_info->file_list;
 }
 
+Bitmap *getBitmapFromImageID(int graphic)
+{
+  ImageInfo **img_info = (ImageInfo **)image_info->artwork_list;
+
+  return img_info[graphic]->bitmap;
+}
+
 void InitImageList(struct ConfigInfo *config_list,
                   struct ConfigInfo *config_suffix_list,
                   int num_file_list_entries)