From 088c250a19847bc4784dac03f40b8121fae58bdf Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 9 Jan 2024 13:38:24 +0100 Subject: [PATCH 01/10] use og values for pal --- src/hardware/r_opengl/r_opengl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 8d076e4ba..b85ea5777 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -710,8 +710,7 @@ static float shader_leveltime = 0; "float lightz = clamp(z / 16.0, 0.0, 127.0);\n" \ "float startmap = (15.0 - lightnum) * 4.0;\n" \ "float scale = 160.0 / (lightz + 1.0);\n" \ - "float cap = (155.0 - light) * 0.26;\n" \ - "return max(startmap * STARTMAP_FUDGE - scale * 0.5 * SCALE_FUDGE, cap);\n" \ + "return (startmap * STARTMAP_FUDGE - scale * MULT_FUDGE * SCALE_FUDGE);\n" \ "}\n" #define GLSL_DOOM_LIGHT_EQUATION \ @@ -763,11 +762,13 @@ static float shader_leveltime = 0; #define GLSL_FLOOR_FUDGES \ "#define STARTMAP_FUDGE 1.06\n" \ + "#define MULT_FUDGE 0.5\n" \ "#define SCALE_FUDGE 1.15\n" #define GLSL_WALL_FUDGES \ "#define STARTMAP_FUDGE 1.05\n" \ - "#define SCALE_FUDGE 2.2\n" + "#define MULT_FUDGE 1.0\n" \ + "#define SCALE_FUDGE 1.1\n" #define GLSL_SOFTWARE_FRAGMENT_SHADER_FLOORS \ GLSL_SOFTWARE_UNIFORMS \ @@ -920,7 +921,7 @@ static float shader_leveltime = 0; "uniform int palette[768];\n" \ "void main(void) {\n" \ "vec3 texel = vec3(texture2D(tex, gl_TexCoord[0].st));\n" \ - "int pal_idx = int(texture3D(lookup_tex, vec3((texel * 63.0 + 0.5) / 64.0))[0] * 255.0);\n" \ + "int pal_idx = int(texture3D(lookup_tex, vec3((63.0/64.0) * texel + 1.0 / 128.0))[0] * 255.0);\n" \ "gl_FragColor = vec4(float(palette[pal_idx*3])/255.0, float(palette[pal_idx*3+1])/255.0, float(palette[pal_idx*3+2])/255.0, 1.0);\n" \ "}\0" From 69ffee271de16d2395b827d18f108fdcf9e4d0ae Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 9 Jan 2024 14:19:36 +0100 Subject: [PATCH 02/10] fix some things --- src/m_menu.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 7210521d8..33f77964e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1361,27 +1361,27 @@ static menuitem_t OP_VideoOptionsMenu[] = NULL, "Brightness", &cv_globalgamma, 30}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Saturation", &cv_globalsaturation , 35}, + NULL, "Saturation", &cv_globalsaturation , 40}, - {IT_SUBMENU|IT_STRING, NULL, "Advanced Color Settings...", &OP_ColorOptionsDef, 40}, + {IT_SUBMENU|IT_STRING, NULL, "Advanced Color Settings...", &OP_ColorOptionsDef, 50}, - {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 45}, + {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 65}, //{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 55}, - {IT_STRING | IT_CVAR, NULL, "Weather Draw Distance",&cv_drawdist_precip, 55}, + {IT_STRING | IT_CVAR, NULL, "Weather Draw Distance",&cv_drawdist_precip, 75}, //{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 65}, - {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 65}, - {IT_STRING | IT_CVAR, NULL, "Field of View", &cv_fov, 75}, + {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 85}, + {IT_STRING | IT_CVAR, NULL, "Field of View", &cv_fov, 95}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 90}, - {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 100}, - {IT_STRING | IT_CVAR, NULL, "FPS Cap", &cv_fpscap, 110}, - {IT_STRING | IT_CVAR, NULL, "Drift spark pulse size",&cv_driftsparkpulse, 120}, - {IT_STRING | IT_CVAR, NULL, "Uppercase Menu", &cv_menucaps, 130}, + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 105}, + {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 115}, + {IT_STRING | IT_CVAR, NULL, "FPS Cap", &cv_fpscap, 125}, + {IT_STRING | IT_CVAR, NULL, "Drift spark pulse size",&cv_driftsparkpulse, 135}, + {IT_STRING | IT_CVAR, NULL, "Uppercase Menu", &cv_menucaps, 145}, #ifdef HWRENDER - {IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 140}, + {IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 155}, #endif - {IT_SUBMENU|IT_STRING, NULL, "Experimental Options...", &OP_ExpOptionsDef, 150}, + {IT_SUBMENU|IT_STRING, NULL, "Experimental Options...", &OP_ExpOptionsDef, 165}, }; @@ -2828,7 +2828,8 @@ menu_t OP_ColorOptionsDef = M_DrawColorMenu, 30, 30, 0, - NULL + NULL, + {NULL} }; menu_t OP_SoundOptionsDef = From 4881471a6ab52da7a134061bba214c5637babd75 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 9 Jan 2024 14:27:05 +0100 Subject: [PATCH 03/10] just show text instead of miscoloured boxes --- src/m_menu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 33f77964e..c97757a12 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -13994,9 +13994,9 @@ static void M_DrawColorMenu(void) V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); break; case IT_HEADERTEXT: - //V_DrawString(x-16, y, V_YELLOWMAP, currentMenu->menuitems[i].text); - V_DrawFill(19, y, 281, 9, currentMenu->menuitems[i+1].alphaKey); - V_DrawFill(300, y, 1, 9, 26); + V_DrawString(x-16, y, V_YELLOWMAP, currentMenu->menuitems[i].text); + //V_DrawFill(19, y, 281, 9, currentMenu->menuitems[i+1].alphaKey); + //V_DrawFill(300, y, 1, 9, 26); //M_DrawLevelPlatterHeader(y - (lsheadingheight - 12), currentMenu->menuitems[i].text, false); break; } From 9c6f720f11c8c78c72ec742c05cb22536d79a4e5 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 14 Jan 2024 14:14:54 +0100 Subject: [PATCH 04/10] Revert "change this" This reverts commit 25bc55730e1674ab4178a452685ca54ea3d0f84d. --- src/hardware/hw_main.c | 2 -- src/hardware/r_opengl/r_opengl.c | 11 +++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index fcc1330b7..4a394943a 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -517,8 +517,6 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col Surface->LightTableId = colormap->gl_lighttable_id; } - else - Surface->LightTableId = 0; } void HWR_ClearLightTableCache(void) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index b85ea5777..dc2b9b322 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -76,7 +76,6 @@ static float NEAR_CLIPPING_PLANE = NZCLIP_PLANE; static GLuint tex_downloaded = 0; -static GLuint lt_downloaded = 0; // currently bound lighttable texture static GLfloat fov = 90.0f; static FBITFIELD CurrentPolyFlags; @@ -1690,7 +1689,6 @@ EXPORT void HWRAPI(ClearLightTableCache) (void) ltcachehead = next; } ltcachetail = NULL; - lt_downloaded = 0; } // -----------------+ @@ -2570,12 +2568,11 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i if (gl_allowshaders) { Shader_Load(¤tSurfaceInfo, &firstPoly, &firstTint, &firstFade); - if ((gl_palshader) && (currentSurfaceInfo.LightTableId && currentSurfaceInfo.LightTableId != lt_downloaded)) + if (gl_palshader) { pglActiveTexture(GL_TEXTURE2);// this stuff could be done better but gonna do it quick like this for now pglBindTexture(GL_TEXTURE_2D, currentSurfaceInfo.LightTableId); pglActiveTexture(GL_TEXTURE0); - lt_downloaded = currentSurfaceInfo.LightTableId; } } @@ -2833,12 +2830,11 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i Shader_Load(&nextSurfaceInfo, &poly, &tint, &fade); - if ((gl_palshader) && (nextSurfaceInfo.LightTableId && nextSurfaceInfo.LightTableId != lt_downloaded)) + if (gl_palshader) { pglActiveTexture(GL_TEXTURE2);// this stuff could be done better but gonna do it quick like this for now pglBindTexture(GL_TEXTURE_2D, nextSurfaceInfo.LightTableId); pglActiveTexture(GL_TEXTURE0); - lt_downloaded = nextSurfaceInfo.LightTableId; } } @@ -2945,12 +2941,11 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI fade.alpha = byte2float[pSurf->FadeColor.s.alpha]; } - if ((gl_palshader && gl_allowshaders) && (pSurf->LightTableId && pSurf->LightTableId != lt_downloaded)) + if (gl_palshader && gl_allowshaders) { pglActiveTexture(GL_TEXTURE2); pglBindTexture(GL_TEXTURE_2D, pSurf->LightTableId); pglActiveTexture(GL_TEXTURE0); - lt_downloaded = pSurf->LightTableId; } } From 6346ac0a9617ce8d4ca0ed598fa606b7f20da5d2 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 16 Jan 2024 07:11:43 +0100 Subject: [PATCH 05/10] Revert "invert encore remap is 12 not 15?" This reverts commit 8e6023d85060a82b0311a3e862b56f53d6440272. --- src/r_bsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index 8750c2ee3..2de30d2ab 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -39,7 +39,7 @@ INT32 doorclosed; boolean R_NoEncore(sector_t *sector, boolean ceiling) { - boolean invertencore = (GETSECSPECIAL(sector->special, 2) == 12); + boolean invertencore = (GETSECSPECIAL(sector->special, 2) == 15); #if 0 // perfect implementation INT32 val = GETSECSPECIAL(sector->special, 3); if (val != 1 && val != 3 // spring panel From 9a8d6efcd7f4e650b30dc17e36dda728bb87a114 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 18 Jan 2024 15:21:20 +0100 Subject: [PATCH 06/10] make thundershield follow player offset this allows the to stay on the player when saltyhopping etc. --- src/p_mobj.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index b577ac32d..bacf6fce6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8308,6 +8308,8 @@ void P_MobjThinker(mobj_t *mobj) } P_MoveOrigin(mobj, destx, desty, mobj->target->z); + mobj->spriteyoffset = mobj->target->spriteyoffset; + mobj->spritexoffset = mobj->target->spritexoffset; break; } case MT_ROCKETSNEAKER: From 1ff9bae55c730bfbe441bf8524a7fbf22f1b51e3 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 18 Jan 2024 16:49:10 +0100 Subject: [PATCH 07/10] use fudges from newer paletter shader --- src/hardware/r_opengl/r_opengl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index a3282e03f..6a17f6524 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -711,7 +711,8 @@ static float shader_leveltime = 0; "float lightz = clamp(z / 16.0, 0.0, 127.0);\n" \ "float startmap = (15.0 - lightnum) * 4.0;\n" \ "float scale = 160.0 / (lightz + 1.0);\n" \ - "return (startmap * STARTMAP_FUDGE - scale * MULT_FUDGE * SCALE_FUDGE);\n" \ + "float cap = (155.0 - light) * 0.26;\n" \ + "return max(startmap * STARTMAP_FUDGE - scale * 0.5 * SCALE_FUDGE, cap);\n" \ "}\n" #define GLSL_DOOM_LIGHT_EQUATION \ @@ -765,13 +766,11 @@ static float shader_leveltime = 0; // do those even work correctly without the preprocessor? #define GLSL_FLOOR_FUDGES \ "#define STARTMAP_FUDGE 1.06\n" \ - "#define MULT_FUDGE 0.5\n" \ "#define SCALE_FUDGE 1.15\n" #define GLSL_WALL_FUDGES \ "#define STARTMAP_FUDGE 1.05\n" \ - "#define MULT_FUDGE 1.0\n" \ - "#define SCALE_FUDGE 1.1\n" + "#define SCALE_FUDGE 2.2\n" #define GLSL_SOFTWARE_FRAGMENT_SHADER_FLOORS \ GLSL_SOFTWARE_UNIFORMS \ From d0d2a3d0a104ece3c5e25ceb0836ddb03bb54b37 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 18 Jan 2024 20:53:59 +0100 Subject: [PATCH 08/10] Add toggle for horizonlines --- src/hardware/hw_main.c | 5 ++++- src/hardware/hw_main.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index f927eb9e3..45a5e12c6 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -160,6 +160,8 @@ consvar_t cv_grspritebillboarding = {"gr_spritebillboarding", "On", CV_SAVE, CV_ consvar_t cv_grfakecontrast = {"gr_fakecontrast", "Standard", CV_SAVE, grfakecontrast_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_grslopecontrast = {"gr_slopecontrast", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_grhorizonlines = {"gr_horizonlines", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + static void CV_filtermode_ONChange(void) { @@ -837,7 +839,7 @@ void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, boolean isc HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, PolyFlags, false); - if (subsector) + if (subsector && cv_grhorizonlines.value) { // Horizon lines FOutVector horizonpts[6]; @@ -6375,6 +6377,7 @@ void HWR_AddCommands(void) CV_RegisterVar(&cv_grfakecontrast); CV_RegisterVar(&cv_grslopecontrast); + CV_RegisterVar(&cv_grhorizonlines); CV_RegisterVar(&cv_grfovchange); diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index b1c18518a..f879bdf04 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -184,6 +184,7 @@ extern consvar_t cv_grsolvetjoin; extern consvar_t cv_grspritebillboarding; extern consvar_t cv_grfakecontrast; extern consvar_t cv_grslopecontrast; +extern consvar_t cv_grhorizonlines; extern consvar_t cv_grfallbackplayermodel; extern consvar_t cv_grbatching; extern consvar_t cv_grrenderdistance; From a79a5db793830a802eaa667b78aaafa88581976c Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 19 Jan 2024 00:39:32 +0100 Subject: [PATCH 09/10] smol stuffs --- src/hardware/hw_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 45a5e12c6..b4a77cc24 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -150,7 +150,7 @@ consvar_t cv_grpaletterendering = {"gr_paletteshader", "Off", CV_CALL|CV_SAVE, C static CV_PossibleValue_t glpalettedepth_cons_t[] = {{16, "16 bits"}, {24, "24 bits"}, {0, NULL}}; consvar_t cv_grpalettedepth = {"gr_palettedepth", "16 bits", CV_SAVE|CV_CALL, glpalettedepth_cons_t, CV_grpalettedepth_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_grflashpal = {"gr_flashpal", "On", CV_CALL|CV_SAVE, CV_OnOff, CV_grshaders_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_grflashpal = {"gr_flashpal", "On", CV_CALL|CV_SAVE, CV_OnOff, CV_grpaletterendering_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_grmdls = {"gr_mdls", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_grfallbackplayermodel = {"gr_fallbackplayermodel", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -446,7 +446,7 @@ boolean HWR_ShouldUsePaletteRendering(void) boolean HWR_PalRenderFlashpal(void) { - return (cv_grpaletterendering.value && HWR_UseShader() && cv_grflashpal.value); + return (HWR_ShouldUsePaletteRendering() && cv_grflashpal.value); } void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *colormap) @@ -540,7 +540,6 @@ UINT8 HWR_FogBlockAlpha(INT32 light, extracolormap_t *colormap) // Let's see if return surfcolor.s.alpha; } - static FUINT HWR_CalcWallLight(FUINT lightnum, fixed_t v1x, fixed_t v1y, fixed_t v2x, fixed_t v2y) { INT16 finallight = lightnum; From 88b51c990161a6890d0e005645d93feae68d1a3a Mon Sep 17 00:00:00 2001 From: hayaunderscore Date: Fri, 19 Jan 2024 16:46:34 +0800 Subject: [PATCH 10/10] Fix dumb saturn credits crash --- src/m_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 9dae711ad..a74640600 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2213,8 +2213,8 @@ static menuitem_t OP_SaturnCreditsMenu[] = static const char* OP_CreditTooltips[] = { - NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, - "Thanks everyone! <3", + NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, + "Thanks everyone! <3" };