From: Holger Schemel Date: Fri, 16 Dec 2022 17:55:12 +0000 (+0100) Subject: added limiting default number of game elements on info screen X-Git-Tag: 4.3.4.0~7 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=36514297b2eb8aaf1a8bb4ca2855bd690de811f8;p=rocksndiamonds.git added limiting default number of game elements on info screen --- diff --git a/src/screens.c b/src/screens.c index 7c65db19..5fe48e3d 100644 --- a/src/screens.c +++ b/src/screens.c @@ -182,16 +182,21 @@ #define MENU_SCREEN_INFO_YSIZE (MENU_SCREEN_INFO_YBOTTOM - \ MENU_SCREEN_INFO_YSTART - \ TILEY / 2) -#define MAX_INFO_ELEMENTS_ON_SCREEN 128 -#define STD_INFO_ELEMENTS_ON_SCREEN (MENU_SCREEN_INFO_YSIZE / \ +#define MAX_INFO_ELEMENTS_IN_ARRAY 128 +#define MAX_INFO_ELEMENTS_ON_SCREEN (SYSIZE / TILEY) +#define MAX_INFO_ELEMENTS MIN(MAX_INFO_ELEMENTS_IN_ARRAY, \ + MAX_INFO_ELEMENTS_ON_SCREEN) +#define STD_INFO_ELEMENTS_ON_SCREEN 10 +#define DYN_INFO_ELEMENTS_ON_SCREEN (MENU_SCREEN_INFO_YSIZE / \ MENU_SCREEN_INFO_YSTEP) -#define NUM_INFO_ELEMENTS_FROM_CONF \ +#define DEFAULT_INFO_ELEMENTS MIN(STD_INFO_ELEMENTS_ON_SCREEN,\ + DYN_INFO_ELEMENTS_ON_SCREEN) +#define NUM_INFO_ELEMENTS_FROM_CONF \ (menu.list_size_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] > 0 ? \ menu.list_size_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] : \ - MAX_MENU_ENTRIES_ON_SCREEN) -#define NUM_INFO_ELEMENTS_ON_SCREEN MIN(MIN(STD_INFO_ELEMENTS_ON_SCREEN, \ - MAX_INFO_ELEMENTS_ON_SCREEN), \ - NUM_INFO_ELEMENTS_FROM_CONF) + DEFAULT_INFO_ELEMENTS) +#define NUM_INFO_ELEMENTS_ON_SCREEN MIN(NUM_INFO_ELEMENTS_FROM_CONF,\ + MAX_INFO_ELEMENTS) #define MAX_MENU_ENTRIES_ON_SCREEN (SCR_FIELDY - MENU_SCREEN_START_YPOS) #define MAX_MENU_TEXT_LENGTH_BIG 13 #define MAX_MENU_TEXT_LENGTH_MEDIUM (MAX_MENU_TEXT_LENGTH_BIG * 2) @@ -3012,8 +3017,8 @@ void DrawInfoScreen_NotAvailable(char *text_title, char *text_error) void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init) { - static int infoscreen_step[MAX_INFO_ELEMENTS_ON_SCREEN]; - static int infoscreen_frame[MAX_INFO_ELEMENTS_ON_SCREEN]; + static int infoscreen_step[MAX_INFO_ELEMENTS_IN_ARRAY]; + static int infoscreen_frame[MAX_INFO_ELEMENTS_IN_ARRAY]; int font_foot = MENU_INFO_FONT_FOOT; int xstart = mSX + MENU_SCREEN_INFO_SPACE_LEFT; int ystart = mSY + MENU_SCREEN_INFO_YSTART;