From e13cb1ca9274c982ac2fd6588b0572371f4af8d7 Mon Sep 17 00:00:00 2001 From: Indev Date: Tue, 17 Mar 2026 19:00:38 +0300 Subject: [PATCH 1/7] Remove few remaining flashpal things in opengl menu --- src/m_menu.c | 1 - src/m_menudefs.c | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index ca408dc79..26b7213ab 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2075,7 +2075,6 @@ void M_Init(void) OP_OpenGLOptionsMenu[op_gl_shader].status = IT_GRAYEDOUT; OP_OpenGLOptionsMenu[op_gl_lightdither].status = IT_GRAYEDOUT; OP_OpenGLOptionsMenu[op_gl_palrender].status = IT_GRAYEDOUT; - OP_OpenGLOptionsMenu[op_gl_flashpal].status = IT_GRAYEDOUT; OP_ExpOptionsMenu[op_exp_paldepth].status = IT_GRAYEDOUT; } diff --git a/src/m_menudefs.c b/src/m_menudefs.c index aa3f186c8..e734021eb 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1043,7 +1043,6 @@ static const char* OP_OpenGLTooltips[] = "Fallback 3D model for characters that don't have any.", "Graphical Shaders.", "Recreates the look of software mode.", - "Flash palettes for palette rendering.", "Bit-depth of textures.", "Filter to use on textures.", "Anisotropic filtering.", @@ -1062,7 +1061,6 @@ enum op_gl_falbckmdls, op_gl_shader, op_gl_palrender, - op_gl_flashpal, op_gl_scrdepth, op_gl_filter, op_gl_anis, @@ -2772,6 +2770,5 @@ void M_UpdateOGLMenu(void) OP_OpenGLOptionsMenu[op_gl_lightdither].status = (!HWR_UseShader()) ? IT_GRAYEDOUT : IT_STRING | IT_CVAR; OP_OpenGLOptionsMenu[op_gl_palrender].status = (cv_glscreentextures.value != 2 || !HWR_UseShader()) ? IT_GRAYEDOUT : IT_STRING | IT_CVAR; - OP_OpenGLOptionsMenu[op_gl_flashpal].status = (!HWR_ShouldUsePaletteRendering()) ? IT_GRAYEDOUT : IT_STRING | IT_CVAR; } #endif From bb3414d603313d6468c413e0ee6847a7a05fa447 Mon Sep 17 00:00:00 2001 From: Indev Date: Sat, 21 Mar 2026 23:10:48 +0300 Subject: [PATCH 2/7] Fix /pm and emote suggestions overlapping --- src/hu_stuff.c | 126 ++++++++++++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 60 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 6ede89fc6..72203c8fe 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -97,7 +97,6 @@ static textinput_t w_chat; static boolean headsupactive = false; boolean hu_showscores = false; // draw rankings static char hu_tick; -static tic_t hu_emoteanim = 0; emote_autocomplete_t emote_autocomplete = {0}; static huddrawlist_h luahuddrawlist_scores = NULL; @@ -1095,7 +1094,6 @@ void HU_Ticker(void) return; hu_tick++; - hu_emoteanim++; hu_tick &= 7; // currently only to blink chat input cursor if (PLAYER1INPUTDOWN(gc_scores)) @@ -1810,6 +1808,7 @@ static void HU_DrawChat(void) INT32 t = 0, c = 0, y = chaty - (typelines*charheight); UINT32 i = 0, saylen = strlen(w_chat_buf); // You learn new things everyday! INT32 cflag = 0; + INT32 pm_offset = 0; // for cases when you type emote while also doing /pm size_t select_start = 0, select_end = 0; const char *ntalk = "Say: ", *ttalk = "Team: "; const char *talk = ntalk; @@ -1921,64 +1920,6 @@ static void HU_DrawChat(void) } } - if (emote_autocomplete.emotestart != -1 && (emote_autocomplete.complete[0] || (w_chat.cursor - emote_autocomplete.emotestart) > 1)) - { - emote_t *suggest; - int skip = 0; - - const char *complete; - int complete_len; - - if (emote_autocomplete.complete[0]) - { - complete = emote_autocomplete.complete; - complete_len = strlen(complete); - } - else - { - complete = &w_chat_buf[emote_autocomplete.emotestart]; - complete_len = w_chat.cursor - emote_autocomplete.emotestart; - } - - // A bit of copy-paste from /pm code :p - INT32 suggesty = chaty - charheight - 1; - size_t longest_suggestion_length = 0; - - while ((suggest = M_FindEmote(complete, complete_len, skip)) != NULL) - { - longest_suggestion_length = max(longest_suggestion_length, strlen(suggest->name)); - ++skip; - } - - skip = 0; - -#ifdef NETSPLITSCREEN - if (splitscreen) - { - suggesty -= BASEVIDHEIGHT/2; - if (splitscreen > 1) - suggesty += 16; - } - else -#endif - suggesty -= (cv_kartspeedometer.value ? 16 : 0); - - while ((suggest = M_FindEmote(complete, complete_len, skip)) != NULL) - { - V_DrawFillConsoleMap(chatx + boxw + 2, suggesty - (7*skip), (longest_suggestion_length+2)*4 + EMOTEWIDTH, 6, V_SNAPTOBOTTOM|V_SNAPTOLEFT); - - // Highlight currently suggested emote - int hlflag = 0; - if (skip == emote_autocomplete.skip && emote_autocomplete.complete[0]) - hlflag = V_YELLOWMAP; - - V_DrawSmallString(chatx + boxw + 4 + EMOTEWIDTH, suggesty - (7*skip), hlflag|V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, va(":%s:", suggest->name)); - M_DrawEmote(chatx + boxw + 2, suggesty - skip*7, suggest, V_SNAPTOBOTTOM|V_SNAPTOLEFT); - - ++skip; - } - } - // handle /pm list. It's messy, horrible and I don't care. if (strnicmp(w_chat_buf, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai { @@ -2059,9 +2000,74 @@ static void HU_DrawChat(void) if (count == 0) // no results. { + pm_offset = 48 + 2; V_DrawFillConsoleMap(chatx + boxw + 2, p_dispy - (6*count), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud. V_DrawSmallString(chatx + boxw + 4, p_dispy - (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, "NO RESULT."); } + else + { + pm_offset = (longest_name_length+4)*4 + 2; + } + } + + if (emote_autocomplete.emotestart != -1 && (emote_autocomplete.complete[0] || (w_chat.cursor - emote_autocomplete.emotestart) > 1)) + { + emote_t *suggest; + int skip = 0; + + const char *complete; + int complete_len; + + if (emote_autocomplete.complete[0]) + { + complete = emote_autocomplete.complete; + complete_len = strlen(complete); + } + else + { + complete = &w_chat_buf[emote_autocomplete.emotestart]; + complete_len = w_chat.cursor - emote_autocomplete.emotestart; + } + + // A bit of copy-paste from /pm code :p + INT32 suggesty = chaty - charheight - 1; + size_t longest_suggestion_length = 0; + + while ((suggest = M_FindEmote(complete, complete_len, skip)) != NULL) + { + longest_suggestion_length = max(longest_suggestion_length, strlen(suggest->name)); + ++skip; + } + + INT32 emote_suggest_boxw = (longest_suggestion_length+2)*4 + EMOTEWIDTH; + + skip = 0; + +#ifdef NETSPLITSCREEN + if (splitscreen) + { + suggesty -= BASEVIDHEIGHT/2; + if (splitscreen > 1) + suggesty += 16; + } + else +#endif + suggesty -= (cv_kartspeedometer.value ? 16 : 0); + + while ((suggest = M_FindEmote(complete, complete_len, skip)) != NULL) + { + V_DrawFillConsoleMap(chatx + boxw + pm_offset + 2, suggesty - (7*skip), emote_suggest_boxw, 6, V_SNAPTOBOTTOM|V_SNAPTOLEFT); + + // Highlight currently suggested emote + int hlflag = 0; + if (skip == emote_autocomplete.skip && emote_autocomplete.complete[0]) + hlflag = V_YELLOWMAP; + + V_DrawSmallString(chatx + boxw + pm_offset + 4 + EMOTEWIDTH, suggesty - (7*skip), hlflag|V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, va(":%s:", suggest->name)); + M_DrawEmote(chatx + boxw + pm_offset + 2, suggesty - skip*7, suggest, V_SNAPTOBOTTOM|V_SNAPTOLEFT); + + ++skip; + } } HU_drawChatLog(typelines - 1); // typelines is the # of lines we're typing. If there's more than 1 then the log should scroll up to give us more space. From 6721f534ccdd5c2950bfc67c3c1d31dc8cad164d Mon Sep 17 00:00:00 2001 From: Indev Date: Sun, 22 Mar 2026 22:16:55 +0300 Subject: [PATCH 3/7] Fix Got_Saycmd not skipping null terminator when message has maximum length --- src/hu_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 72203c8fe..91f9ca7d1 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -906,7 +906,7 @@ static void Got_Saycmd(const UINT8 **p, INT32 playernum) target = READSINT8(*p); flags = READUINT8(*p); msg = buf; - READSTRINGL(*p, msg, HU_MAXMSGLEN + 1); + READSTRINGN(*p, msg, HU_MAXMSGLEN + 1); if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum))) { From 1c74b3702610ed030cc68a729719c04a7b6c03f8 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 22 Mar 2026 22:13:37 +0100 Subject: [PATCH 4/7] unify console shift handling both the non AZERTY and AZERTY functions basically did the exact same thing so can just get rid of one also simplify some checks --- src/console.c | 56 +++++++---------------------------------------- src/console.h | 1 - src/d_main.c | 2 +- src/m_menu.c | 2 +- src/m_textinput.c | 4 ++-- 5 files changed, 12 insertions(+), 53 deletions(-) diff --git a/src/console.c b/src/console.c index 7276b59c8..d185858f9 100644 --- a/src/console.c +++ b/src/console.c @@ -638,68 +638,28 @@ INT32 CON_ShiftChar(INT32 ch) if (I_UseNativeKeyboard()) return ch; - if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) - { - if (cv_keyboardlayout.value == 3) - { - if (shiftdown ^ capslock) - ch = shiftxform[ch]; - else if (altdown & 0x2) - ch = french_altgrxform[ch]; - else - ch = HU_FallBackFrSpecialLetter(ch); - } - else - { - if (shiftdown ^ capslock) - ch = shiftxform[ch]; - } - } - else // if we're holding shift we should still shift non letter symbols - { - if (cv_keyboardlayout.value == 3) - { - if (shiftdown) - ch = shiftxform[ch]; - else if (altdown & 0x2) - ch = french_altgrxform[ch]; - else - ch = HU_FallBackFrSpecialLetter(ch); - } - else - { - if (shiftdown) - ch = shiftxform[ch]; - } - } - - return ch; -} - -INT32 CON_ShitAndAltGrChar(INT32 ch) -{ if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { if (shiftdown ^ capslock) ch = shiftxform[ch]; } - else // if we're holding shift we should still shift non letter symbols + else // if we're holding shift we should still shift non letter symbols { if (shiftdown) ch = shiftxform[ch]; - else if (altdown & 0x2) + else if (cv_keyboardlayout.value == 3) { - ch = french_altgrxform[ch]; - } - else - { - ch = HU_FallBackFrSpecialLetter(ch); + if (altdown & 0x2) + ch = french_altgrxform[ch]; + else + ch = HU_FallBackFrSpecialLetter(ch); } } return ch; } + // Clear time of console heads up messages // void CON_ClearHUD(void) @@ -892,7 +852,7 @@ boolean CON_Responder(event_t *ev) return true; // ctrl modifier -- changes behavior, adds shortcuts - if ((cv_keyboardlayout.value != 3 && ctrldown) || (cv_keyboardlayout.value == 3 && ctrldown && !altdown)) + if (ctrldown && (cv_keyboardlayout.value != 3 || (cv_keyboardlayout.value == 3 && !altdown))) { // show all cvars/commands that match what we have inputted if (key == KEY_TAB) diff --git a/src/console.h b/src/console.h index 3292bc6e3..abb506609 100644 --- a/src/console.h +++ b/src/console.h @@ -49,7 +49,6 @@ extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *or extern UINT8 *consolebgmap; INT32 CON_ShiftChar(INT32 ch); -INT32 CON_ShitAndAltGrChar(INT32 ch); void CON_SetupBackColormap(void); void CON_ClearHUD(void); // clear heads up messages diff --git a/src/d_main.c b/src/d_main.c index 0ecce2047..ccfa61f4e 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1208,7 +1208,7 @@ void D_AddPostloadFiles(void) static boolean AddIWAD(const char * file, const char *dir) { - char * path = va(pandf, dir, file); + char *path = va(pandf, dir, file); if (FIL_ReadFileOK(path)) { diff --git a/src/m_menu.c b/src/m_menu.c index 26b7213ab..3128b1e15 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7950,7 +7950,7 @@ static void M_DrawSetupMultiPlayerMenu(void) patch_t *statbg = (patch_t *)W_CachePatchName("K_STATBG", PU_PATCH); patch_t *statlr = (patch_t *)W_CachePatchName("K_STATLR", PU_PATCH); patch_t *statud = (patch_t *)W_CachePatchName("K_STATUD", PU_PATCH); - patch_t *statdot = (patch_t *)W_CachePatchName("K_SDOT0", PU_PATCH); + patch_t *statdot = (patch_t *)W_CachePatchName("K_SDOT0" , PU_PATCH); patch_t *patch; UINT8 frame; UINT8 speed; diff --git a/src/m_textinput.c b/src/m_textinput.c index 7d050dfc7..c49294094 100644 --- a/src/m_textinput.c +++ b/src/m_textinput.c @@ -256,7 +256,7 @@ static boolean M_TextInputHandleBase(textinput_t *input, INT32 key, boolean emot return true; } - if ((cv_keyboardlayout.value != 3 && ctrldown) || (cv_keyboardlayout.value == 3 && ctrldown && !altdown)) + if (ctrldown && (cv_keyboardlayout.value != 3 || (cv_keyboardlayout.value == 3 && !altdown))) { if (key == 'x' || key == 'X') { @@ -392,7 +392,7 @@ static boolean M_TextInputHandleBase(textinput_t *input, INT32 key, boolean emot key = '/'; // same capslock code as hu_stuff.c's HU_responder. Check there for details. - key = cv_keyboardlayout.value == 3 ? CON_ShitAndAltGrChar(key) : CON_ShiftChar(key); + key = CON_ShiftChar(key); // enter a char into the command prompt if (key < 32 || key > 127) From 0d20ebb01f654caa80d5e4af6ba13b2ca83240e9 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 22 Mar 2026 22:17:36 +0100 Subject: [PATCH 5/7] delet P_CyclePlayerMobjState P_SetMobjState already handles player case and forwards it to P_SetPlayerMobjState so this is just duped code --- src/p_mobj.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 01b3977d0..552ef4eff 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -122,27 +122,6 @@ static void P_CycleMobjState(mobj_t *mobj) } } -// -// P_CycleMobjState for players. -// -static void P_CyclePlayerMobjState(mobj_t *mobj) -{ - // state animations - P_CycleStateAnimation(mobj); - - // cycle through states, - // calling action functions at transitions - if (mobj->tics != -1) - { - mobj->tics--; - - // you can cycle through multiple states in a tic - if (!mobj->tics && mobj->state) - if (!P_SetPlayerMobjState(mobj, mobj->state->nextstate)) - return; // freed itself - } -} - #define MAX_RECURSION 20 // @@ -9221,10 +9200,7 @@ void P_MobjThinker(mobj_t *mobj) } // Can end up here if a player dies. - if (mobj->player) - P_CyclePlayerMobjState(mobj); - else - P_CycleMobjState(mobj); + P_CycleMobjState(mobj); if (P_MobjWasRemoved(mobj)) return; From 8af43a55c9d54c05f7cf104ae3fcd11b7fe40eae Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 22 Mar 2026 22:29:10 +0100 Subject: [PATCH 6/7] split CONS_Printf so both CONS_Alert and CONS_Debug dont have to handle and copy the varargs twice probably makes no actual difference in practice, but i prefer it to not do pointless work --- src/console.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/console.c b/src/console.c index d185858f9..df7fc299d 100644 --- a/src/console.c +++ b/src/console.c @@ -1182,19 +1182,10 @@ void CON_LogMessage(const char *msg) // Console print! Wahooo! Lots o fun! // -void CONS_Printf(const char *fmt, ...) +static inline void CONS_PrintMsg(char *txt) { - va_list argptr; - static char *txt = NULL; boolean startup; - if (txt == NULL) - txt = malloc(8192); - - va_start(argptr, fmt); - vsnprintf(txt, 8192, fmt, argptr); - va_end(argptr); - // echo console prints to log file DEBFILE(txt); @@ -1220,6 +1211,21 @@ void CONS_Printf(const char *fmt, ...) } } +void CONS_Printf(const char *fmt, ...) +{ + va_list argptr; + static char *txt = NULL; + + if (txt == NULL) + txt = malloc(8192); + + va_start(argptr, fmt); + vsnprintf(txt, 8192, fmt, argptr); + va_end(argptr); + + CONS_PrintMsg(txt); +} + void CONS_Alert(alerttype_t level, const char *fmt, ...) { va_list argptr; @@ -1248,9 +1254,7 @@ void CONS_Alert(alerttype_t level, const char *fmt, ...) break; } - // I am lazy and I feel like just letting CONS_Printf take care of things. - // Is that okay? - CONS_Printf("%s", txt); + CONS_PrintMsg(txt); } void CONS_Debug(INT32 debugflags, const char *fmt, ...) @@ -1268,11 +1272,9 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) vsnprintf(txt, 8192, fmt, argptr); va_end(argptr); - // Again I am lazy, oh well - CONS_Printf("%s", txt); + CONS_PrintMsg(txt); } - // Print an error message, and wait for ENTER key to continue. // To make sure the user has seen the message // From 654895dcff451c7c63c8621c9f58dc5de7fdd6d8 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 23 Mar 2026 19:04:44 +0100 Subject: [PATCH 7/7] fix timedemo not accounting for level and addon loading apparently demos used to send a mapcmd before instead of directly calling G_InitNew, so this function was never called which meant that timedemos always returned a wrong result first time --- src/g_demo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_demo.c b/src/g_demo.c index 9662ce517..0b8921c69 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -3090,6 +3090,9 @@ post_compat: if (cv_director.value) CV_SetValue(&cv_director, 0); + if (demo.timing) + G_DoneLevelLoad(); + demo.deferstart = true; } #undef SKIPERRORS