From: Holger Schemel Date: Mon, 21 Feb 2022 22:57:01 +0000 (+0100) Subject: added functions to redraw and unmap screen gadgets X-Git-Tag: 4.3.2.0~114 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9e57366e6032f1c142eb712ece9b46067c159299;p=rocksndiamonds.git added functions to redraw and unmap screen gadgets --- diff --git a/src/screens.c b/src/screens.c index 379ec020..62eb2979 100644 --- a/src/screens.c +++ b/src/screens.c @@ -277,10 +277,13 @@ static void HandleInfoScreen_Version(int); static void ModifyGameSpeedIfNeeded(void); static void DisableVsyncIfNeeded(void); +static void RedrawScreenMenuGadgets(int); static void MapScreenMenuGadgets(int); static void UnmapScreenMenuGadgets(int); static void MapScreenGadgets(int); +static void UnmapScreenGadgets(void); static void MapScreenTreeGadgets(TreeInfo *); +static void UnmapScreenTreeGadgets(void); static void UpdateScreenMenuGadgets(int, boolean); @@ -10061,6 +10064,15 @@ void FreeScreenGadgets(void) FreeGadget(screen_gadget[i]); } +static void RedrawScreenMenuGadgets(int screen_mask) +{ + int i; + + for (i = 0; i < NUM_SCREEN_MENUBUTTONS; i++) + if (screen_mask & menubutton_info[i].screen_mask) + RedrawGadget(screen_gadget[menubutton_info[i].gadget_id]); +} + static void MapScreenMenuGadgets(int screen_mask) { int i; @@ -10111,11 +10123,27 @@ static void MapScreenGadgets(int num_entries) MapGadget(screen_gadget[scrollbar_info[i].gadget_id]); } +static void UnmapScreenGadgets() +{ + int i; + + for (i = 0; i < NUM_SCREEN_SCROLLBUTTONS; i++) + UnmapGadget(screen_gadget[scrollbutton_info[i].gadget_id]); + + for (i = 0; i < NUM_SCREEN_SCROLLBARS; i++) + UnmapGadget(screen_gadget[scrollbar_info[i].gadget_id]); +} + static void MapScreenTreeGadgets(TreeInfo *ti) { MapScreenGadgets(numTreeInfoInGroup(ti)); } +static void UnmapScreenTreeGadgets(void) +{ + UnmapScreenGadgets(); +} + static void HandleScreenGadgets(struct GadgetInfo *gi) { int id = gi->custom_id;