From abe3ad50047635122f478f7e18708ff7292edf52 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 26 Mar 2023 16:20:21 +0200 Subject: [PATCH] added variable to cleanup code --- src/screens.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/screens.c b/src/screens.c index c4955e8c..1365e737 100644 --- a/src/screens.c +++ b/src/screens.c @@ -3146,7 +3146,9 @@ void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init) continue; } - j += infoscreen_step[i - start]; + int ypos = i - start; + + j += infoscreen_step[ypos]; element = helpanim_info[j].element; action = helpanim_info[j].action; @@ -3169,39 +3171,39 @@ void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init) if (delay == -1) delay = 1000000; - if (infoscreen_frame[i - start] == 0) + if (infoscreen_frame[ypos] == 0) { sync_frame = 0; - infoscreen_frame[i - start] = delay - 1; + infoscreen_frame[ypos] = delay - 1; } else { - sync_frame = delay - infoscreen_frame[i - start]; - infoscreen_frame[i - start]--; + sync_frame = delay - infoscreen_frame[ypos]; + infoscreen_frame[ypos]--; } if (helpanim_info[j].element == HELPANIM_LIST_NEXT) { - if (!infoscreen_frame[i - start]) - infoscreen_step[i - start] = 0; + if (!infoscreen_frame[ypos]) + infoscreen_step[ypos] = 0; } else { - if (!infoscreen_frame[i - start]) - infoscreen_step[i - start]++; + if (!infoscreen_frame[ypos]) + infoscreen_step[ypos]++; while (helpanim_info[j].element != HELPANIM_LIST_NEXT) j++; } j++; - ClearRectangleOnBackground(drawto, xstart, ystart + (i - start) * ystep, + ClearRectangleOnBackground(drawto, xstart, ystart + ypos * ystep, TILEX, TILEY); - DrawFixedGraphicAnimationExt(drawto, xstart, ystart + (i - start) * ystep, + DrawFixedGraphicAnimationExt(drawto, xstart, ystart + ypos * ystep, graphic, sync_frame, USE_MASKING); if (init) - DrawInfoScreen_HelpText(element, action, direction, i - start); + DrawInfoScreen_HelpText(element, action, direction, ypos); i++; } -- 2.34.1