diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index 09d7b89a1..dd293c000 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -294,8 +294,7 @@ enum hwdscreentexture HWD_SCREENTEXTURE_WIPE_START, // source image for the wipe/fade effect HWD_SCREENTEXTURE_WIPE_END, // destination image for the wipe/fade effect HWD_SCREENTEXTURE_GENERIC1, // underwater/heat effect, intermission background - HWD_SCREENTEXTURE_GENERIC2, // palette-based colormap fade, screen before palette rendering's postprocessing - HWD_SCREENTEXTURE_GENERIC3, // screen after palette rendering's postprocessing + HWD_SCREENTEXTURE_GENERIC2, // palette-based colormap fade, final screen texture NUMSCREENTEXTURES, // (generic3 is unused if palette rendering is disabled) }; typedef enum hwdscreentexture hwdscreentexture_t; diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index b9c4e9fd4..d5c18a129 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -563,7 +563,7 @@ void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength) if (color & 0xFF00) // Do COLORMAP fade. { - if (HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) + if (HWR_ShouldUsePaletteRendering() && cv_grscreentextures.value) { const hwdscreentexture_t scr_tex = HWD_SCREENTEXTURE_GENERIC2; @@ -1178,7 +1178,6 @@ static inline boolean saveTGA(const char *file_name, void *buffer, UINT8 *HWR_GetScreenshot(void) { static UINT8 *buf = NULL; - int tex = ((HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) ? HWD_SCREENTEXTURE_GENERIC3 : HWD_SCREENTEXTURE_GENERIC2); buf = realloc(buf, vid.width * vid.height * 3); @@ -1186,7 +1185,7 @@ UINT8 *HWR_GetScreenshot(void) return NULL; // returns 24bit 888 RGB - HWD.pfnReadScreenTexture(tex, (void *)buf); + HWD.pfnReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf); return buf; } @@ -1194,7 +1193,6 @@ boolean HWR_Screenshot(const char *pathname) { boolean ret; UINT8 *buf = malloc(vid.width * vid.height * 3 * sizeof (*buf)); - int tex = ((HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) ? HWD_SCREENTEXTURE_GENERIC3 : HWD_SCREENTEXTURE_GENERIC2); if (!buf) { @@ -1203,7 +1201,7 @@ boolean HWR_Screenshot(const char *pathname) } // returns 24bit 888 RGB - HWD.pfnReadScreenTexture(tex, (void *)buf); + HWD.pfnReadScreenTexture(HWD_SCREENTEXTURE_GENERIC2, (void *)buf); #ifdef USE_PNG ret = M_SavePNG(pathname, buf, vid.width, vid.height, NULL); diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 1793b8250..a54de5f31 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -124,7 +124,7 @@ consvar_t cv_secbright = {"secbright", "0", CV_SAVE, secbright_cons_t, consvar_t cv_grfovchange = {"gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; - + // values for the far clipping plane static float clipping_distances[] = {1024.0f, 2048.0f, 4096.0f, 6144.0f, 8192.0f, 12288.0f, 16384.0f}; // values for bsp culling @@ -152,7 +152,6 @@ static CV_PossibleValue_t glpalettedepth_cons_t[] = {{16, "16 bits"}, {24, "24 b 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_groldpal = {"gr_oldpal", "Off", CV_SAVE, CV_OnOff, NULL, 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}; @@ -6426,7 +6425,6 @@ void HWR_AddCommands(void) CV_RegisterVar(&cv_grpaletterendering); CV_RegisterVar(&cv_grpalettedepth); CV_RegisterVar(&cv_grflashpal); - CV_RegisterVar(&cv_groldpal); } // -------------------------------------------------------------------------- @@ -6669,14 +6667,12 @@ void HWR_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT void HWR_MakeScreenFinalTexture(void) { - int tex = ((HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) ? HWD_SCREENTEXTURE_GENERIC3 : HWD_SCREENTEXTURE_GENERIC2); - HWD.pfnMakeScreenTexture(tex); + HWD.pfnMakeScreenTexture(HWD_SCREENTEXTURE_GENERIC2); } void HWR_DrawScreenFinalTexture(int width, int height) { - int tex = ((HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) ? HWD_SCREENTEXTURE_GENERIC3 : HWD_SCREENTEXTURE_GENERIC2); - HWD.pfnDrawScreenFinalTexture(tex, width, height); + HWD.pfnDrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, width, height); } // jimita 18032019 diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index 6fba8d78e..0b9437f5d 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -195,7 +195,6 @@ extern consvar_t cv_grusecustomshaders; extern consvar_t cv_grpaletterendering; extern consvar_t cv_grpalettedepth; extern consvar_t cv_grflashpal; -extern consvar_t cv_groldpal; extern consvar_t cv_grscreentextures; extern consvar_t cv_grportals; extern consvar_t cv_nostencil; diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index fb8292ba7..bb5f3396a 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -3708,7 +3708,7 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int tex, int width, int height) pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]); - if ((HWR_ShouldUsePaletteRendering()) && cv_groldpal.value) + if (HWR_ShouldUsePaletteRendering()) pglUseProgram(gl_shaderprograms[8].program); // palette postprocess shader pglColor4ubv(white); @@ -3718,7 +3718,7 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int tex, int width, int height) pglDrawArrays(GL_TRIANGLE_FAN, 0, 4); - if ((HWR_ShouldUsePaletteRendering()) && cv_groldpal.value) + if (HWR_ShouldUsePaletteRendering()) pglUseProgram(0); tex_downloaded = screenTextures[tex]; diff --git a/src/m_menu.c b/src/m_menu.c index 28d3b0a93..2d7a49972 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1495,7 +1495,6 @@ static menuitem_t OP_ExpOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Screen Textures", &cv_grscreentextures, 75}, {IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_grpalettedepth, 85}, - {IT_STRING | IT_CVAR, NULL, "Old Palshader Screentexture", &cv_groldpal, 95}, {IT_STRING | IT_CVAR, NULL, "Splitwall/Slope texture fix", &cv_splitwallfix, 105}, {IT_STRING | IT_CVAR, NULL, "Slope midtexture peg fix", &cv_slopepegfix, 115}, @@ -1514,8 +1513,7 @@ static const char* OP_ExpTooltips[] = "Hides Sprites which are not visible\npotentially resulting in a performance boost.", #ifdef HWRENDER "Should the game do Screen Textures? Provides a good boost to frames\nat the cost of some visual effects not working when disabled.", - "Fixes issues that resulted in Textures sticking from the\nground sometimes.\nThis may be CPU heavy and result in worse performance in some cases.", - "Changes back to old Palette renderer screentexture behaviour\nthis makes performance better and keeps the old visuals\nat the cost of accuracy.", + "Change the depth of the Palette in Palette rendering mod\n 16 bits is like software looks ingame\nwhile 24 bits is how software looks in screenshots.", "Fixes issues that resulted in Textures sticking from the ground sometimes.\n This may be CPU heavy and result in worse performance in some cases.", "Fixes issues that resulted in Textures not being properly skewed\n example: Fences on slopes that didnt show proper.\n This may be CPU heavy and result in worse performance in some cases.", "Fixes issues that resulted in Textures on Floor over Floors\nZFighting heavily.", diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 7d3313f0e..c070b3826 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1483,14 +1483,6 @@ void I_FinishUpdate(void) #ifdef HWRENDER else if (rendermode == render_opengl) { - // Final postprocess step of palette rendering, after everything else has been drawn. - if (HWR_ShouldUsePaletteRendering() && !cv_groldpal.value) - { - HWD.pfnMakeScreenTexture(HWD_SCREENTEXTURE_GENERIC2); - HWD.pfnSetShader(8); - HWD.pfnDrawScreenTexture(HWD_SCREENTEXTURE_GENERIC2, NULL, 0); - HWD.pfnUnSetShader(); - } OglSdlFinishUpdate(cv_vidwait.value); } #endif diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index 25d21bff5..dc831fce0 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -233,9 +233,7 @@ void OglSdlFinishUpdate(boolean waitvbl) // Sryder: We need to draw the final screen texture again into the other buffer in the original position so that // effects that want to take the old screen can do so after this - // Generic2 has the screen image without palette rendering brightness adjustments. - // Using that here will prevent brightness adjustments being applied twice. - DrawScreenTexture(HWD_SCREENTEXTURE_GENERIC2, NULL, 0); + HWR_DrawScreenFinalTexture(realwidth, realheight); } EXPORT void HWRAPI(OglSdlSetPalette) (RGBA_t *palette)