diff --git a/include/global.h b/include/global.h index 98769352f..763d10af0 100644 --- a/include/global.h +++ b/include/global.h @@ -441,6 +441,10 @@ extern struct nomakedefs_s nomakedefs; #define MAXMONNO 120 /* extinct monst after this number created */ #define MHPMAX 500 /* maximum monster hp */ +#ifndef MAX_MSG_HISTORY +#define MAX_MSG_HISTORY 128 /* max # of lines in msg_history */ +#endif + typedef struct color_and_attr { int color, attr; } color_attr; diff --git a/include/winX.h b/include/winX.h index 657d48287..b43e442ac 100644 --- a/include/winX.h +++ b/include/winX.h @@ -267,7 +267,6 @@ struct xwindow { /* event into a character(s) */ #define DEFAULT_LINES_DISPLAYED 12 /* # of lines displayed message window */ -#define MAX_HISTORY 60 /* max history saved on message window */ /* flags for X11_yn_function_core() */ #define YN_NORMAL 0U /* no flags */ diff --git a/include/wincurs.h b/include/wincurs.h index c544e4244..ee7c5c5a2 100644 --- a/include/wincurs.h +++ b/include/wincurs.h @@ -33,7 +33,6 @@ extern WINDOW *activemenu; /* curses window for menu requesting a #define MAP_WIN 3 #define INV_WIN 4 #define NHWIN_MAX 5 -#define MESG_HISTORY_MAX 200 #if !defined(__APPLE__) || !defined(NCURSES_VERSION) # define USE_DARKGRAY /* Allow "bright" black; delete if not visible */ #endif /* !__APPLE__ && !PDCURSES */ diff --git a/win/X11/winmesg.c b/win/X11/winmesg.c index 9f18e7323..6c5c01f35 100644 --- a/win/X11/winmesg.c +++ b/win/X11/winmesg.c @@ -92,8 +92,8 @@ create_message_window(struct xwindow *wp, /* window pointer */ if (iflags.msg_history < (unsigned) appResources.message_lines) iflags.msg_history = (unsigned) appResources.message_lines; - if (iflags.msg_history > MAX_HISTORY) /* a sanity check */ - iflags.msg_history = MAX_HISTORY; + if (iflags.msg_history > MAX_MSG_HISTORY) /* a sanity check */ + iflags.msg_history = MAX_MSG_HISTORY; set_circle_buf(mesg_info, (int) iflags.msg_history); diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index 01f3eec08..14e87bebd 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -453,8 +453,8 @@ curses_init_mesg_history(void) max_messages = 1; } - if (max_messages > MESG_HISTORY_MAX) { - max_messages = MESG_HISTORY_MAX; + if (max_messages > MAX_MSG_HISTORY) { + max_messages = MAX_MSG_HISTORY; } } diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 8813898b0..f43dc80cf 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -886,8 +886,8 @@ tty_create_nhwindow(int type) /* sanity check */ if (iflags.msg_history < 20) iflags.msg_history = 20; - else if (iflags.msg_history > 60) - iflags.msg_history = 60; + else if (iflags.msg_history > MAX_MSG_HISTORY) + iflags.msg_history = MAX_MSG_HISTORY; newwin->maxrow = newwin->rows = iflags.msg_history; newwin->maxcol = newwin->cols = 0; break; diff --git a/win/win32/mhmsgwnd.c b/win/win32/mhmsgwnd.c index 6807be60a..2707facc3 100644 --- a/win/win32/mhmsgwnd.c +++ b/win/win32/mhmsgwnd.c @@ -10,8 +10,7 @@ #define MSG_WRAP_TEXT #define MSG_VISIBLE_LINES max(iflags.wc_vary_msgcount, 1) -#define MAX_MSG_LINES 128 -#define MSG_LINES (int) min(iflags.msg_history, MAX_MSG_LINES) +#define MSG_LINES (int) min(iflags.msg_history, MAX_MSG_HISTORY) #define MAXWINDOWTEXT TBUFSZ #define DEFAULT_COLOR_BG_MSG COLOR_WINDOW @@ -26,7 +25,7 @@ struct window_line { typedef struct mswin_nethack_message_window { size_t max_text; - struct window_line window_text[MAX_MSG_LINES]; + struct window_line window_text[MAX_MSG_HISTORY]; int lines_last_turn; /* lines added during the last turn */ int lines_not_seen; /* lines not yet seen by user after last turn or --More-- */