From 9b51c9c7fe54d7e14f0d95ab898f9b2a78e5fc4b Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 18 Jul 2023 19:52:14 +0100 Subject: [PATCH 01/10] V_GetHWConsBackColor: Fix for RR's console color list Also, don't be such a weenie that you say slurs in your code comments --- src/v_video.cpp | 58 ++++++++++++++----------------------------------- 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/src/v_video.cpp b/src/v_video.cpp index 5c06f45e8..c0efa5a9b 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -1083,8 +1083,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) .done(); } -#ifdef HWRENDER -// This is now a function since it's otherwise repeated 2 times and honestly looks retarded: +// This is now a function, no use being such a weenie that you say a slur over it static UINT32 V_GetHWConsBackColor(void) { UINT32 hwcolor; @@ -1095,26 +1094,25 @@ static UINT32 V_GetHWConsBackColor(void) case 2: hwcolor = 0xdeb88700; break; // Sepia case 3: hwcolor = 0x40201000; break; // Brown case 4: hwcolor = 0xfa807200; break; // Pink - case 5: hwcolor = 0xff69b400; break; // Raspberry - case 6: hwcolor = 0xff000000; break; // Red - case 7: hwcolor = 0xffd68300; break; // Creamsicle - case 8: hwcolor = 0xff800000; break; // Orange - case 9: hwcolor = 0xdaa52000; break; // Gold - case 10: hwcolor = 0x80800000; break; // Yellow - case 11: hwcolor = 0x00ff0000; break; // Emerald - case 12: hwcolor = 0x00800000; break; // Green - case 13: hwcolor = 0x4080ff00; break; // Cyan - case 14: hwcolor = 0x4682b400; break; // Steel - case 15: hwcolor = 0x1e90ff00; break; // Periwinkle - case 16: hwcolor = 0x0000ff00; break; // Blue - case 17: hwcolor = 0xff00ff00; break; // Purple - case 18: hwcolor = 0xee82ee00; break; // Lavender + case 5: hwcolor = 0xff000000; break; // Red + case 6: hwcolor = 0xff800000; break; // Orange + case 7: hwcolor = 0xdaa52000; break; // Gold + case 8: hwcolor = 0xffdd0000; break; // Yellow + case 9: hwcolor = 0xc5e80000; break; // Peridot + case 10: hwcolor = 0x00800000; break; // Green + case 11: hwcolor = 0x15f2b000; break; // Aquamarine + case 12: hwcolor = 0x00ffff00; break; // Cyan + case 13: hwcolor = 0x4682b400; break; // Steel + case 14: hwcolor = 0x0000ff00; break; // Blue + case 15: hwcolor = 0x9844ff00; break; // Purple + case 16: hwcolor = 0xff00ff00; break; // Magenta + case 17: hwcolor = 0xee82ee00; break; // Lavender + case 18: hwcolor = 0xf570a500; break; // Rose // Default green default: hwcolor = 0x00800000; break; } return hwcolor; } -#endif // THANK YOU MPC!!! // and thanks toaster for cleaning it up. @@ -1674,31 +1672,7 @@ void V_DrawPromptBack(INT32 boxheight, INT32 color) if (color == INT32_MAX) color = cons_backcolor.value; - UINT32 hwcolor; - switch (color) - { - case 0: hwcolor = 0xffffff00; break; // White - case 1: hwcolor = 0x00000000; break; // Black // Note this is different from V_DrawFadeConsBack - case 2: hwcolor = 0xdeb88700; break; // Sepia - case 3: hwcolor = 0x40201000; break; // Brown - case 4: hwcolor = 0xfa807200; break; // Pink - case 5: hwcolor = 0xff69b400; break; // Raspberry - case 6: hwcolor = 0xff000000; break; // Red - case 7: hwcolor = 0xffd68300; break; // Creamsicle - case 8: hwcolor = 0xff800000; break; // Orange - case 9: hwcolor = 0xdaa52000; break; // Gold - case 10: hwcolor = 0x80800000; break; // Yellow - case 11: hwcolor = 0x00ff0000; break; // Emerald - case 12: hwcolor = 0x00800000; break; // Green - case 13: hwcolor = 0x4080ff00; break; // Cyan - case 14: hwcolor = 0x4682b400; break; // Steel - case 15: hwcolor = 0x1e90ff00; break; // Periwinkle - case 16: hwcolor = 0x0000ff00; break; // Blue - case 17: hwcolor = 0xff00ff00; break; // Purple - case 18: hwcolor = 0xee82ee00; break; // Lavender - // Default green - default: hwcolor = 0x00800000; break; - } + UINT32 hwcolor = V_GetHWConsBackColor(); #ifdef HWRENDER if (rendermode == render_opengl) From 24ab95ddde9074d91577a4c594b57350cc27437e Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sun, 20 Nov 2022 11:50:01 +0100 Subject: [PATCH 02/10] Uncap console opening/closing animation --- src/console.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/console.c b/src/console.c index 3c5e0f9f2..ee6f8e672 100644 --- a/src/console.c +++ b/src/console.c @@ -614,33 +614,39 @@ static void CON_ChangeHeight(void) // static void CON_MoveConsole(void) { - fixed_t conspeed; + static fixed_t fracmovement = 0; Lock_state(); - conspeed = FixedDiv(cons_speed.value*vid.fdupy, FRACUNIT); - // instant if (!cons_speed.value) { con_curlines = con_destlines; + Unlock_state(); return; } - // up/down move to dest - if (con_curlines < con_destlines) + // Not instant - Increment fracmovement fractionally + fracmovement += FixedMul(cons_speed.value*vid.fdupy, renderdeltatics); + + if (con_curlines < con_destlines) // Move the console downwards { - con_curlines += FixedInt(conspeed); - if (con_curlines > con_destlines) - con_curlines = con_destlines; + con_curlines += FixedInt(fracmovement); // Move by fracmovement's integer value + if (con_curlines > con_destlines) // If we surpassed the destination... + con_curlines = con_destlines; // ...clamp to it! } - else if (con_curlines > con_destlines) + else // Move the console upwards { - con_curlines -= FixedInt(conspeed); + con_curlines -= FixedInt(fracmovement); if (con_curlines < con_destlines) con_curlines = con_destlines; + + if (con_destlines == 0) // If the console is being closed, not just moved up... + con_tick = 0; // ...don't show the blinking cursor } + fracmovement %= FRACUNIT; // Reset fracmovement's integer value, but keep the fraction + Unlock_state(); } @@ -759,10 +765,6 @@ void CON_Ticker(void) CON_ChangeHeight(); } - // console movement - if (con_destlines != con_curlines) - CON_MoveConsole(); - // clip the view, so that the part under the console is not drawn con_clipviewtop = -1; if (cons_backpic.value) // clip only when using an opaque background @@ -1875,6 +1877,10 @@ void CON_Drawer(void) CON_ClearHUD(); } + // console movement + if (con_curlines != con_destlines) + CON_MoveConsole(); + if (con_curlines > 0) CON_DrawConsole(); else if (CON_GamestateDrawHudLines() == true) From 4c08b7010ddc8dd45a1c3921fa8a9cb6a19e24f1 Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sun, 20 Nov 2022 11:50:57 +0100 Subject: [PATCH 03/10] Make con_height adjustable on the fly --- src/console.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/console.c b/src/console.c index ee6f8e672..735fe1ba4 100644 --- a/src/console.c +++ b/src/console.c @@ -108,6 +108,7 @@ static void CON_RecalcSize(void); static void CON_ChangeHeight(void); static void CON_DrawBackpic(void); +static void CONS_height_Change(void); static void CONS_hudlines_Change(void); static void CONS_backcolor_Change(void); @@ -134,7 +135,7 @@ static CV_PossibleValue_t speed_cons_t[] = {{0, "MIN"}, {64, "MAX"}, {0, NULL}}; static consvar_t cons_speed = CVAR_INIT ("con_speed", "8", CV_SAVE, speed_cons_t, NULL); // percentage of screen height to use for console -static consvar_t cons_height = CVAR_INIT ("con_height", "50", CV_SAVE, CV_Unsigned, NULL); +static consvar_t cons_height = CVAR_INIT ("con_height", "50", CV_CALL|CV_SAVE, CV_Unsigned, CONS_height_Change); static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}, {0, NULL}}; // whether to use console background picture, or translucent mode @@ -152,6 +153,18 @@ consvar_t cons_backcolor = CVAR_INIT ("con_backcolor", "Black", CV_CALL|CV_SAVE, static void CON_Print(char *msg); +// Change the console height on demand +// +static void CONS_height_Change(void) +{ + Lock_state(); + + if (con_destlines > 0 && !con_startup) // If the console is open (as in, not using "bind")... + CON_ChangeHeight(); // ...update its height now, not only when it's closed and re-opened + + Unlock_state(); +} + // // static void CONS_hudlines_Change(void) From c36d987be7da25f01ff31ac3eb444bb9f15bad9f Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sun, 20 Nov 2022 11:51:40 +0100 Subject: [PATCH 04/10] Draw the input prompt while the console is moving --- src/console.c | 52 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/console.c b/src/console.c index 735fe1ba4..cdb0e0fc0 100644 --- a/src/console.c +++ b/src/console.c @@ -59,7 +59,7 @@ static boolean con_started = false; // console has been initialised static boolean con_forcepic = true; // at startup toggle console translucency when first off boolean con_recalc; // set true when screen size has changed -static tic_t con_tick; // console ticker for anim or blinking prompt cursor +static tic_t con_tick; // console ticker for blinking prompt cursor // con_scrollup should use time (currenttime - lasttime).. static boolean consoletoggle; // true when console key pushed, ticker will handle @@ -1814,41 +1814,41 @@ static void CON_DrawConsole(void) } // draw console text lines from top to bottom - if (con_curlines < minheight) - return; - - i = con_cy - con_scrollup; - - // skip the last empty line due to the cursor being at the start of a new line - i--; - - i -= (con_curlines - minheight) / charheight; - - if (rendermode == render_none) return; - - for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++) + if (con_curlines >= minheight) { - INT32 x; - size_t c; + i = con_cy - con_scrollup; - p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width]; + // skip the last empty line due to the cursor being at the start of a new line + i--; - for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++) + i -= (con_curlines - minheight) / charheight; + + if (rendermode == render_none) return; + + for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++) { - while (*p & 0x80) + INT32 x; + size_t c; + + p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width]; + + for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++) { - charflags = (*p & 0x7f) << V_CHARCOLORSHIFT; - p++; - c++; + while (*p & 0x80) + { + charflags = (*p & 0x7f) << V_CHARCOLORSHIFT; + p++; + c++; + } + if (c >= con_width) + break; + V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true); } - if (c >= con_width) - break; - V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true); } } // draw prompt if enough place (not while game startup) - if ((con_curlines == con_destlines) && (con_curlines >= minheight) && !con_startup) + if ((con_curlines >= (minheight-charheight)) && !con_startup) CON_DrawInput(); } From ea53197084dfd965eb4ffc4f8c1943b96479e097 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 18 Jul 2023 20:26:43 +0100 Subject: [PATCH 05/10] Fix off by 1 error in con_hudlines Originally written by Zwip-Zwap Zapony for the SRB2 repository as part of STJR/SRB2!1931, partially flattened to avoid waiting for the merger of the entire branch. - 0, not 1 as previously was the case, now shows zero lines. - Now inclusively capped between 0 and 20 lines in the cvar, rather than silently in the console code. --- src/console.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/console.c b/src/console.c index cdb0e0fc0..d8691df52 100644 --- a/src/console.c +++ b/src/console.c @@ -70,8 +70,8 @@ static INT32 con_curlines; // vid lines currently used by console INT32 con_clipviewtop; // (useless) -static INT32 con_hudlines; // number of console heads up message lines -static INT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines +static UINT8 con_hudlines; // number of console heads up message lines +static INT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines INT32 con_clearlines; // top screen lines to refresh when view reduced boolean con_hudupdate; // when messages scroll, we need a backgrnd refresh @@ -127,7 +127,8 @@ static char con_buffer[CON_BUFFERSIZE]; static consvar_t cons_msgtimeout = CVAR_INIT ("con_hudtime", "5", CV_SAVE, CV_Unsigned, NULL); // number of lines displayed on the HUD -static consvar_t cons_hudlines = CVAR_INIT ("con_hudlines", "5", CV_CALL|CV_SAVE, CV_Unsigned, CONS_hudlines_Change); +static CV_PossibleValue_t hudlines_cons_t[] = {{0, "MIN"}, {MAXHUDLINES, "MAX"}, {0, "None"}, {0, NULL}}; +static consvar_t cons_hudlines = CVAR_INIT ("con_hudlines", "5", CV_CALL|CV_SAVE, hudlines_cons_t, CONS_hudlines_Change); // number of lines console move per frame // (con_speed needs a limit, apparently) @@ -177,11 +178,6 @@ static void CONS_hudlines_Change(void) for (i = 0; i < con_hudlines; i++) con_hudtime[i] = 0; - if (cons_hudlines.value < 1) - cons_hudlines.value = 1; - else if (cons_hudlines.value > MAXHUDLINES) - cons_hudlines.value = MAXHUDLINES; - con_hudlines = cons_hudlines.value; Unlock_state(); @@ -799,9 +795,8 @@ void CON_Ticker(void) // make overlay messages disappear after a while for (i = 0; i < con_hudlines; i++) { - con_hudtime[i]--; - if (con_hudtime[i] < 0) - con_hudtime[i] = 0; + if (con_hudtime[i]) + con_hudtime[i]--; } Unlock_state(); @@ -1349,7 +1344,8 @@ boolean CON_Responder(event_t *ev) static void CON_Linefeed(void) { // set time for heads up messages - con_hudtime[con_cy%con_hudlines] = cons_msgtimeout.value*TICRATE; + if (con_hudlines) + con_hudtime[con_cy%con_hudlines] = cons_msgtimeout.value*TICRATE; con_cy++; con_cx = 0; @@ -1689,7 +1685,7 @@ static void CON_DrawHudlines(void) INT32 charwidth = 8 * con_scalefactor; INT32 charheight = 8 * con_scalefactor; - if (con_hudlines <= 0) + if (!con_hudlines) return; if (chat_on && OLDCHAT) @@ -1697,7 +1693,7 @@ static void CON_DrawHudlines(void) else y = 0; - for (i = con_cy - con_hudlines+1; i <= con_cy; i++) + for (i = con_cy - con_hudlines; i <= con_cy; i++) { size_t c; INT32 x; From 05b130b422c90990c3be301be44b102f8efa78e6 Mon Sep 17 00:00:00 2001 From: SteelT Date: Thu, 13 Jul 2023 01:02:15 -0400 Subject: [PATCH 06/10] Add CV_TrueFalse as possible value types for console variables This also adds support for using true/false as value aliases for On/Off, Yes/No or 1/0 # Conflicts: # src/command.c --- src/command.c | 13 ++++++++----- src/command.h | 1 + src/lua_consolelib.c | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/command.c b/src/command.c index 7184ace42..2066fbff7 100644 --- a/src/command.c +++ b/src/command.c @@ -78,6 +78,7 @@ CV_PossibleValue_t CV_OnOff[] = {{0, "Off"}, {1, "On"}, {0, NULL}}; CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}}; CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}}; CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}}; +CV_PossibleValue_t CV_TrueFalse[] = {{0, "False"}, {1, "True"}, {0, NULL}}; // Cheats #ifdef DEVELOP @@ -909,9 +910,11 @@ static void COM_Help_f(void) { CONS_Printf(" Possible values:\n"); if (cvar->PossibleValue == CV_YesNo) - CONS_Printf(" Yes or No (On or Off, 1 or 0)\n"); + CONS_Printf(" Yes or No (On or Off, True or False, 1 or 0)\n"); else if (cvar->PossibleValue == CV_OnOff) - CONS_Printf(" On or Off (Yes or No, 1 or 0)\n"); + CONS_Printf(" On or Off (Yes or No, True or False, 1 or 0)\n"); + else if (cvar->PossibleValue == CV_TrueFalse) + CONS_Printf(" True or False (On or Off, Yes or No, 1 or 0)\n"); else if (cvar->PossibleValue == Color_cons_t || cvar->PossibleValue == Followercolor_cons_t) { boolean follower = (cvar->PossibleValue == Followercolor_cons_t); @@ -1565,12 +1568,12 @@ boolean CV_CompleteValue(consvar_t *var, const char **valstrp, INT32 *intval) goto found; } // Not found ... but wait, there's hope! - if (var->PossibleValue == CV_OnOff || var->PossibleValue == CV_YesNo) + if (var->PossibleValue == CV_OnOff || var->PossibleValue == CV_YesNo || var->PossibleValue == CV_TrueFalse) { overrideval = -1; - if (!stricmp(valstr, "on") || !stricmp(valstr, "yes")) + if (!stricmp(valstr, "on") || !stricmp(valstr, "yes") || !stricmp(valstr, "true")) overrideval = 1; - else if (!stricmp(valstr, "off") || !stricmp(valstr, "no")) + else if (!stricmp(valstr, "off") || !stricmp(valstr, "no") || !stricmp(valstr, "false")) overrideval = 0; if (overrideval != -1) diff --git a/src/command.h b/src/command.h index b3bae86a7..52e18f0fd 100644 --- a/src/command.h +++ b/src/command.h @@ -172,6 +172,7 @@ extern CV_PossibleValue_t CV_OnOff[]; extern CV_PossibleValue_t CV_YesNo[]; extern CV_PossibleValue_t CV_Unsigned[]; extern CV_PossibleValue_t CV_Natural[]; +extern CV_PossibleValue_t CV_TrueFalse[]; // SRB2kart // the KARTSPEED and KARTGP were previously defined here, but moved to doomstat to avoid circular dependencies diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index 12a5f2ff3..965e9dd42 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -341,7 +341,7 @@ static int lib_cvRegisterVar(lua_State *L) } else if (i == 4 || (k && fasticmp(k, "PossibleValue"))) { if (lua_islightuserdata(L, 4)) { CV_PossibleValue_t *pv = lua_touserdata(L, 4); - if (pv == CV_OnOff || pv == CV_YesNo || pv == CV_Unsigned || pv == CV_Natural) + if (pv == CV_OnOff || pv == CV_YesNo || pv == CV_Unsigned || pv == CV_Natural || pv == CV_TrueFalse) cvar->PossibleValue = pv; else FIELDERROR("PossibleValue", "CV_PossibleValue_t expected, got unrecognised pointer") @@ -577,6 +577,8 @@ int LUA_ConsoleLib(lua_State *L) lua_setglobal(L, "CV_Unsigned"); lua_pushlightuserdata(L, CV_Natural); lua_setglobal(L, "CV_Natural"); + lua_pushlightuserdata(L, CV_TrueFalse); + lua_setglobal(L, "CV_TrueFalse"); // Set global functions lua_pushvalue(L, LUA_GLOBALSINDEX); From 02651d249c0faf943bcca447454234eb8ab257c7 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 18 Jul 2023 20:43:07 +0100 Subject: [PATCH 07/10] Set default value of `bots` to Off, not 0 --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 823099cf6..96fcdddd0 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -430,7 +430,7 @@ static CV_PossibleValue_t kartbot_cons_t[] = { {13,"Lv.MAX"}, {0, NULL} }; -consvar_t cv_kartbot = CVAR_INIT ("bots", "0", CV_NETVAR, kartbot_cons_t, NULL); +consvar_t cv_kartbot = CVAR_INIT ("bots", "Off", CV_NETVAR, kartbot_cons_t, NULL); consvar_t cv_karteliminatelast = CVAR_INIT ("eliminatelast", "Yes", CV_NETVAR|CV_CALL, CV_YesNo, KartEliminateLast_OnChange); From e2ee6e45d76ec4015c39e40cef2e19f172f0993a Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Sat, 4 Feb 2023 17:35:44 +0100 Subject: [PATCH 08/10] Limit con_hudtime to 24 hours Also rename cons_msgtimeout to cons_hudtime for consistency --- src/console.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/console.c b/src/console.c index d8691df52..eb7a1ccd9 100644 --- a/src/console.c +++ b/src/console.c @@ -70,8 +70,8 @@ static INT32 con_curlines; // vid lines currently used by console INT32 con_clipviewtop; // (useless) -static UINT8 con_hudlines; // number of console heads up message lines -static INT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines +static UINT8 con_hudlines; // number of console heads up message lines +static UINT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines INT32 con_clearlines; // top screen lines to refresh when view reduced boolean con_hudupdate; // when messages scroll, we need a backgrnd refresh @@ -124,7 +124,9 @@ static void CONS_backcolor_Change(void); static char con_buffer[CON_BUFFERSIZE]; // how many seconds the hud messages lasts on the screen -static consvar_t cons_msgtimeout = CVAR_INIT ("con_hudtime", "5", CV_SAVE, CV_Unsigned, NULL); +// CV_Unsigned can overflow when multiplied by TICRATE later, so let's use a 24-hour limit instead +static CV_PossibleValue_t hudtime_cons_t[] = {{0, "MIN"}, {86400, "MAX"}, {0, NULL}}; +static consvar_t cons_hudtime = CVAR_INIT ("con_hudtime", "5", CV_SAVE, hudtime_cons_t, NULL); // number of lines displayed on the HUD static CV_PossibleValue_t hudlines_cons_t[] = {{0, "MIN"}, {MAXHUDLINES, "MAX"}, {0, "None"}, {0, NULL}}; @@ -458,7 +460,7 @@ void CON_Init(void) Unlock_state(); - CV_RegisterVar(&cons_msgtimeout); + CV_RegisterVar(&cons_hudtime); CV_RegisterVar(&cons_hudlines); CV_RegisterVar(&cons_speed); CV_RegisterVar(&cons_height); @@ -1345,7 +1347,7 @@ static void CON_Linefeed(void) { // set time for heads up messages if (con_hudlines) - con_hudtime[con_cy%con_hudlines] = cons_msgtimeout.value*TICRATE; + con_hudtime[con_cy%con_hudlines] = cons_hudtime.value*TICRATE; con_cy++; con_cx = 0; From 6b5e3f650e033bff5961b8acb3837db688a3f0c7 Mon Sep 17 00:00:00 2001 From: Zwip-Zwap Zapony Date: Tue, 13 Jun 2023 14:02:19 +0200 Subject: [PATCH 09/10] Use 99999999 instead of 86400, make "MIN" 0 Nines might be more pleasing than an exact number for con_hudtime It'd be bad to make "MIN" in an old config suddenly start displaying lines for con_hudlines # Conflicts: # src/console.c --- src/console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/console.c b/src/console.c index eb7a1ccd9..16fc3b8f9 100644 --- a/src/console.c +++ b/src/console.c @@ -124,12 +124,12 @@ static void CONS_backcolor_Change(void); static char con_buffer[CON_BUFFERSIZE]; // how many seconds the hud messages lasts on the screen -// CV_Unsigned can overflow when multiplied by TICRATE later, so let's use a 24-hour limit instead -static CV_PossibleValue_t hudtime_cons_t[] = {{0, "MIN"}, {86400, "MAX"}, {0, NULL}}; +// CV_Unsigned can overflow when multiplied by TICRATE later, so let's use a 3-year limit instead +static CV_PossibleValue_t hudtime_cons_t[] = {{0, "MIN"}, {99999999, "MAX"}, {0, NULL}}; static consvar_t cons_hudtime = CVAR_INIT ("con_hudtime", "5", CV_SAVE, hudtime_cons_t, NULL); // number of lines displayed on the HUD -static CV_PossibleValue_t hudlines_cons_t[] = {{0, "MIN"}, {MAXHUDLINES, "MAX"}, {0, "None"}, {0, NULL}}; +static CV_PossibleValue_t hudlines_cons_t[] = {{0, "MIN"}, {MAXHUDLINES, "MAX"}, {0, NULL}}; static consvar_t cons_hudlines = CVAR_INIT ("con_hudlines", "5", CV_CALL|CV_SAVE, hudlines_cons_t, CONS_hudlines_Change); // number of lines console move per frame From e3d0662c7d375e73a583d9e33a3ba324a4b194a1 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 19 Jul 2023 21:23:27 +0100 Subject: [PATCH 10/10] Remove even a mention of the slur that once sat here --- src/v_video.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/v_video.cpp b/src/v_video.cpp index c0efa5a9b..17519f894 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -1083,7 +1083,6 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) .done(); } -// This is now a function, no use being such a weenie that you say a slur over it static UINT32 V_GetHWConsBackColor(void) { UINT32 hwcolor;