fixed drawing mouse pointer global animation above MM engine tile cursor
authorHolger Schemel <info@artsoft.org>
Sun, 14 May 2023 15:42:20 +0000 (17:42 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 14 May 2023 15:42:20 +0000 (17:42 +0200)
src/anim.c
src/libgame/sdl.c
src/libgame/system.h

index 2f0278ef19360c83630208261d9cc28a3b107c30..eff54726df41f52f94f54ea3b203408fe5cb38fc 100644 (file)
@@ -961,7 +961,7 @@ static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part
     viewport_width  = part->graphic_info.width;
     viewport_height = part->graphic_info.height;
 
-    part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_2;
+    part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_3;
 
     // do not use global animation mouse pointer when reloading artwork
     if (global.anim_status != GAME_MODE_LOADING)
index 2d2551a22444c5e1ae83b237a034b01d84c30027..71d9fbbe7274d71555b4c7ef90552b78a8e78124 100644 (file)
@@ -65,6 +65,10 @@ static void FinalizeScreen(int draw_target)
   // copy tile selection cursor to render target buffer, if defined (above all)
   if (gfx.draw_tile_cursor_function != NULL)
     gfx.draw_tile_cursor_function(draw_target);
+
+  // copy global animations to render target buffer, if defined (mouse pointer)
+  if (gfx.draw_global_anim_function != NULL)
+    gfx.draw_global_anim_function(draw_target, DRAW_GLOBAL_ANIM_STAGE_3);
 }
 
 static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay)
index 02e58143fbb6668351aa67cc480da745574f1a45..acc20894f52e3610538d1f6c88b50ca70d9133d7 100644 (file)
 // values for drawing stages for global animations
 #define DRAW_GLOBAL_ANIM_STAGE_1       1
 #define DRAW_GLOBAL_ANIM_STAGE_2       2
+#define DRAW_GLOBAL_ANIM_STAGE_3       3
 
 // values for drawing target (various functions)
 #define DRAW_TO_BACKBUFFER             0