From e7df31ecfcac92eb8d51b450181fc673918759d0 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 14 May 2023 17:42:20 +0200 Subject: [PATCH] fixed drawing mouse pointer global animation above MM engine tile cursor --- src/anim.c | 2 +- src/libgame/sdl.c | 4 ++++ src/libgame/system.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/anim.c b/src/anim.c index 2f0278ef..eff54726 100644 --- a/src/anim.c +++ b/src/anim.c @@ -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) diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 2d2551a2..71d9fbbe 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -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) diff --git a/src/libgame/system.h b/src/libgame/system.h index 02e58143..acc20894 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -288,6 +288,7 @@ // 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 -- 2.34.1