From 6e82bad55aa0275be6b0aaa8faff735760408b6c Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 18 Feb 2023 12:59:15 +0100 Subject: [PATCH] added function to force restarting global animations --- src/anim.c | 11 +++++++++++ src/anim.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/anim.c b/src/anim.c index 3393d939..3f0a727c 100644 --- a/src/anim.c +++ b/src/anim.c @@ -1997,6 +1997,17 @@ static void ResetGlobalAnim_Clicked(void) InitGlobalAnim_Clicked(-1, -1, ANIM_CLICKED_RESET); } +void RestartGlobalAnims(void) +{ + int anim_status_last = global.anim_status; + + global.anim_status = GAME_MODE_LOADING; + + SDLRedrawWindow(); + + global.anim_status = anim_status_last; +} + boolean HandleGlobalAnimClicks(int mx, int my, int button, boolean force_click) { static boolean click_consumed = FALSE; diff --git a/src/anim.h b/src/anim.h index 3d0153c9..a1be4b06 100644 --- a/src/anim.h +++ b/src/anim.h @@ -18,6 +18,8 @@ int getAnimationFrame(int, int, int, int, int); void InitGlobalAnimations(void); void DrawGlobalAnimations(int, int); +void RestartGlobalAnims(void); + boolean HandleGlobalAnimClicks(int, int, int, boolean); int getGlobalAnimSyncFrame(void); -- 2.34.1