From 612d01a8ce7c94598b0004f0a6074f6b7da59a78 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 13 May 2025 04:56:15 +0200 Subject: [PATCH 01/11] disable this --- src/hardware/r_opengl/r_opengl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index ce8d11f2a..fb1eb2f80 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -952,7 +952,7 @@ void GL_UnSetShader(void) static void GL_SetNoTexture(void) { // Disable texture. - if (tex_downloaded != NOTEXTURE_NUM && !currently_batching) + if (tex_downloaded != NOTEXTURE_NUM) { if (NOTEXTURE_NUM == 0) pglGenTextures(1, &NOTEXTURE_NUM); @@ -1077,6 +1077,8 @@ void GL_SetStates(void) pglPolygonOffset(-1.0f, -1.0f); + pglDisable(GL_FOG); + // bp : when no t&l :) pglLoadIdentity(); pglScalef(1.0f, 1.0f, -1.0f); From 058139f52b212f808e430a3c6759bd79e370bd1a Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 13 May 2025 22:38:03 +0200 Subject: [PATCH 02/11] dont allow changing grid sorting with item if item button is also enter --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index c1abd2903..b8198b650 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -11442,7 +11442,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice) boolean exitmenu = false; // exit to previous menu and send name change const boolean gridselect = (cv_skinselectmenu.value == SKINMENUTYPE_GRID || cv_skinselectmenu.value == SKINMENUTYPE_EXTENDED); // menus with "grids" - if ((choice == gamecontrol[0][gc_fire][0] || choice == gamecontrol[0][gc_fire][1]) && (itemOn == 2 || (gridselect && itemOn == 1))) + if ((choice == gamecontrol[0][gc_fire][0] || choice == gamecontrol[0][gc_fire][1]) && (itemOn == 2 || (gridselect && itemOn == 1 && choice != KEY_ENTER))) choice = KEY_BACKSPACE; // Hack to allow resetting prefcolor on controllers #define BREAKWHENLOCKED {\ From c2a761c895101ed22dcb6882ac0432b1081be95b Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 14 May 2025 16:35:36 +0200 Subject: [PATCH 03/11] delet some clutter in screen.c --- src/screen.c | 56 +++++++++++----------------------------------------- 1 file changed, 12 insertions(+), 44 deletions(-) diff --git a/src/screen.c b/src/screen.c index 0a9468d25..de9c2aa0a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -106,41 +106,18 @@ void SCR_SetMode(void) V_SetPalette(0); - // - // setup the right draw routines for either 8bpp or 16bpp - // - if (true)//vid.bpp == 1) //Always run in 8bpp. todo: remove all 16bpp code? - { - spanfunc = basespanfunc = R_DrawSpan_8; - splatfunc = R_DrawSplat_8; - transcolfunc = R_DrawTranslatedColumn_8; - transtransfunc = R_DrawTranslatedTranslucentColumn_8; + spanfunc = basespanfunc = R_DrawSpan_8; + splatfunc = R_DrawSplat_8; + transcolfunc = R_DrawTranslatedColumn_8; + transtransfunc = R_DrawTranslatedTranslucentColumn_8; - colfunc = basecolfunc = R_DrawColumn_8; - shadecolfunc = R_DrawShadeColumn_8; - fuzzcolfunc = R_DrawTranslucentColumn_8; - walldrawerfunc = R_DrawWallColumn_8; - twosmultipatchfunc = R_Draw2sMultiPatchColumn_8; - twosmultipatchtransfunc = R_Draw2sMultiPatchTranslucentColumn_8; - } -/* else if (vid.bpp > 1) - { - I_OutputMsg("using highcolor mode\n"); - spanfunc = basespanfunc = R_DrawSpan_16; - transcolfunc = R_DrawTranslatedColumn_16; - transtransfunc = R_DrawTranslucentColumn_16; // No 16bit operation for this function + colfunc = basecolfunc = R_DrawColumn_8; + shadecolfunc = R_DrawShadeColumn_8; + fuzzcolfunc = R_DrawTranslucentColumn_8; + walldrawerfunc = R_DrawWallColumn_8; + twosmultipatchfunc = R_Draw2sMultiPatchColumn_8; + twosmultipatchtransfunc = R_Draw2sMultiPatchTranslucentColumn_8; - colfunc = basecolfunc = R_DrawColumn_16; - shadecolfunc = NULL; // detect error if used somewhere.. - fuzzcolfunc = R_DrawTranslucentColumn_16; - walldrawerfunc = R_DrawWallColumn_16; - }*/ - else - I_Error("unknown bytes per pixel mode %d\n", vid.bpp); -/* - if (SCR_IsAspectCorrect(vid.width, vid.height)) - CONS_Alert(CONS_WARNING, M_GetText("Resolution is not aspect-correct!\nUse a multiple of %dx%d\n"), BASEVIDWIDTH, BASEVIDHEIGHT); -*/ // set the apprpriate drawer for the sky (tall or INT16) setmodeneeded = 0; } @@ -164,10 +141,7 @@ void SCR_Startup(void) vid.fdupx = FixedDiv(vid.width*FRACUNIT, BASEVIDWIDTH*FRACUNIT); vid.fdupy = FixedDiv(vid.height*FRACUNIT, BASEVIDHEIGHT*FRACUNIT); -//#ifdef HWRENDER - //if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl -//#endif - vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy); + vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy); vid.meddupx = (UINT8)(vid.dupx >> 1) + 1; vid.meddupy = (UINT8)(vid.dupy >> 1) + 1; @@ -245,13 +219,7 @@ void SCR_Recalc(void) vid.fdupy = FixedDiv(vid.fdupy, cv_highreshudscale.value); } -#ifdef HWRENDER - //if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl - // 13/11/18: - // The above is no longer necessary, since we want OpenGL to be just like software now - // -- Monster Iestyn -#endif - vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy); + vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy); //vid.baseratio = FixedDiv(vid.height << FRACBITS, BASEVIDHEIGHT << FRACBITS); vid.baseratio = FRACUNIT; From 044836b026864e07adc8f45e87b7b21c0f47ae13 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 14 May 2025 19:28:06 +0200 Subject: [PATCH 04/11] change gamepad powerup led behavior it will instead always take the players mobj color, this makes it indirectly support things like acrobatics and the colourized banana snipe also just makes it a value for cv_gamepadled instead of its own cvar --- src/d_netcmd.c | 1 - src/g_input.c | 45 ++++++++++++++++++--------------------------- src/g_input.h | 1 - src/m_menu.c | 20 ++++++++------------ 4 files changed, 26 insertions(+), 41 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 69df66500..df909990b 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1027,7 +1027,6 @@ void D_RegisterClientCommands(void) { CV_RegisterVar(&cv_rumble[i]); CV_RegisterVar(&cv_gamepadled[i]); - CV_RegisterVar(&cv_ledpowerup[i]); } CV_RegisterVar(&cv_usemouse); diff --git a/src/g_input.c b/src/g_input.c index 963663504..43b7f48ca 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -58,44 +58,35 @@ consvar_t cv_rumble[MAXSPLITSCREENPLAYERS] = { {"rumble4", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, rumble_off_handle4, 0, NULL, NULL, 0, 0, NULL} }; +static CV_PossibleValue_t gamepadled_cons_t[] = {{0, "Off"}, {1, "Skincolor"}, {2, "Mobjcolor"}, {0, NULL}}; consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS] = { - {"gamepadled", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle, 0, NULL, NULL, 0, 0, NULL}, - {"gamepadled2", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle2, 0, NULL, NULL, 0, 0, NULL}, - {"gamepadled3", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle3, 0, NULL, NULL, 0, 0, NULL}, - {"gamepadled4", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle4, 0, NULL, NULL, 0, 0, NULL} -}; - -consvar_t cv_ledpowerup[MAXSPLITSCREENPLAYERS] = { - {"ledpowerup", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle, 0, NULL, NULL, 0, 0, NULL}, - {"ledpowerup2", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle2, 0, NULL, NULL, 0, 0, NULL}, - {"ledpowerup3", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle3, 0, NULL, NULL, 0, 0, NULL}, - {"ledpowerup4", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, led_off_handle4, 0, NULL, NULL, 0, 0, NULL} + {"gamepadled", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle, 0, NULL, NULL, 0, 0, NULL}, + {"gamepadled2", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle2, 0, NULL, NULL, 0, 0, NULL}, + {"gamepadled3", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle3, 0, NULL, NULL, 0, 0, NULL}, + {"gamepadled4", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle4, 0, NULL, NULL, 0, 0, NULL} }; static void rumble_off_handle(void) { - if (cv_rumble[0].value == 0) + if (!cv_rumble[0].value) G_ResetPlayerDeviceRumble(0); } - static void rumble_off_handle2(void) { - if (cv_rumble[1].value == 0) + if (!cv_rumble[1].value) G_ResetPlayerDeviceRumble(1); } - static void rumble_off_handle3(void) { - if (cv_rumble[2].value == 0) + if (!cv_rumble[2].value) G_ResetPlayerDeviceRumble(2); } - static void rumble_off_handle4(void) { - if (cv_rumble[3].value == 0) + if (!cv_rumble[3].value) G_ResetPlayerDeviceRumble(3); } @@ -104,19 +95,16 @@ static void led_off_handle(void) G_ResetPlayerGamepadIndicatorColor(0); } - static void led_off_handle2(void) { G_ResetPlayerGamepadIndicatorColor(1); } - static void led_off_handle3(void) { G_ResetPlayerGamepadIndicatorColor(2); } - static void led_off_handle4(void) { G_ResetPlayerGamepadIndicatorColor(3); @@ -900,13 +888,16 @@ UINT16 G_GetSkinColor(INT32 playernum) { player_t *player = &players[displayplayers[playernum]]; - // make rgb rainbow vomit when invul or flash blue when grow - if (cv_ledpowerup[playernum].value && player->mo && (player->kartstuff[k_invincibilitytimer] || player->kartstuff[k_growshrinktimer] || player->powers[pw_invulnerability])) - return player->mo->color; + if (player) + { + // make rgb rainbow vomit when invul or flash blue when grow + if ((cv_gamepadled[playernum].value == 2) && player->mo && player->mo->color) + return player->mo->color; - // take actual player skincolour when ingame - if (player->skincolor) - return player->skincolor; + // take actual player skincolour when ingame + if (player->skincolor) + return player->skincolor; + } } // otherwise just fallback to whatever the cvar is diff --git a/src/g_input.h b/src/g_input.h index 478dae8f1..d801d1020 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -109,7 +109,6 @@ extern consvar_t cv_mousesens, cv_mouseysens; extern consvar_t cv_controlperkey, cv_turnsmooth; extern consvar_t cv_rumble[MAXSPLITSCREENPLAYERS]; extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS]; -extern consvar_t cv_ledpowerup[MAXSPLITSCREENPLAYERS]; extern INT32 mousex, mousey; extern INT32 mlooky; //mousey with mlookSensitivity diff --git a/src/m_menu.c b/src/m_menu.c index b8198b650..8dadbdd98 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1290,8 +1290,7 @@ static menuitem_t OP_Joystick1Menu[] = {IT_HEADER, NULL, "Miscellaneous", NULL, 112}, {IT_STRING | IT_CVAR, NULL, "Controller Rumble" , &cv_rumble[0] , 120}, - {IT_STRING | IT_CVAR, NULL, "Set LED to skin color" , &cv_gamepadled[0] , 125}, - {IT_STRING | IT_CVAR, NULL, "Flash LED on powerups" , &cv_ledpowerup[0] , 130}, + {IT_STRING | IT_CVAR, NULL, "Set LED to Player color", &cv_gamepadled[0] , 125}, }; static menuitem_t OP_Joystick2Menu[] = @@ -1321,8 +1320,7 @@ static menuitem_t OP_Joystick2Menu[] = {IT_HEADER, NULL, "Miscellaneous", NULL, 112}, {IT_STRING | IT_CVAR, NULL, "Controller Rumble" , &cv_rumble[1] , 120}, - {IT_STRING | IT_CVAR, NULL, "Set LED to skin color" , &cv_gamepadled[1] , 125}, - {IT_STRING | IT_CVAR, NULL, "Flash LED on powerups" , &cv_ledpowerup[1] , 130}, + {IT_STRING | IT_CVAR, NULL, "Set LED to Player color", &cv_gamepadled[1] , 125}, }; static menuitem_t OP_Joystick3Menu[] = @@ -1352,8 +1350,7 @@ static menuitem_t OP_Joystick3Menu[] = {IT_HEADER, NULL, "Miscellaneous", NULL, 112}, {IT_STRING | IT_CVAR, NULL, "Controller Rumble" , &cv_rumble[2] , 120}, - {IT_STRING | IT_CVAR, NULL, "Set LED to skin color" , &cv_gamepadled[2] , 125}, - {IT_STRING | IT_CVAR, NULL, "Flash LED on powerups" , &cv_ledpowerup[2] , 130}, + {IT_STRING | IT_CVAR, NULL, "Set LED to Player color", &cv_gamepadled[2] , 125}, }; static menuitem_t OP_Joystick4Menu[] = @@ -1383,8 +1380,7 @@ static menuitem_t OP_Joystick4Menu[] = {IT_HEADER, NULL, "Miscellaneous", NULL, 112}, {IT_STRING | IT_CVAR, NULL, "Controller Rumble" , &cv_rumble[3] , 120}, - {IT_STRING | IT_CVAR, NULL, "Set LED to skin color" , &cv_gamepadled[3] , 125}, - {IT_STRING | IT_CVAR, NULL, "Flash LED on powerups" , &cv_ledpowerup[3] , 130}, + {IT_STRING | IT_CVAR, NULL, "Set LED to Player color", &cv_gamepadled[3] , 125}, }; static menuitem_t OP_JoystickSetMenu[] = @@ -3178,10 +3174,10 @@ menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDe //WTF menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_ControlsDef, 60, 30); menu_t OP_AllControlsDef = CONTROLMENUSTYLE(OP_AllControlsMenu, &OP_ControlsDef); -menu_t OP_Joystick1Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_AllControlsDef, 60, 36); -menu_t OP_Joystick2Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_AllControlsDef, 60, 36); -menu_t OP_Joystick3Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_AllControlsDef, 60, 36); -menu_t OP_Joystick4Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_AllControlsDef, 60, 36); +menu_t OP_Joystick1Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_AllControlsDef, 30, 36); +menu_t OP_Joystick2Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_AllControlsDef, 30, 36); +menu_t OP_Joystick3Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_AllControlsDef, 30, 36); +menu_t OP_Joystick4Def = DEFAULTSCROLLSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_AllControlsDef, 30, 36); menu_t OP_JoystickSetDef = { "M_CONTRO", From f0579de24499904a3a14580ef1d3c6abdc97fbc4 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 15 May 2025 01:24:36 +0200 Subject: [PATCH 05/11] HWR_UsePortals --- src/hardware/hw_main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index ea5b9f522..0c1d13379 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2166,6 +2166,11 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom //Hurdler: end of 3d-floors test } +static inline boolean HWR_UsePortals(void) +{ + return cv_glportals.value && gl_maphasportals; +} + // From PrBoom: // // e6y: Check whether the player can look beyond this line, returns true if we can't @@ -2226,7 +2231,8 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector) } // using this check with portals causes weird culling issues on ante-station - if (LIKELY(!portalclipline) && (afrontsector == viewsector || abacksector == viewsector)) + if (LIKELY(!portalclipline) && + (afrontsector == viewsector || abacksector == viewsector)) { fixed_t viewf1, viewf2, viewc1, viewc2; if (afrontsector == viewsector) @@ -2292,7 +2298,8 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector) // Window. // We know it's a window when the above isn't true and the back and front sectors don't match - if (backc1 != frontc1 || backc2 != frontc2 || backf1 != frontf1 || backf2 != frontf2) + if (backc1 != frontc1 || backc2 != frontc2 + || backf1 != frontf1 || backf2 != frontf2) { checkforemptylines = false; return false; @@ -2359,7 +2366,7 @@ static void HWR_AddLine(seg_t *line) gl_backsector = line->backsector; - if (!cv_glportals.value || LIKELY(!gl_maphasportals)) + if (LIKELY(!HWR_UsePortals())) { doaddline: if (!line->backsector) @@ -5408,7 +5415,7 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *pl gl_portallist_t portallist; const boolean skybox = (skyboxmo[0] && cv_skybox.value); - const boolean useportals = cv_glportals.value && gl_maphasportals && allow_portals; + const boolean useportals = HWR_UsePortals() && allow_portals; bspfunc bspFunc = (useportals && portalclipline) ? HWR_RenderPortalBSPNode : HWR_RenderBSPNode; portallist.base = portallist.cap = NULL; From b1baa90b19f0bea43860a720f7d5bbc7ba290ddd Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 15 May 2025 01:26:04 +0200 Subject: [PATCH 06/11] move paletterender walllight stuff into HWR_CalcWallLight just slightly cleaner --- src/hardware/hw_main.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 0c1d13379..af2074977 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -481,11 +481,11 @@ static UINT8 HWR_FogBlockAlpha(INT32 light, extracolormap_t *colormap) // Let's return surfcolor.s.alpha; } -static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg) +static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg, extracolormap_t *colormap) { INT16 finallight = lightnum; - if (cv_glfakecontrast.value == 0) + if (cv_glfakecontrast.value == 0 || (HWR_ShouldUsePaletteRendering() && colormap)) return (FUINT)finallight; if (seg != NULL && P_ApplyLightOffsetFine(lightnum, seg->frontsector)) @@ -698,8 +698,7 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool for (i = 0, v3d = planeVerts; i < (INT32)nrPlaneVerts; i++,v3d++,pv++) SETUP3DVERT(v3d, pv->x, pv->y); - if (slope) - lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL)); + lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL)); HWR_Lighting(&Surf, lightlevel, planecolormap, P_SectorUsesDirectionalLighting(gl_frontsector)); @@ -1008,7 +1007,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, fixed_t v2y = FloatToFixed(wallVerts[1].z); const UINT8 alpha = Surf->PolyColor.s.alpha; - FUINT lightnum = HWR_CalcWallLight(sector->lightlevel, gl_curline); + FUINT lightnum = HWR_CalcWallLight(sector->lightlevel, gl_curline, NULL); extracolormap_t *colormap = NULL; realtop = top = wallVerts[3].y; @@ -1051,14 +1050,14 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, { lightnum = pfloor->master->frontsector->lightlevel; colormap = pfloor->master->frontsector->extra_colormap; - lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline); } else { lightnum = *list[i].lightlevel; colormap = list[i].extra_colormap; - lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline); } + + lightnum = HWR_CalcWallLight(lightnum, gl_curline, colormap); } boolean solid = false; @@ -1388,7 +1387,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom FUINT lightnum = gl_frontsector->lightlevel; extracolormap_t *colormap = gl_frontsector->extra_colormap; - lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline); + lightnum = HWR_CalcWallLight(lightnum, gl_curline, colormap); FSurfaceInfo Surf; @@ -2015,7 +2014,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(lightnum, colormap); - lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline); + lightnum = HWR_CalcWallLight(lightnum, gl_curline, colormap); if (gl_frontsector->numlights) HWR_SplitWall(gl_frontsector, wallVerts, 0, false, &Surf, roverflags, rover, blendmode); @@ -2132,7 +2131,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(lightnum, colormap); - lightnum = (HWR_ShouldUsePaletteRendering() && colormap) ? lightnum : HWR_CalcWallLight(lightnum, gl_curline); + lightnum = HWR_CalcWallLight(lightnum, gl_curline, colormap); if (gl_backsector->numlights) HWR_SplitWall(gl_backsector, wallVerts, 0, false, &Surf, roverflags, rover, blendmode); From 5f40ff5a0349fa97c9cc25dc10d89c4155935460 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 15 May 2025 01:23:44 +0200 Subject: [PATCH 07/11] those appear to do nothing free performance ig? --- src/hardware/hw_main.c | 5 ----- src/r_bsp.c | 3 --- 2 files changed, 8 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index af2074977..1828b5f60 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2315,9 +2315,6 @@ static void HWR_AddLine(seg_t *line) { angle_t angle1, angle2; - // SoM: Backsector needs to be run through R_FakeFlat - static sector_t tempsec; - fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t boolean dont_draw = false; @@ -2374,8 +2371,6 @@ doaddline: } else { - gl_backsector = R_FakeFlat(gl_backsector, &tempsec, NULL, NULL, true); - if (CheckClip(gl_frontsector, gl_backsector)) { gld_clipper_SafeAddClipRange(angle2, angle1); diff --git a/src/r_bsp.c b/src/r_bsp.c index 427a6367c..bc8c124ee 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -388,7 +388,6 @@ static void R_AddLine(seg_t *line) { INT32 x1, x2; angle_t angle1, angle2, span, tspan; - static sector_t tempsec; g_portal = NULL; @@ -472,8 +471,6 @@ static void R_AddLine(seg_t *line) if (!backsector) goto clipsolid; - backsector = R_FakeFlat(backsector, &tempsec, NULL, NULL, true); - doorclosed = 0; fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends From 1ed76de58a267d924c8dde0d333cbff887e60606 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 15 May 2025 04:12:40 +0200 Subject: [PATCH 08/11] macrofy redundant splitscreen menus joystick and camera menus to be specific --- src/m_menu.c | 229 +++++++++++++-------------------------------------- 1 file changed, 58 insertions(+), 171 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 8dadbdd98..4e951261a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1263,149 +1263,74 @@ static menuitem_t OP_AllControlsMenu[] = {IT_CONTROL, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 }, }; +#define OP_JOYMENU(pnum) \ + {IT_HEADER, NULL, "Gameplay Controls", NULL, 7}, \ + {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis[pnum] , 15}, \ + {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis[pnum] , 20}, \ + {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis[pnum] , 25}, \ + {IT_STRING | IT_CVAR, NULL, "Brake" , &cv_brakeaxis[pnum] , 30}, \ + {IT_STRING | IT_CVAR, NULL, "Drift" , &cv_driftaxis[pnum] , 35}, \ + {IT_STRING | IT_CVAR, NULL, "Use Item" , &cv_fireaxis[pnum] , 40}, \ + {IT_STRING | IT_CVAR, NULL, "Look Backward" , &cv_lookbackaxis[pnum] , 45}, \ + {IT_STRING | IT_CVAR, NULL, "Custom Button 1" , &cv_custom1axis[pnum] , 50}, \ + {IT_STRING | IT_CVAR, NULL, "Custom Button 2" , &cv_custom2axis[pnum] , 55}, \ + {IT_STRING | IT_CVAR, NULL, "Custom Button 3" , &cv_custom3axis[pnum] , 60}, \ + {IT_HEADER, NULL, "Camera Controls", NULL, 67}, \ + {IT_STRING | IT_CVAR, NULL, "Look Up/Down" , &cv_lookaxis[pnum] , 75}, \ + {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_camturnaxis[pnum] , 80}, \ + {IT_STRING | IT_CVAR, NULL, "Strafe Left/Right" , &cv_camstrafeaxis[pnum] , 85}, \ + {IT_HEADER, NULL, "Deadzones", NULL, 92}, \ + {IT_STRING | IT_CVAR, NULL, "X deadzone" , &cv_xdeadzone[pnum] , 100}, \ + {IT_STRING | IT_CVAR, NULL, "Y deadzone" , &cv_ydeadzone[pnum] , 105}, \ + {IT_HEADER, NULL, "Miscellaneous", NULL, 112}, \ + {IT_STRING | IT_CVAR, NULL, "Controller Rumble" , &cv_rumble[pnum] , 120}, \ + {IT_STRING | IT_CVAR, NULL, "Set LED to Player color", &cv_gamepadled[pnum] , 125}, + static menuitem_t OP_Joystick1Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup1PJoystickMenu , 0}, - - {IT_HEADER, NULL, "Gameplay Controls", NULL, 7}, - {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis[0] , 15}, - {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis[0] , 20}, - {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis[0] , 25}, - {IT_STRING | IT_CVAR, NULL, "Brake" , &cv_brakeaxis[0] , 30}, - {IT_STRING | IT_CVAR, NULL, "Drift" , &cv_driftaxis[0] , 35}, - {IT_STRING | IT_CVAR, NULL, "Use Item" , &cv_fireaxis[0] , 40}, - {IT_STRING | IT_CVAR, NULL, "Look Backward" , &cv_lookbackaxis[0] , 45}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 1" , &cv_custom1axis[0] , 50}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 2" , &cv_custom2axis[0] , 55}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 3" , &cv_custom3axis[0] , 60}, - - {IT_HEADER, NULL, "Camera Controls", NULL, 67}, - {IT_STRING | IT_CVAR, NULL, "Look Up/Down" , &cv_lookaxis[0] , 75}, - {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_camturnaxis[0] , 80}, - {IT_STRING | IT_CVAR, NULL, "Strafe Left/Right" , &cv_camstrafeaxis[0] , 85}, - - {IT_HEADER, NULL, "Deadzones", NULL, 92}, - {IT_STRING | IT_CVAR, NULL, "X deadzone" , &cv_xdeadzone[0] , 100}, - {IT_STRING | IT_CVAR, NULL, "Y deadzone" , &cv_ydeadzone[0] , 105}, - - {IT_HEADER, NULL, "Miscellaneous", NULL, 112}, - {IT_STRING | IT_CVAR, NULL, "Controller Rumble" , &cv_rumble[0] , 120}, - {IT_STRING | IT_CVAR, NULL, "Set LED to Player color", &cv_gamepadled[0] , 125}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad...", M_Setup1PJoystickMenu, 0}, + OP_JOYMENU(0) }; static menuitem_t OP_Joystick2Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup2PJoystickMenu , 10}, - - {IT_HEADER, NULL, "Gameplay Controls", NULL, 7}, - {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis[1] , 15}, - {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis[1] , 20}, - {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis[1] , 25}, - {IT_STRING | IT_CVAR, NULL, "Brake" , &cv_brakeaxis[1] , 30}, - {IT_STRING | IT_CVAR, NULL, "Drift" , &cv_driftaxis[1] , 35}, - {IT_STRING | IT_CVAR, NULL, "Use Item" , &cv_fireaxis[1] , 40}, - {IT_STRING | IT_CVAR, NULL, "Look Backward" , &cv_lookbackaxis[1] , 45}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 1" , &cv_custom1axis[1] , 50}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 2" , &cv_custom2axis[1] , 55}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 3" , &cv_custom3axis[1] , 60}, - - {IT_HEADER, NULL, "Camera Controls", NULL, 67}, - {IT_STRING | IT_CVAR, NULL, "Look Up/Down" , &cv_lookaxis[1] , 75}, - {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_camturnaxis[1] , 80}, - {IT_STRING | IT_CVAR, NULL, "Strafe Left/Right" , &cv_camstrafeaxis[1] , 85}, - - {IT_HEADER, NULL, "Deadzones", NULL, 92}, - {IT_STRING | IT_CVAR, NULL, "X deadzone" , &cv_xdeadzone[1] , 100}, - {IT_STRING | IT_CVAR, NULL, "Y deadzone" , &cv_ydeadzone[1] , 105}, - - {IT_HEADER, NULL, "Miscellaneous", NULL, 112}, - {IT_STRING | IT_CVAR, NULL, "Controller Rumble" , &cv_rumble[1] , 120}, - {IT_STRING | IT_CVAR, NULL, "Set LED to Player color", &cv_gamepadled[1] , 125}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad...", M_Setup2PJoystickMenu, 0}, + OP_JOYMENU(1) }; static menuitem_t OP_Joystick3Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup3PJoystickMenu , 10}, - - {IT_HEADER, NULL, "Gameplay Controls", NULL, 7}, - {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis[2] , 15}, - {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis[2] , 20}, - {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis[2] , 25}, - {IT_STRING | IT_CVAR, NULL, "Brake" , &cv_brakeaxis[2] , 30}, - {IT_STRING | IT_CVAR, NULL, "Drift" , &cv_driftaxis[2] , 35}, - {IT_STRING | IT_CVAR, NULL, "Use Item" , &cv_fireaxis[2] , 40}, - {IT_STRING | IT_CVAR, NULL, "Look Backward" , &cv_lookbackaxis[2] , 45}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 1" , &cv_custom1axis[2] , 50}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 2" , &cv_custom2axis[2] , 55}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 3" , &cv_custom3axis[2] , 60}, - - {IT_HEADER, NULL, "Camera Controls", NULL, 67}, - {IT_STRING | IT_CVAR, NULL, "Look Up/Down" , &cv_lookaxis[2] , 75}, - {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_camturnaxis[2] , 80}, - {IT_STRING | IT_CVAR, NULL, "Strafe Left/Right" , &cv_camstrafeaxis[2] , 85}, - - {IT_HEADER, NULL, "Deadzones", NULL, 92}, - {IT_STRING | IT_CVAR, NULL, "X deadzone" , &cv_xdeadzone[2] , 100}, - {IT_STRING | IT_CVAR, NULL, "Y deadzone" , &cv_ydeadzone[2] , 105}, - - {IT_HEADER, NULL, "Miscellaneous", NULL, 112}, - {IT_STRING | IT_CVAR, NULL, "Controller Rumble" , &cv_rumble[2] , 120}, - {IT_STRING | IT_CVAR, NULL, "Set LED to Player color", &cv_gamepadled[2] , 125}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad...", M_Setup3PJoystickMenu, 0}, + OP_JOYMENU(2) }; static menuitem_t OP_Joystick4Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup4PJoystickMenu , 10}, - - {IT_HEADER, NULL, "Gameplay Controls", NULL, 7}, - {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis[3] , 15}, - {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis[3] , 20}, - {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis[3] , 25}, - {IT_STRING | IT_CVAR, NULL, "Brake" , &cv_brakeaxis[3] , 30}, - {IT_STRING | IT_CVAR, NULL, "Drift" , &cv_driftaxis[3] , 35}, - {IT_STRING | IT_CVAR, NULL, "Use Item" , &cv_fireaxis[3] , 40}, - {IT_STRING | IT_CVAR, NULL, "Look Backward" , &cv_lookbackaxis[3] , 45}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 1" , &cv_custom1axis[3] , 50}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 2" , &cv_custom2axis[3] , 55}, - {IT_STRING | IT_CVAR, NULL, "Custom Button 3" , &cv_custom3axis[3] , 60}, - - {IT_HEADER, NULL, "Camera Controls", NULL, 67}, - {IT_STRING | IT_CVAR, NULL, "Look Up/Down" , &cv_lookaxis[3] , 75}, - {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_camturnaxis[3] , 80}, - {IT_STRING | IT_CVAR, NULL, "Strafe Left/Right" , &cv_camstrafeaxis[3] , 85}, - - {IT_HEADER, NULL, "Deadzones", NULL, 92}, - {IT_STRING | IT_CVAR, NULL, "X deadzone" , &cv_xdeadzone[3] , 100}, - {IT_STRING | IT_CVAR, NULL, "Y deadzone" , &cv_ydeadzone[3] , 105}, - - {IT_HEADER, NULL, "Miscellaneous", NULL, 112}, - {IT_STRING | IT_CVAR, NULL, "Controller Rumble" , &cv_rumble[3] , 120}, - {IT_STRING | IT_CVAR, NULL, "Set LED to Player color", &cv_gamepadled[3] , 125}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad...", M_Setup4PJoystickMenu, 0}, + OP_JOYMENU(3) }; static menuitem_t OP_JoystickSetMenu[] = { - {IT_CALL | IT_NOTHING, "None", NULL, M_AssignJoystick, LINEHEIGHT+5}, - {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*2)+5}, - {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*3)+5}, - {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*4)+5}, - {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*5)+5}, - {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*6)+5}, - {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*7)+5}, - {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*8)+5}, + {IT_CALL | IT_NOTHING, "None", NULL, M_AssignJoystick, LINEHEIGHT+5}, + {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*2)+5}, + {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*3)+5}, + {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*4)+5}, + {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*5)+5}, + {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*6)+5}, + {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*7)+5}, + {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*8)+5}, }; //WTF static menuitem_t OP_MouseOptionsMenu[] = { - {IT_STRING | IT_CVAR, NULL, "Use Mouse", &cv_usemouse, 10}, + {IT_STRING | IT_CVAR, NULL, "Use Mouse", &cv_usemouse, 10}, - {IT_STRING | IT_CVAR, NULL, "Mouse Turning", &cv_mouseturn, 20}, - {IT_STRING | IT_CVAR, NULL, "Invert Mouse", &cv_invertmouse, 30}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Mouse X Speed", &cv_mousesens, 40}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Mouse Y Speed", &cv_mouseysens, 50}, + {IT_STRING | IT_CVAR, NULL, "Mouse Turning", &cv_mouseturn, 20}, + {IT_STRING | IT_CVAR, NULL, "Invert Mouse", &cv_invertmouse, 30}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Mouse X Speed", &cv_mousesens, 40}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Mouse Y Speed", &cv_mouseysens, 50}, }; static const char* OP_MouseTooltips[] = @@ -1946,76 +1871,38 @@ static const char* OP_CamOptionsTooltips[] = NULL, }; +#define OP_CAMMENU(pnum) \ +{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[pnum], 30}, \ +{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[pnum], 50}, \ +{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[pnum], 60}, \ +{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[pnum], 70}, \ +{IT_STRING | IT_CVAR, NULL, "Camera Lookback Momentum", &cv_lookbackmom[pnum], 90}, \ +{IT_STRING | IT_CVAR, NULL, "Camera Vertical Look", &cv_verticallook[pnum], 100}, \ +{IT_STRING | IT_CVAR, NULL, "Freecam Speed", &cv_freecam_speed[pnum], 120}, \ +{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[pnum], 135}, \ + static menuitem_t OP_Player1CamOptionsMenu[] = { {IT_HEADER, NULL, "Player 1 Camera Options", NULL, 0}, - - {IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[0], 30}, - {IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[0], 50}, - {IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[0], 60}, - {IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[0], 70}, - - {IT_STRING | IT_CVAR, NULL, "Camera Lookback Momentum", &cv_lookbackmom[0], 90}, - - {IT_STRING | IT_CVAR, NULL, "Camera Vertical Look", &cv_verticallook[0], 100}, - - {IT_STRING | IT_CVAR, NULL, "Freecam Speed", &cv_freecam_speed[0], 120}, - - {IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[0], 135}, + OP_CAMMENU(0) }; static menuitem_t OP_Player2CamOptionsMenu[] = { {IT_HEADER, NULL, "Player 2 Camera Options", NULL, 0}, - - {IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[1], 30}, - {IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[1], 50}, - {IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[1], 60}, - {IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[1], 70}, - - {IT_STRING | IT_CVAR, NULL, "Camera Lookback Momentum", &cv_lookbackmom[1], 90}, - - {IT_STRING | IT_CVAR, NULL, "Camera Vertical Look", &cv_verticallook[1], 100}, - - {IT_STRING | IT_CVAR, NULL, "Freecam Speed", &cv_freecam_speed[1], 120}, - - {IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[1], 135}, + OP_CAMMENU(1) }; static menuitem_t OP_Player3CamOptionsMenu[] = { {IT_HEADER, NULL, "Player 3 Camera Options", NULL, 0}, - - {IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[2], 30}, - {IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[2], 50}, - {IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[2], 60}, - {IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[2], 70}, - - {IT_STRING | IT_CVAR, NULL, "Camera Lookback Momentum", &cv_lookbackmom[2], 90}, - - {IT_STRING | IT_CVAR, NULL, "Camera Vertical Look", &cv_verticallook[2], 100}, - - {IT_STRING | IT_CVAR, NULL, "Freecam Speed", &cv_freecam_speed[2], 120}, - - {IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[2], 135}, + OP_CAMMENU(2) }; static menuitem_t OP_Player4CamOptionsMenu[] = { {IT_HEADER, NULL, "Player 4 Camera Options", NULL, 0}, - - {IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[3], 30}, - {IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[3], 50}, - {IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[3], 60}, - {IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[3], 70}, - - {IT_STRING | IT_CVAR, NULL, "Camera Lookback Momentum", &cv_lookbackmom[3], 90}, - - {IT_STRING | IT_CVAR, NULL, "Camera Vertical Look", &cv_verticallook[3], 100}, - - {IT_STRING | IT_CVAR, NULL, "Freecam Speed", &cv_freecam_speed[3], 120}, - - {IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[3], 135}, + OP_CAMMENU(3) }; static const char* OP_PlayerCamOptionsTooltips[] = From 03c624a77bf68ee908c115c450753c9fab13381b Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 15 May 2025 21:40:48 +0200 Subject: [PATCH 09/11] make addon warning not print "(null)" if there is no refreshdirname kinda lazy way but shrug --- src/m_menu.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 4e951261a..8f74dc018 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6239,25 +6239,41 @@ static boolean M_AddonsRefresh(void) { S_StartSound(NULL, sfx_s26d); if (refreshdirmenu & REFRESHDIR_MAX) - message = va("%c%s\x80\nMaximum number of addons reached.\nA file could not be loaded.\nIf you wish to play with this addon, restart the game to clear existing ones.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname); + { + if (refreshdirname) + message = va("%c%s\x80\nMaximum number of addons reached.\nA file could not be loaded.\nIf you wish to play with this addon, restart the game to clear existing ones.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname); + else + message = va("%c\x80 Maximum number of addons reached.\nA file could not be loaded.\nIf you wish to play with this addon, restart the game to clear existing ones.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT))); + } else - message = va("%c%s\x80\nA file was not loaded.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname); + { + if (refreshdirname) + message = va("%c%s\x80\nA file was not loaded.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname); + else + message = va("%c\x80 A file was not loaded.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT))); + } } else if (refreshdirmenu & (REFRESHDIR_WARNING | REFRESHDIR_ERROR)) { S_StartSound(NULL, sfx_s224); - message = va("%c%s\x80\nA file was loaded with %s.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname, ((refreshdirmenu & REFRESHDIR_ERROR) ? "errors" : "warnings")); + if (refreshdirname) + message = va("%c%s\x80\nA file was loaded with %s.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname, ((refreshdirmenu & REFRESHDIR_ERROR) ? "errors" : "warnings")); + else + message = va("%c\x80 A file was loaded with %s.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), ((refreshdirmenu & REFRESHDIR_ERROR) ? "errors" : "warnings")); } else if (majormods && !prevmajormods) { S_StartSound(NULL, sfx_s221); - message = va("%c%s\x80\nYou've loaded a gameplay-modifying addon.\n\nRecord Attack data will be saved to a seperate save file.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname); + if (refreshdirname) + message = va("%c%s\x80\nYou've loaded a gameplay-modifying addon.\n\nRecord Attack data will be saved to a seperate save file.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname); + else + message = va("%c\x80 You've loaded a gameplay-modifying addon.\n\nRecord Attack data will be saved to a seperate save file.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT))); prevmajormods = majormods; } if (message) { - M_StartMessage(message,M_AddonsClearName,MM_EVENTHANDLER); + M_StartMessage(message, M_AddonsClearName, MM_EVENTHANDLER); return true; } From 224e3b25e5127c9a563c7d75d34250783d36c3c1 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 16 May 2025 01:30:28 +0200 Subject: [PATCH 10/11] Revert "those appear to do nothing" This reverts commit 5f40ff5a0349fa97c9cc25dc10d89c4155935460. --- src/hardware/hw_main.c | 5 +++++ src/r_bsp.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 1828b5f60..af2074977 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2315,6 +2315,9 @@ static void HWR_AddLine(seg_t *line) { angle_t angle1, angle2; + // SoM: Backsector needs to be run through R_FakeFlat + static sector_t tempsec; + fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t boolean dont_draw = false; @@ -2371,6 +2374,8 @@ doaddline: } else { + gl_backsector = R_FakeFlat(gl_backsector, &tempsec, NULL, NULL, true); + if (CheckClip(gl_frontsector, gl_backsector)) { gld_clipper_SafeAddClipRange(angle2, angle1); diff --git a/src/r_bsp.c b/src/r_bsp.c index bc8c124ee..427a6367c 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -388,6 +388,7 @@ static void R_AddLine(seg_t *line) { INT32 x1, x2; angle_t angle1, angle2, span, tspan; + static sector_t tempsec; g_portal = NULL; @@ -471,6 +472,8 @@ static void R_AddLine(seg_t *line) if (!backsector) goto clipsolid; + backsector = R_FakeFlat(backsector, &tempsec, NULL, NULL, true); + doorclosed = 0; fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends From 03264e760ffeab86ccb8d59b3773f473af74db25 Mon Sep 17 00:00:00 2001 From: Indev Date: Fri, 16 May 2025 13:36:05 +0300 Subject: [PATCH 11/11] Allow music credit to be drawn in intermission and main menu --- src/d_main.c | 1 + src/g_game.c | 1 + src/hu_stuff.c | 9 +++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index fd92739b9..4f76b6858 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -472,6 +472,7 @@ static boolean D_Display(void) F_TitleScreenDrawer(); if (wipe) wipedefindex = wipe_titlescreen_toblack; + HU_Drawer(); break; case GS_WAITINGPLAYERS: diff --git a/src/g_game.c b/src/g_game.c index 17feba6e3..36f723b93 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1954,6 +1954,7 @@ void G_Ticker(boolean run) case GS_TITLESCREEN: F_TitleScreenTicker(run); + HU_Ticker(); break; case GS_WAITINGPLAYERS: if (netgame) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 339722661..0ad7fcb82 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2203,9 +2203,14 @@ void HU_Drawer(void) if (cechotimer) HU_DrawCEcho(); + // draw song credits + if (cv_songcredits.value) + HU_DrawSongCredits(); + if (!( Playing() || demo.playback ) || gamestate == GS_INTERMISSION || gamestate == GS_CUTSCENE || gamestate == GS_CREDITS || gamestate == GS_EVALUATION + || gamestate == GS_TITLESCREEN || gamestate == GS_GAMEEND || gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS) // SRB2kart return; @@ -2236,10 +2241,6 @@ void HU_Drawer(void) if (gamestate != GS_LEVEL) return; - // draw song credits - if (cv_songcredits.value) - HU_DrawSongCredits(); - // draw desynch text if (hu_resynching #ifdef SATURNPAK