added frame parameter to graphics drawing function for MM engine
authorHolger Schemel <info@artsoft.org>
Fri, 25 Nov 2022 19:30:16 +0000 (20:30 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 25 Nov 2022 19:30:16 +0000 (20:30 +0100)
src/game_mm/mm_tools.c
src/game_mm/mm_tools.h

index 2c34884abb7dd4d2ece638e99062a4044ccd6188..d4bb5d37553ae80e1c72032f91e2cfc5146f281a 100644 (file)
@@ -92,7 +92,7 @@ void DrawGraphicExt_MM(DrawBuffer *d, int x, int y, int graphic)
   BlitBitmap(bitmap, d, src_x, src_y, TILEX, TILEY, x, y);
 }
 
   BlitBitmap(bitmap, d, src_x, src_y, TILEX, TILEY, x, y);
 }
 
-void DrawGraphicThruMask_MM(int x, int y, int graphic)
+void DrawGraphicThruMask_MM(int x, int y, int graphic, int frame)
 {
 #if DEBUG
   if (!IN_SCR_FIELD(x,y))
 {
 #if DEBUG
   if (!IN_SCR_FIELD(x,y))
@@ -106,13 +106,13 @@ void DrawGraphicThruMask_MM(int x, int y, int graphic)
 #endif
 
   DrawGraphicThruMaskExt_MM(drawto_field, cFX + x * TILEX, cFY + y * TILEY,
 #endif
 
   DrawGraphicThruMaskExt_MM(drawto_field, cFX + x * TILEX, cFY + y * TILEY,
-                           graphic);
+                           graphic, frame);
 
   MarkTileDirty(x,y);
 }
 
 void DrawGraphicThruMaskExt_MM(DrawBuffer *d, int dest_x, int dest_y,
 
   MarkTileDirty(x,y);
 }
 
 void DrawGraphicThruMaskExt_MM(DrawBuffer *d, int dest_x, int dest_y,
-                              int graphic)
+                              int graphic, int frame)
 {
   int src_x, src_y;
   Bitmap *src_bitmap;
 {
   int src_x, src_y;
   Bitmap *src_bitmap;
@@ -120,7 +120,7 @@ void DrawGraphicThruMaskExt_MM(DrawBuffer *d, int dest_x, int dest_y,
   if (graphic == IMG_EMPTY)
     return;
 
   if (graphic == IMG_EMPTY)
     return;
 
-  getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y);
+  getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
 
   BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dest_x, dest_y);
 }
 
   BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dest_x, dest_y);
 }
@@ -286,7 +286,7 @@ void DrawScreenElementExt_MM(int x, int y, int dx, int dy, int element,
   if (dx || dy)
     DrawGraphicShifted_MM(x, y, dx, dy, graphic, cut_mode, mask_mode);
   else if (mask_mode == USE_MASKING)
   if (dx || dy)
     DrawGraphicShifted_MM(x, y, dx, dy, graphic, cut_mode, mask_mode);
   else if (mask_mode == USE_MASKING)
-    DrawGraphicThruMask_MM(x, y, graphic);
+    DrawGraphicThruMask_MM(x, y, graphic, 0);
   else
     DrawGraphic_MM(x, y, graphic);
 }
   else
     DrawGraphic_MM(x, y, graphic);
 }
index 74cfe298d222e8b1e18d3c7614320fb439fc1ea1..d6679de56b0932058a9c3645d95501227cd5331c 100644 (file)
@@ -63,8 +63,8 @@ void DrawGraphicAnimation_MM(int, int, int, int);
 
 void DrawGraphic_MM(int, int, int);
 void DrawGraphicExt_MM(DrawBuffer *, int, int, int);
 
 void DrawGraphic_MM(int, int, int);
 void DrawGraphicExt_MM(DrawBuffer *, int, int, int);
-void DrawGraphicThruMask_MM(int, int, int);
-void DrawGraphicThruMaskExt_MM(DrawBuffer *, int, int, int);
+void DrawGraphicThruMask_MM(int, int, int, int);
+void DrawGraphicThruMaskExt_MM(DrawBuffer *, int, int, int, int);
 void DrawMiniGraphic_MM(int, int, int);
 void getMiniGraphicSource(int, Bitmap **, int *, int *);
 void DrawMiniGraphicExt_MM(DrawBuffer *, int, int, int);
 void DrawMiniGraphic_MM(int, int, int);
 void getMiniGraphicSource(int, Bitmap **, int *, int *);
 void DrawMiniGraphicExt_MM(DrawBuffer *, int, int, int);