From: Holger Schemel Date: Thu, 17 Feb 2022 16:27:39 +0000 (+0100) Subject: moved code to get font for "choose tree" screen to separate function X-Git-Tag: 4.3.2.0~123 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=00c3d9afa5a7bbf5e53811b49f6dbc0b7cafa5d2;p=rocksndiamonds.git moved code to get font for "choose tree" screen to separate function --- diff --git a/src/screens.c b/src/screens.c index 6f18bf31..49f390f9 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4862,6 +4862,14 @@ static void DrawChooseTree(TreeInfo **ti_ptr) FadeIn(fade_mask); } +static int getChooseTreeFont(TreeInfo *node, boolean active) +{ + int font_color = MENU_CHOOSE_TREE_COLOR(node, active); + int font_nr = MENU_CHOOSE_TREE_FONT(font_color); + + return font_nr; +} + static void drawChooseTreeText(int y, boolean active, TreeInfo *ti) { int num_entries = numTreeInfoInGroup(ti); @@ -4872,8 +4880,7 @@ static void drawChooseTreeText(int y, boolean active, TreeInfo *ti) int entry_pos = first_entry + y; TreeInfo *node_first = getTreeInfoFirstGroupEntry(ti); TreeInfo *node = getTreeInfoFromPos(node_first, entry_pos); - int font_color = MENU_CHOOSE_TREE_COLOR(node, active); - int font_nr = MENU_CHOOSE_TREE_FONT(font_color); + int font_nr = getChooseTreeFont(node, active); int font_xoffset = getFontBitmapInfo(font_nr)->draw_xoffset; int xpos = MENU_SCREEN_START_XPOS; int ypos = MENU_SCREEN_START_YPOS + y;