From 4dd5957f1918e253531a6d0a29e28471fd4e8cb1 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 29 Mar 2026 13:46:57 +0200 Subject: [PATCH 1/5] cache islocalplayer in P_SpectatorJoinGame --- src/p_user.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index f57739c92..24b646ee3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4149,10 +4149,12 @@ void P_ResetLocalCamAiming(player_t *player) boolean P_SpectatorJoinGame(player_t *player) { + const boolean islocalplayer = P_IsLocalPlayer(player); + // Team changing isn't allowed. if (!cv_allowteamchange.value) { - if (P_IsLocalPlayer(player)) + if (islocalplayer) CONS_Printf(M_GetText("Server does not allow team change.\n")); } // Team changing in Team Match and CTF @@ -4200,7 +4202,7 @@ boolean P_SpectatorJoinGame(player_t *player) P_ResetLocalCamAiming(player); //Reset away view - if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer) + if (islocalplayer && displayplayers[0] != consoleplayer) displayplayers[0] = consoleplayer; if (changeto == 1) @@ -4227,7 +4229,7 @@ boolean P_SpectatorJoinGame(player_t *player) P_ResetLocalCamAiming(player); //Reset away view - if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer) + if (islocalplayer && displayplayers[0] != consoleplayer) displayplayers[0] = consoleplayer; HU_AddChatText(va(M_GetText("\x82*%s entered the game."), player_names[player-players]), false); From 12169bfb388b18fdf112ad399099fd9da6ca1b68 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 29 Mar 2026 13:49:59 +0200 Subject: [PATCH 2/5] controllers:check if controller supports addressable led and rumble --- src/dedicated/i_system.c | 12 ++++++++++++ src/g_input.c | 21 ++++++++++++++++++++ src/i_system.h | 3 +++ src/sdl/i_system.cpp | 41 ++++++++++++++++++++++++++++++++++++++++ src/sdl/sdlmain.h | 4 ++++ 5 files changed, 81 insertions(+) diff --git a/src/dedicated/i_system.c b/src/dedicated/i_system.c index ddc17d6a5..978190bec 100644 --- a/src/dedicated/i_system.c +++ b/src/dedicated/i_system.c @@ -735,6 +735,18 @@ const char *I_GetJoyName(INT32 joyindex) return NULL; } +boolean I_GamepadHasLED(INT32 playernum) +{ + (void)playernum; + return false; +} + +boolean I_GamepadHasRumble(INT32 playernum) +{ + (void)playernum; + return false; +} + void I_GamepadRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, UINT32 duration) { (void)playernum; diff --git a/src/g_input.c b/src/g_input.c index d44edd6dc..091027ada 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -939,6 +939,11 @@ void G_SetPlayerGamepadIndicatorColor(INT32 playernum, UINT8 color) return; } + if (!I_GamepadHasLED(playernum)) + { + return; + } + // so we can override this skincolor = color ? color : G_GetSkinColorForGamepad(playernum); byte_color = V_GetColor(colortranslations[skincolor][8]).s; @@ -974,12 +979,22 @@ void G_DeviceLEDTick(void) for (i = 0; i <= splitscreen; i++) { if (!cv_usejoystick[i].value || !cv_gamepadled[i].value) + { continue; + } + + // does not have a configurable led! :c + if (!I_GamepadHasLED(i)) + { + continue; + } newcolor = G_GetSkinColorForGamepad(i); if (curcolor[i] == newcolor) // dont update if same colour + { continue; + } G_SetPlayerGamepadIndicatorColor(i, newcolor); curcolor[i] = newcolor; @@ -1055,6 +1070,12 @@ void G_DeviceRumbleTick(void) continue; } + // does not support rumble! :c + if (!I_GamepadHasRumble(i)) + { + continue; + } + if (camera[i].freecam) { continue; diff --git a/src/i_system.h b/src/i_system.h index 45767f1f7..88bb9c985 100644 --- a/src/i_system.h +++ b/src/i_system.h @@ -148,6 +148,9 @@ extern INT32 numcontrollers; */ const char *I_GetJoyName(INT32 joyindex); +boolean I_GamepadHasLED(INT32 playernum); +boolean I_GamepadHasRumble(INT32 playernum); + void I_GamepadRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, UINT32 duration); void I_SetGamepadIndicatorColor(INT32 playernum, UINT8 red, UINT8 green, UINT8 blue); diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index 407e5c3a0..8ddea4249 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -729,6 +729,8 @@ static void JoyReset(SDLJoyInfo_t *JoySet) #if (SDL_VERSION_ATLEAST(2,32,4)) JoySet->id = -1; #endif + JoySet->hasled = false; + JoySet->hasrumble = false; } /** \brief SDL info about joystick @@ -949,6 +951,13 @@ static int joy_open(int playerIndex, int joyIndex) JoyInfo[playerIndex].id = I_GetJoystickDeviceIndex(JoyInfo[playerIndex].dev); #endif +#if (SDL_VERSION_ATLEAST(2,0,14)) + JoyInfo[playerIndex].hasled = SDL_GameControllerHasLED(JoyInfo[playerIndex].dev); +#endif +#if (SDL_VERSION_ATLEAST(2,0,18)) + JoyInfo[playerIndex].hasrumble = SDL_GameControllerHasRumble(JoyInfo[playerIndex].dev); +#endif + return SDL_CONTROLLER_AXIS_MAX; } @@ -996,6 +1005,8 @@ void I_InitJoystick(UINT8 index) #if (SDL_VERSION_ATLEAST(2,32,4)) JoyInfo[index].id = -1; #endif + JoyInfo[index].hasled = false; + JoyInfo[index].hasrumble = false; if (cv_usejoystick[index].value) newcontroller = SDL_GameControllerOpen(cv_usejoystick[index].value-1); @@ -1130,6 +1141,26 @@ const char *I_GetJoyName(INT32 joyindex) return joyname; } +boolean I_GamepadHasLED(INT32 playernum) +{ +#if !(SDL_VERSION_ATLEAST(2,0,14)) + (void)playernum; + return false; +#else + return (JoyInfo[playernum].dev != NULL && JoyInfo[playernum].hasled); +#endif +} + +boolean I_GamepadHasRumble(INT32 playernum) +{ +#if !(SDL_VERSION_ATLEAST(2,0,18)) + (void)playernum; + return false; +#else + return (JoyInfo[playernum].dev != NULL && JoyInfo[playernum].hasrumble); +#endif +} + void I_GamepadRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, UINT32 duration) { #if !(SDL_VERSION_ATLEAST(2,0,14)) @@ -1145,6 +1176,11 @@ void I_GamepadRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, return; } + if (!I_GamepadHasRumble(playernum)) + { + return; + } + SDL_GameControllerRumble(controller, low_strength, high_strength, duration); #endif } @@ -1164,6 +1200,11 @@ void I_SetGamepadIndicatorColor(INT32 playernum, UINT8 red, UINT8 green, UINT8 b return; } + if (!I_GamepadHasLED(playernum)) + { + return; + } + SDL_GameControllerSetLED(controller, red, green, blue); #endif } diff --git a/src/sdl/sdlmain.h b/src/sdl/sdlmain.h index 11287fe55..b904eefc6 100644 --- a/src/sdl/sdlmain.h +++ b/src/sdl/sdlmain.h @@ -57,6 +57,10 @@ typedef struct SDLJoyInfo_s //int hats; /// number of balls //int balls; + /// + boolean hasled; + /// + boolean hasrumble; } SDLJoyInfo_t; /** \brief SDL info about controller 1 From 7b0e3269b32e278a66f4664c9026ac9340ad27a3 Mon Sep 17 00:00:00 2001 From: Indev Date: Sat, 4 Apr 2026 16:37:15 +0300 Subject: [PATCH 3/5] Add option to hide finished players from minimap --- src/d_netcmd.h | 1 + src/k_hud.c | 5 +++++ src/m_menudefs.c | 52 +++++++++++++++++++++++++----------------------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index f22fe33a8..c28df3e7d 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -155,6 +155,7 @@ extern consvar_t cv_pingstyle; //extern consvar_t cv_smallpos; extern consvar_t cv_showminimapnames; +extern consvar_t cv_showminimapfinished; extern consvar_t cv_minihead; extern consvar_t cv_showminimapangle; diff --git a/src/k_hud.c b/src/k_hud.c index 3ec17ddd0..6ded3a2f1 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -92,6 +92,7 @@ consvar_t cv_showinput = {"showinput", "Off", CV_SAVE, inputdisplay_cons_t, NULL static CV_PossibleValue_t minihead_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Others"}, {0, NULL}}; consvar_t cv_minihead = {"smallminimapplayers", "Off", CV_SAVE, minihead_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_showminimapnames = {"showminimapnames", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_showminimapfinished = {"showminimapfinished", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; CV_PossibleValue_t minimapdot_cons_t[NUMMINIMAPDOTSTUFF]; consvar_t cv_showminimapangle = {"showminimapangle", "Off", CV_SAVE, minimapdot_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -221,6 +222,7 @@ void K_RegisterKartHudStuff(void) CV_RegisterVar(&cv_minihead); CV_RegisterVar(&cv_showminimapnames); + CV_RegisterVar(&cv_showminimapfinished); CV_RegisterVar(&cv_showminimapangle); CV_RegisterVar(&cv_showlapemblem); @@ -3772,6 +3774,9 @@ static void K_drawKartMinimap(void) if (!players[i].mo || players[i].spectator) continue; + if (!cv_showminimapfinished.value && players[i].exiting) + continue; + if (P_IsDisplayPlayer(&players[i])) { // Draw display players on top of everything else diff --git a/src/m_menudefs.c b/src/m_menudefs.c index e734021eb..3f1b969ee 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1831,44 +1831,45 @@ static menuitem_t OP_SaturnHudMenu[] = {IT_STRING|IT_CVAR, NULL, "Speedometer Style", &cv_newspeedometer, 10}, {IT_STRING|IT_CVAR, NULL, "Battle Speedometer", &cv_battlespeedo, 15}, - {IT_STRING|IT_CVAR, NULL, "Colourized HUD", &cv_colorizedhud, 25}, - {IT_STRING|IT_CVAR, NULL, "Colourized Itembox", &cv_colorizeditembox, 30}, - {IT_STRING|IT_CVAR, NULL, "Colourized HUD Color", &cv_colorizedhudcolor, 35}, + {IT_STRING|IT_CVAR, NULL, "Colourized HUD", &cv_colorizedhud, 25}, + {IT_STRING|IT_CVAR, NULL, "Colourized Itembox", &cv_colorizeditembox, 30}, + {IT_STRING|IT_CVAR, NULL, "Colourized HUD Color", &cv_colorizedhudcolor, 35}, - {IT_STRING|IT_CVAR, NULL, "Input Display", &cv_showinput, 45}, + {IT_STRING|IT_CVAR, NULL, "Input Display", &cv_showinput, 45}, - {IT_STRING|IT_CVAR, NULL, "Stat Display", &cv_showstats, 55}, + {IT_STRING|IT_CVAR, NULL, "Stat Display", &cv_showstats, 55}, - {IT_STRING|IT_CVAR, NULL, "Higher Resolution Portraits", &cv_highresportrait, 65}, + {IT_STRING|IT_CVAR, NULL, "Higher Resolution Portraits", &cv_highresportrait, 65}, - {IT_STRING|IT_CVAR, NULL, "Small Positionnumber", &cv_smallposnum, 75}, - {IT_STRING|IT_CVAR, NULL, "Positionnumber Animation", &cv_posanim, 80}, + {IT_STRING|IT_CVAR, NULL, "Small Positionnumber", &cv_smallposnum, 75}, + {IT_STRING|IT_CVAR, NULL, "Positionnumber Animation", &cv_posanim, 80}, - {IT_STRING|IT_CVAR, NULL, "Flash Lap Times", &cv_showlaptimes, 90}, + {IT_STRING|IT_CVAR, NULL, "Flash Lap Times", &cv_showlaptimes, 90}, - {IT_STRING|IT_CVAR, NULL, "Multi-Item icons", &cv_multiitemicon, 100}, - {IT_STRING|IT_CVAR, NULL, "Item Amount Number", &cv_huditemamount, 105}, - {IT_STRING|IT_CVAR, NULL, "Animated Roulette", &cv_fancyroulette, 110}, + {IT_STRING|IT_CVAR, NULL, "Multi-Item icons", &cv_multiitemicon, 100}, + {IT_STRING|IT_CVAR, NULL, "Item Amount Number", &cv_huditemamount, 105}, + {IT_STRING|IT_CVAR, NULL, "Animated Roulette", &cv_fancyroulette, 110}, - {IT_STRING|IT_CVAR, NULL, "Show Lap Emblem", &cv_showlapemblem, 120}, - {IT_STRING|IT_CVAR, NULL, "Show Cecho Messages", &cv_cechotoggle, 125}, + {IT_STRING|IT_CVAR, NULL, "Show Lap Emblem", &cv_showlapemblem, 120}, + {IT_STRING|IT_CVAR, NULL, "Show Cecho Messages", &cv_cechotoggle, 125}, - {IT_STRING|IT_CVAR, NULL, "Show Names on Minimap", &cv_showminimapnames, 135}, - {IT_STRING|IT_CVAR, NULL, "Small Minimap Players", &cv_minihead, 140}, - {IT_STRING|IT_CVAR, NULL, "Spin Minimap Icons", &cv_spinoutroll, 145}, - {IT_STRING|IT_CVAR, NULL, "Player Angle Visual", &cv_showminimapangle, 150}, + {IT_STRING|IT_CVAR, NULL, "Show Names on Minimap", &cv_showminimapnames, 135}, + {IT_STRING|IT_CVAR, NULL, "Show Finished on Minimap", &cv_showminimapfinished, 140}, + {IT_STRING|IT_CVAR, NULL, "Small Minimap Players", &cv_minihead, 145}, + {IT_STRING|IT_CVAR, NULL, "Spin Minimap Icons", &cv_spinoutroll, 150}, + {IT_STRING|IT_CVAR, NULL, "Player Angle Visual", &cv_showminimapangle, 155}, - {IT_STRING|IT_CVAR, NULL, "Music Credits", &cv_songcredits, 160}, - {IT_STRING|IT_CVAR, NULL, "Music Credits on Pause", &cv_pausesongcredits, 165}, + {IT_STRING|IT_CVAR, NULL, "Music Credits", &cv_songcredits, 165}, + {IT_STRING|IT_CVAR, NULL, "Music Credits on Pause", &cv_pausesongcredits, 170}, - {IT_STRING|IT_CVAR, NULL, "Beta Intermissionscreen", &cv_betainterscreen, 175}, + {IT_STRING|IT_CVAR, NULL, "Beta Intermissionscreen", &cv_betainterscreen, 180}, - {IT_STRING|IT_CVAR, NULL, "Show Director Prompt", &cv_showdirectorhud, 185}, + {IT_STRING|IT_CVAR, NULL, "Show Director Prompt", &cv_showdirectorhud, 190}, - {IT_STRING|IT_SUBMENU, NULL, "Nametags...", &OP_NametagDef, 195}, - {IT_STRING|IT_SUBMENU, NULL, "Driftgauge...", &OP_DriftGaugeDef, 200}, + {IT_STRING|IT_SUBMENU, NULL, "Nametags...", &OP_NametagDef, 200}, + {IT_STRING|IT_SUBMENU, NULL, "Driftgauge...", &OP_DriftGaugeDef, 205}, - {IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 210}, + {IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 215}, }; static const char* OP_SaturnHudTooltips[] = @@ -1891,6 +1892,7 @@ static const char* OP_SaturnHudTooltips[] = "Show the big 'LAP' text on a lap change.", "Show the big Cecho Messages.", "Show player names on the minimap.", + "Show players that have finished already on the minimap.", "Minimize the player icons on the minimap.", "Erratically rotate player icons during spinouts.", "Visualize the player facing angle.", From 9d75bb14056c00aa3311f6d73f0e0f4e7c11597c Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 4 Apr 2026 15:46:23 +0200 Subject: [PATCH 4/5] hw_main: reorder things, mark const, remove pointless check for polyobject planes like normal planes, polyobject planes will just reallocate their vertex buffer eitherways according to size, so that check does not make much sense, srb2 also did remove it a while ago --- src/hardware/hw_main.cpp | 39 +++++++++++++++------------------------ src/hardware/hw_shaders.c | 10 ++++++++-- src/r_main.cpp | 12 ++++++------ src/sdl/i_system.cpp | 4 +++- 4 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 0806d05c8..87192e2bd 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -388,11 +388,11 @@ void HWR_ObjectLightLevelPost(gl_vissprite_t *spr, const sector_t *sector, INT32 extralight = FixedMul(extralight, std::min(std::max(0, *lightlevel), 255) * FRACUNIT / 255); // simple OGL approximation - fixed_t tr = R_QuickCamDist(spr->mobj->x, spr->mobj->y); - fixed_t xscale = FixedDiv((vid.width / 2) << FRACBITS, tr); + const fixed_t tr = R_QuickCamDist(spr->mobj->x, spr->mobj->y); + const fixed_t xscale = FixedDiv((vid.width / 2) << FRACBITS, tr); // Less change in contrast at further distances, to counteract DOOM diminished light - fixed_t n = FixedDiv(FixedMul(xscale, LIGHTRESOLUTIONFIX), ((MAXLIGHTSCALE-1) << LIGHTSCALESHIFT)); + const fixed_t n = FixedDiv(FixedMul(xscale, LIGHTRESOLUTIONFIX), ((MAXLIGHTSCALE-1) << LIGHTSCALESHIFT)); extralight = FixedMul(extralight, std::min(n, FRACUNIT)); // Contrast is stronger for normal sprites, stronger than wall lighting is at the same distance @@ -515,7 +515,7 @@ static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg, extracolormap_t *colo if (seg != NULL && P_ApplyLightOffsetFine(lightnum, seg->frontsector)) { - INT16 offset = (cv_glfakecontrast.value == 2) ? seg->hwLightOffset : ((INT16)seg->lightOffset * 8); + const INT16 offset = (cv_glfakecontrast.value == 2) ? seg->hwLightOffset : ((INT16)seg->lightOffset * 8); finallight += offset; finallight = CLAMP(finallight, 0 , 255); @@ -533,7 +533,7 @@ static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t if (slope != NULL && sector != NULL && P_ApplyLightOffsetFine(lightnum, sector)) { - INT16 offset = (cv_glfakecontrast.value == 2) ? slope->hwLightOffset : ((INT16)slope->lightOffset * 8); + const INT16 offset = (cv_glfakecontrast.value == 2) ? slope->hwLightOffset : ((INT16)slope->lightOffset * 8); finallight += (fof ? -offset : offset); finallight = CLAMP(finallight, 0 , 255); @@ -1420,6 +1420,11 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom { draw_sky_walls(0, 1, worldhigh, worldhighslope); } + + // hack to allow height changes in outdoor areas + // This is what gets rid of the upper textures if there should be sky + worldtop = worldhigh; + worldtopslope = worldhighslope; } else { @@ -1464,15 +1469,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom } } - // hack to allow height changes in outdoor areas - // This is what gets rid of the upper textures if there should be sky - if (gl_frontsector->ceilingpic == skyflatnum - && gl_backsector->ceilingpic == skyflatnum) - { - worldtop = worldhigh; - worldtopslope = worldhighslope; - } - gl_toptexture = R_GetTextureNum(gl_sidedef->toptexture); // check TOP TEXTURE @@ -2263,7 +2259,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom static inline boolean HWR_UsePortals(void) { - return supportstencil && cv_glportals.value && gl_maphasportals; + return supportstencil && gl_maphasportals && cv_glportals.value; } // From PrBoom: @@ -2407,7 +2403,8 @@ static inline void DoAddLine(seg_t* line, angle_t angle1, angle_t angle2) // SoM: Backsector needs to be run through R_FakeFlat static sector_t tempsec; - auto do_addline = [&](bool dontdraw) { + auto do_addline = [&](bool dontdraw) + { // Single sided line? if (!line->backsector) { @@ -2688,14 +2685,6 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, if (nrPlaneVerts < 3) // not even a triangle ? return; - if (nrPlaneVerts > INT16_MAX) // FIXME: exceeds plVerts size - { - CONS_Debug(DBG_RENDER, "polygon size of %s exceeds max value of %d vertices\n", sizeu1(nrPlaneVerts), UINT16_MAX); - return; - } - - const sector_t *sec = FOFsector ? FOFsector : gl_frontsector; - // Allocate plane-vertex buffer if we need to if (!planeVerts || nrPlaneVerts > numAllocedPlaneVerts) { @@ -2704,6 +2693,8 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, Z_Malloc(numAllocedPlaneVerts * sizeof(FOutVector), PU_LEVEL, &planeVerts); } + const sector_t *sec = FOFsector ? FOFsector : gl_frontsector; + height = FixedToFloat(fixedheight); len = W_LumpLength(lumpnum); diff --git a/src/hardware/hw_shaders.c b/src/hardware/hw_shaders.c index 90d019b2b..31723eab1 100644 --- a/src/hardware/hw_shaders.c +++ b/src/hardware/hw_shaders.c @@ -365,13 +365,17 @@ static void HWR_CompileShader(int index) if (vertex_source) { char *preprocessed = HWR_PreprocessShader(vertex_source); - if (!preprocessed) return; + if (!preprocessed) + return; + GL_LoadShader(index, preprocessed, HWD_SHADERSTAGE_VERTEX); } if (fragment_source) { char *preprocessed = HWR_PreprocessShader(fragment_source); - if (!preprocessed) return; + if (!preprocessed) + return; + GL_LoadShader(index, preprocessed, HWD_SHADERSTAGE_FRAGMENT); } @@ -387,8 +391,10 @@ void HWR_CompileShaders(void) { int custom_index = gl_shadertargets[i].custom_shader; HWR_CompileShader(i); + if (!gl_shaders[i].compiled) CONS_Alert(CONS_ERROR, "HWR_CompileShaders: Compilation failed for base %s shader!\n", shaderxlat[i].type); + if (custom_index != -1) { HWR_CompileShader(custom_index); diff --git a/src/r_main.cpp b/src/r_main.cpp index 2b318858a..cf7df9088 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -342,14 +342,14 @@ angle_t R_PointToAngle64(INT64 x, INT64 y) return (y -= viewy, (x -= viewx) || y) ? x >= 0 ? y >= 0 ? - (x > y) ? tantoangle[SlopeDivEx(y,x)] : // octant 0 - ANGLE_90-tantoangle[SlopeDivEx(x,y)] : // octant 1 - x > (y = -y) ? 0-tantoangle[SlopeDivEx(y,x)] : // octant 8 - ANGLE_270+tantoangle[SlopeDivEx(x,y)] : // octant 7 + (x > y) ? tantoangle[SlopeDivEx(y,x)] : // octant 0 + ANGLE_90-tantoangle[SlopeDivEx(x,y)] : // octant 1 + x > (y = -y) ? 0-tantoangle[SlopeDivEx(y,x)] : // octant 8 + ANGLE_270+tantoangle[SlopeDivEx(x,y)] : // octant 7 y >= 0 ? (x = -x) > y ? ANGLE_180-tantoangle[SlopeDivEx(y,x)] : // octant 3 - ANGLE_90 + tantoangle[SlopeDivEx(x,y)] : // octant 2 + ANGLE_90 + tantoangle[SlopeDivEx(x,y)] : // octant 2 (x = -x) > (y = -y) ? ANGLE_180+tantoangle[SlopeDivEx(y,x)] : // octant 4 - ANGLE_270-tantoangle[SlopeDivEx(x,y)] : // octant 5 + ANGLE_270-tantoangle[SlopeDivEx(x,y)] : // octant 5 0; } diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index 8ddea4249..2f2253fe8 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -304,7 +304,7 @@ static void I_StartupConsole(void) if (!consolevent) return; - if (isatty(STDIN_FILENO)!=1) + if (isatty(STDIN_FILENO) != 1) { I_OutputMsg("stdin is not a tty, tty console mode failed\n"); consolevent = false; @@ -1993,12 +1993,14 @@ FUNCNORETURN void ATTRNORETURN I_Quit(void) I_ShutdownInput(); I_ShutdownSystem(); SDL_Quit(); + /* if option -noendtxt is set, don't print the text */ if (!M_CheckParm("-noendtxt") && W_CheckNumForName("ENDOOM") != LUMPERROR) { printf("\r"); ShowEndTxt(); } + if (myargmalloc) free(myargv); // Deallocate allocated memory From e543599598236f205c050b4f6cff248cb4b944fd Mon Sep 17 00:00:00 2001 From: Indev Date: Sat, 4 Apr 2026 16:53:01 +0300 Subject: [PATCH 5/5] Add option to hide skin name from stat display --- src/k_hud.c | 17 +++++++++++------ src/k_hud.h | 1 + src/m_menudefs.c | 48 +++++++++++++++++++++++++----------------------- 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/src/k_hud.c b/src/k_hud.c index 6ded3a2f1..1efdcbdcb 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -83,6 +83,7 @@ IMPL_HUD_OFFSET(stat); // Stats // extra hud things consvar_t cv_showstats = {"showstats", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_showstats_skinname = {"showstats_skinname", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_highresportrait = {"highresportrait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // make char potraits use their high-res version instead @@ -208,6 +209,7 @@ void K_RegisterKartHudStuff(void) CV_RegisterVar(&cv_kartspeedometer); CV_RegisterVar(&cv_showstats); + CV_RegisterVar(&cv_showstats_skinname); CV_RegisterVar(&cv_showinput); CV_RegisterVar(&cv_posanim); @@ -1436,13 +1438,16 @@ static void K_drawKartStats(void) fakeskin = K_GetPlayerSkin(stplyr); // Skin name - if (K_IsHighResolution()) // V_DrawSmallString becomes a mess at low resolutions lel + if (cv_showstats_skinname.value) { - V_DrawSmallString(x+20, y+12, flags2, fakeskin->realname); - } - else - { - V_DrawThinString(x+20, y+7, flags2, fakeskin->realname); + if (K_IsHighResolution()) // V_DrawSmallString becomes a mess at low resolutions lel + { + V_DrawSmallString(x+20, y+12, flags2, fakeskin->realname); + } + else + { + V_DrawThinString(x+20, y+7, flags2, fakeskin->realname); + } } // Icon and stats diff --git a/src/k_hud.h b/src/k_hud.h index c42996a4e..ca38f43ea 100644 --- a/src/k_hud.h +++ b/src/k_hud.h @@ -35,6 +35,7 @@ extern consvar_t cv_darkitembox; extern consvar_t cv_biglaps; extern consvar_t cv_highresportrait; extern consvar_t cv_showstats; +extern consvar_t cv_showstats_skinname; extern consvar_t cv_fancyroulette; extern consvar_t cv_showlaptimes; extern consvar_t cv_battlespeedo; diff --git a/src/m_menudefs.c b/src/m_menudefs.c index 3f1b969ee..0b176fab3 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1828,8 +1828,8 @@ static menuitem_t OP_SaturnHudMenu[] = { {IT_HEADER, NULL, "Saturn Hud Options", NULL, 0}, - {IT_STRING|IT_CVAR, NULL, "Speedometer Style", &cv_newspeedometer, 10}, - {IT_STRING|IT_CVAR, NULL, "Battle Speedometer", &cv_battlespeedo, 15}, + {IT_STRING|IT_CVAR, NULL, "Speedometer Style", &cv_newspeedometer, 10}, + {IT_STRING|IT_CVAR, NULL, "Battle Speedometer", &cv_battlespeedo, 15}, {IT_STRING|IT_CVAR, NULL, "Colourized HUD", &cv_colorizedhud, 25}, {IT_STRING|IT_CVAR, NULL, "Colourized Itembox", &cv_colorizeditembox, 30}, @@ -1838,38 +1838,39 @@ static menuitem_t OP_SaturnHudMenu[] = {IT_STRING|IT_CVAR, NULL, "Input Display", &cv_showinput, 45}, {IT_STRING|IT_CVAR, NULL, "Stat Display", &cv_showstats, 55}, + {IT_STRING|IT_CVAR, NULL, "Skin Name in Stat Display", &cv_showstats_skinname, 60}, - {IT_STRING|IT_CVAR, NULL, "Higher Resolution Portraits", &cv_highresportrait, 65}, + {IT_STRING|IT_CVAR, NULL, "Higher Resolution Portraits", &cv_highresportrait, 70}, - {IT_STRING|IT_CVAR, NULL, "Small Positionnumber", &cv_smallposnum, 75}, - {IT_STRING|IT_CVAR, NULL, "Positionnumber Animation", &cv_posanim, 80}, + {IT_STRING|IT_CVAR, NULL, "Small Positionnumber", &cv_smallposnum, 80}, + {IT_STRING|IT_CVAR, NULL, "Positionnumber Animation", &cv_posanim, 85}, - {IT_STRING|IT_CVAR, NULL, "Flash Lap Times", &cv_showlaptimes, 90}, + {IT_STRING|IT_CVAR, NULL, "Flash Lap Times", &cv_showlaptimes, 95}, - {IT_STRING|IT_CVAR, NULL, "Multi-Item icons", &cv_multiitemicon, 100}, - {IT_STRING|IT_CVAR, NULL, "Item Amount Number", &cv_huditemamount, 105}, - {IT_STRING|IT_CVAR, NULL, "Animated Roulette", &cv_fancyroulette, 110}, + {IT_STRING|IT_CVAR, NULL, "Multi-Item icons", &cv_multiitemicon, 105}, + {IT_STRING|IT_CVAR, NULL, "Item Amount Number", &cv_huditemamount, 110}, + {IT_STRING|IT_CVAR, NULL, "Animated Roulette", &cv_fancyroulette, 115}, - {IT_STRING|IT_CVAR, NULL, "Show Lap Emblem", &cv_showlapemblem, 120}, - {IT_STRING|IT_CVAR, NULL, "Show Cecho Messages", &cv_cechotoggle, 125}, + {IT_STRING|IT_CVAR, NULL, "Show Lap Emblem", &cv_showlapemblem, 125}, + {IT_STRING|IT_CVAR, NULL, "Show Cecho Messages", &cv_cechotoggle, 130}, - {IT_STRING|IT_CVAR, NULL, "Show Names on Minimap", &cv_showminimapnames, 135}, - {IT_STRING|IT_CVAR, NULL, "Show Finished on Minimap", &cv_showminimapfinished, 140}, - {IT_STRING|IT_CVAR, NULL, "Small Minimap Players", &cv_minihead, 145}, - {IT_STRING|IT_CVAR, NULL, "Spin Minimap Icons", &cv_spinoutroll, 150}, - {IT_STRING|IT_CVAR, NULL, "Player Angle Visual", &cv_showminimapangle, 155}, + {IT_STRING|IT_CVAR, NULL, "Show Names on Minimap", &cv_showminimapnames, 140}, + {IT_STRING|IT_CVAR, NULL, "Show Finished on Minimap", &cv_showminimapfinished, 145}, + {IT_STRING|IT_CVAR, NULL, "Small Minimap Players", &cv_minihead, 150}, + {IT_STRING|IT_CVAR, NULL, "Spin Minimap Icons", &cv_spinoutroll, 155}, + {IT_STRING|IT_CVAR, NULL, "Player Angle Visual", &cv_showminimapangle, 160}, - {IT_STRING|IT_CVAR, NULL, "Music Credits", &cv_songcredits, 165}, - {IT_STRING|IT_CVAR, NULL, "Music Credits on Pause", &cv_pausesongcredits, 170}, + {IT_STRING|IT_CVAR, NULL, "Music Credits", &cv_songcredits, 170}, + {IT_STRING|IT_CVAR, NULL, "Music Credits on Pause", &cv_pausesongcredits, 175}, - {IT_STRING|IT_CVAR, NULL, "Beta Intermissionscreen", &cv_betainterscreen, 180}, + {IT_STRING|IT_CVAR, NULL, "Beta Intermissionscreen", &cv_betainterscreen, 185}, - {IT_STRING|IT_CVAR, NULL, "Show Director Prompt", &cv_showdirectorhud, 190}, + {IT_STRING|IT_CVAR, NULL, "Show Director Prompt", &cv_showdirectorhud, 195}, - {IT_STRING|IT_SUBMENU, NULL, "Nametags...", &OP_NametagDef, 200}, - {IT_STRING|IT_SUBMENU, NULL, "Driftgauge...", &OP_DriftGaugeDef, 205}, + {IT_STRING|IT_SUBMENU, NULL, "Nametags...", &OP_NametagDef, 205}, + {IT_STRING|IT_SUBMENU, NULL, "Driftgauge...", &OP_DriftGaugeDef, 210}, - {IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 215}, + {IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 220}, }; static const char* OP_SaturnHudTooltips[] = @@ -1882,6 +1883,7 @@ static const char* OP_SaturnHudTooltips[] = "The color to use instead of the player color when\ncolourized hud is enabled.", "Displays the input display and lets you choose its style.", "Enable the stat display.", + "Show skin name in the stat display.", "Enable the use of the higher resolution want icons instead of rank\nfor some places.", "Make the Postionnumber half the size.", "Disable the animation of the Positionnumber\nwhen overtaking someone.",