gfx.anim_random_frame = last_anim_random_frame;
- getFixedGraphicSource(part->graphic, frame, &src_bitmap,
- &src_x, &src_y);
+ getGlobalAnimGraphicSource(part->graphic, frame, &src_bitmap,
+ &src_x, &src_y);
src_x += cut_x;
src_y += cut_y;
void CreateBitmapTextures(Bitmap **bitmaps)
{
- SDLCreateBitmapTextures(bitmaps[IMG_BITMAP_STANDARD]);
+ if (bitmaps[IMG_BITMAP_PTR_ORIGINAL] != NULL)
+ SDLCreateBitmapTextures(bitmaps[IMG_BITMAP_PTR_ORIGINAL]);
+ else
+ SDLCreateBitmapTextures(bitmaps[IMG_BITMAP_STANDARD]);
}
void FreeBitmapTextures(Bitmap **bitmaps)
{
- SDLFreeBitmapTextures(bitmaps[IMG_BITMAP_STANDARD]);
+ if (bitmaps[IMG_BITMAP_PTR_ORIGINAL] != NULL)
+ SDLFreeBitmapTextures(bitmaps[IMG_BITMAP_PTR_ORIGINAL]);
+ else
+ SDLFreeBitmapTextures(bitmaps[IMG_BITMAP_STANDARD]);
}
void ScaleBitmap(Bitmap **bitmaps, int zoom_factor)
getSizedGraphicSource(graphic, 0, MINI_TILESIZE, bitmap, x, y);
}
+void getGlobalAnimGraphicSource(int graphic, int frame,
+ Bitmap **bitmap, int *x, int *y)
+{
+ struct GraphicInfo *g = &graphic_info[graphic];
+
+ // if no graphics defined at all, use fallback graphics
+ if (g->bitmaps == NULL)
+ *g = graphic_info[IMG_CHAR_EXCLAM];
+
+ // use original size graphics, if existing, else use standard size graphics
+ if (g->bitmaps[IMG_BITMAP_PTR_ORIGINAL])
+ *bitmap = g->bitmaps[IMG_BITMAP_PTR_ORIGINAL];
+ else
+ *bitmap = g->bitmaps[IMG_BITMAP_STANDARD];
+
+ getGraphicSourceXY(graphic, frame, x, y, FALSE);
+}
+
static void getGraphicSourceExt(int graphic, int frame, Bitmap **bitmap,
int *x, int *y, boolean get_backside)
{
void getSizedGraphicSource(int, int, int, Bitmap **, int *, int *);
void getFixedGraphicSource(int, int, Bitmap **, int *, int *);
void getMiniGraphicSource(int, Bitmap **, int *, int *);
+void getGlobalAnimGraphicSource(int, int, Bitmap **, int *, int *);
void getGraphicSource(int, int, Bitmap **, int *, int *);
void DrawGraphic(int, int, int, int);