get rid of the automatic "downsample" detection stufff
massive declutter
This commit is contained in:
1 parent
16c0b48f4a
commit
b712cba62d
8 files changed
+6
-177
No files matched your search
@@ -161,9 +161,6 @@ static void COM_HWR_glinfo(void);
|
||||
//
|
||||
|
||||
static void CV_screentextures_OnChange(void);
|
||||
#ifdef USE_FBO_OGL
|
||||
static void CV_glframebuffer_OnChange(void);
|
||||
#endif
|
||||
static void CV_glshaders_OnChange(void);
|
||||
static void CV_gllightdithering_OnChange(void);
|
||||
static void CV_filtermode_OnChange(void);
|
||||
@@ -206,10 +203,6 @@ static CV_PossibleValue_t glpalettedepth_cons_t[] = {{16, "16 bits"}, {24, "24 b
|
||||
// - full screen scaling (use native resolution or windowed mode to avoid this)
|
||||
consvar_t cv_glscreentextures = {"gr_screentextures", "All", CV_CALL|CV_SAVE, glscreentextures_cons_t, CV_screentextures_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
consvar_t cv_glframebuffer = {"gr_framebuffer", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, CV_glframebuffer_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
consvar_t cv_glmdls = {"gr_mdls", "Off", CV_SAVE|CV_CALL, CV_OnOff, M_UpdateOGLMenu, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_glfallbackplayermodel = {"gr_fallbackplayermodel", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -253,29 +246,11 @@ static void CV_screentextures_OnChange(void)
|
||||
{
|
||||
if (cv_glpaletterendering.value != 0)
|
||||
CV_SetValue(&cv_glpaletterendering, 0);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
if (cv_glframebuffer.value != 0)
|
||||
CV_SetValue(&cv_glframebuffer, 0);
|
||||
#endif
|
||||
}
|
||||
GL_SetSpecialState(HWD_SET_SCREEN_TEXTURES, cv_glscreentextures.value);
|
||||
M_UpdateOGLMenu();
|
||||
}
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
static void CV_glframebuffer_OnChange(void)
|
||||
{
|
||||
ONLY_IF_GL_LOADED
|
||||
if ((cv_glframebuffer.value != 0 && cv_glscreentextures.value != 2) || (!supportFBO && cv_glframebuffer.value != 0)) // screen FBO needs screen textures
|
||||
CV_SetValue(&cv_glframebuffer, 0);
|
||||
|
||||
I_DownSample();
|
||||
RefreshOGLSDLSurface();
|
||||
M_UpdateOGLMenu();
|
||||
}
|
||||
#endif
|
||||
|
||||
static void CV_glshaders_OnChange(void)
|
||||
{
|
||||
ONLY_IF_GL_LOADED
|
||||
@@ -5801,10 +5776,6 @@ void HWR_AddCommands(void)
|
||||
|
||||
CV_RegisterVar(&cv_glscreentextures);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
CV_RegisterVar(&cv_glframebuffer);
|
||||
#endif
|
||||
|
||||
CV_RegisterVar(&cv_glmdls);
|
||||
CV_RegisterVar(&cv_glfallbackplayermodel);
|
||||
|
||||
|
||||
@@ -183,9 +183,6 @@ extern CV_PossibleValue_t glanisotropicmode_cons_t[];
|
||||
extern consvar_t cv_gltexturedepth;
|
||||
|
||||
extern consvar_t cv_glscreentextures;
|
||||
#ifdef USE_FBO_OGL
|
||||
extern consvar_t cv_glframebuffer;
|
||||
#endif
|
||||
|
||||
extern consvar_t cv_glmdls;
|
||||
extern consvar_t cv_glfallbackplayermodel;
|
||||
|
||||
@@ -1265,7 +1265,7 @@ void GL_DeleteTexture(GLMipmap_t *pTexInfo)
|
||||
#ifdef USE_FBO_OGL
|
||||
static void GL_Framebuffer_GenerateAttachments(void)
|
||||
{
|
||||
if (!supportFBO || !UseScreenFBO())
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
// Bind the framebuffer
|
||||
@@ -1347,7 +1347,7 @@ static void GL_Framebuffer_DeleteAttachments(void)
|
||||
|
||||
static void GL_Framebuffer_Generate(void)
|
||||
{
|
||||
if (!supportFBO || !UseScreenFBO())
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
// Generate the framebuffer
|
||||
@@ -1384,7 +1384,7 @@ void GL_Framebuffer_Unbind(void)
|
||||
|
||||
void GL_Framebuffer_Enable(void)
|
||||
{
|
||||
if (!supportFBO || !UseScreenFBO())
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
if (FramebufferObject == 0)
|
||||
|
||||
@@ -144,14 +144,6 @@ boolean I_CheckNativeRes(void);
|
||||
|
||||
void I_SetBorderlessWindow(void);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
|
||||
void RefreshOGLSDLSurface(void);
|
||||
void I_DownSample(void);
|
||||
boolean UseScreenFBO(void);
|
||||
extern boolean downsample;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -1825,17 +1825,10 @@ void M_Init(void)
|
||||
OP_VideoOptionsMenu[op_video_ogl].status = IT_DISABLED;
|
||||
|
||||
OP_ExpOptionsMenu[op_exp_glscrtx].status = IT_DISABLED;
|
||||
#ifdef USE_FBO_OGL
|
||||
OP_ExpOptionsMenu[op_exp_fbo].status = IT_DISABLED;
|
||||
#endif
|
||||
OP_ExpOptionsMenu[op_exp_paldepth].status = IT_DISABLED;
|
||||
}
|
||||
else if (rendermode == render_opengl)
|
||||
{
|
||||
#ifdef USE_FBO_OGL
|
||||
if (!supportFBO)
|
||||
OP_ExpOptionsMenu[op_exp_fbo].status = IT_GRAYEDOUT;
|
||||
#endif
|
||||
if (!gl_shadersavailable)
|
||||
{
|
||||
OP_OpenGLOptionsMenu[op_gl_shader].status = IT_GRAYEDOUT;
|
||||
|
||||
@@ -948,15 +948,9 @@ static menuitem_t OP_ExpOptionsMenu[] =
|
||||
|
||||
#ifdef HWRENDER
|
||||
{IT_STRING | IT_CVAR, NULL, "Screen Textures", &cv_glscreentextures, 70},
|
||||
#ifdef USE_FBO_OGL
|
||||
{IT_STRING | IT_CVAR, NULL, "FBO Downsampling support", &cv_glframebuffer, 75},
|
||||
{IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 85},
|
||||
{IT_DISABLED, NULL, "", NULL, 95}, // dummy text
|
||||
#else
|
||||
{IT_STRING | IT_CVAR, NULL, "Palette Depth", &cv_glpalettedepth, 80},
|
||||
{IT_DISABLED, NULL, "", NULL, 90}, // dummy text
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
static const char* OP_ExpTooltips[] =
|
||||
@@ -971,9 +965,6 @@ static const char* OP_ExpTooltips[] =
|
||||
"Different methods of scaling the votescreen backgrounds.",
|
||||
#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.",
|
||||
#ifdef USE_FBO_OGL
|
||||
"Allows the game to downsample from a higher resolution than your display\nin OpenGL renderer mode. Requires a GPU with atleast OpenGL 3.0 support.",
|
||||
#endif
|
||||
"Change the bit depth of the Lookup Palette in Palette rendering mode\n 16 bits is like software looks ingame\nwhile 24 bits is how software looks in screenshots.",
|
||||
#endif
|
||||
};
|
||||
@@ -990,9 +981,6 @@ enum
|
||||
op_exp_votescrn,
|
||||
#ifdef HWRENDER
|
||||
op_exp_glscrtx,
|
||||
#ifdef USE_FBO_OGL
|
||||
op_exp_fbo,
|
||||
#endif
|
||||
op_exp_paldepth,
|
||||
#endif
|
||||
};
|
||||
@@ -2926,9 +2914,6 @@ void GameFocus_menu_Onchange(void)
|
||||
#ifdef HWRENDER
|
||||
void M_UpdateOGLMenu(void)
|
||||
{
|
||||
#ifdef USE_FBO_OGL
|
||||
OP_ExpOptionsMenu[op_exp_fbo].status = (!supportFBO || cv_glscreentextures.value != 2) ? IT_GRAYEDOUT : IT_STRING | IT_CVAR;
|
||||
#endif
|
||||
OP_ExpOptionsMenu[op_exp_paldepth].status = (!HWR_ShouldUsePaletteRendering()) ? IT_GRAYEDOUT : IT_STRING | IT_CVAR;
|
||||
|
||||
OP_OpenGLOptionsMenu[op_gl_falbckmdls].status = (!cv_glmdls.value) ? IT_GRAYEDOUT : IT_STRING | IT_CVAR;
|
||||
|
||||
@@ -133,7 +133,6 @@ static void Impl_SetVsync(void);
|
||||
static INT32 desktopwidth = 0, desktopheight = 0;
|
||||
|
||||
static void I_CheckDesktopRes(void);
|
||||
|
||||
// synchronize page flipping with screen refresh
|
||||
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Impl_SetVsync, 0, NULL, NULL, 0, 0, NULL};
|
||||
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -211,15 +210,6 @@ static void Impl_VideoSetupBuffer(void);
|
||||
static SDL_bool Impl_CreateWindow(SDL_bool fullscreen);
|
||||
static void Impl_SetWindowIcon(void);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
boolean downsample = false;
|
||||
void RefreshOGLSDLSurface(void)
|
||||
{
|
||||
if (rendermode == render_opengl)
|
||||
OglSdlSurface(vid.width, vid.height);
|
||||
}
|
||||
#endif
|
||||
|
||||
void I_SetTextInput(void)
|
||||
{
|
||||
static boolean input_active = false;
|
||||
@@ -554,43 +544,6 @@ boolean I_CheckNativeRes(void)
|
||||
return (vid.width == desktopwidth && vid.height == desktopheight);
|
||||
}
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
void I_DownSample(void)
|
||||
{
|
||||
boolean needrefresh = false;
|
||||
|
||||
if (!cv_glframebuffer.value || !supportFBO || (cv_glscreentextures.value == 0)) // no sense to do this crap if we cant benefit from it
|
||||
{
|
||||
downsample = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (I_CheckNativeRes() && (downsample == true))
|
||||
{
|
||||
downsample = false;
|
||||
RefreshOGLSDLSurface();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((vid.width > desktopwidth) || (vid.height > desktopheight)) //check if current resolution is higher than current display resolution
|
||||
{
|
||||
downsample = true;
|
||||
needrefresh = true;
|
||||
}
|
||||
else if (downsample == true)
|
||||
{
|
||||
downsample = false;
|
||||
needrefresh = true;
|
||||
}
|
||||
|
||||
if (needrefresh)
|
||||
{
|
||||
RefreshOGLSDLSurface();
|
||||
needrefresh = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
||||
{
|
||||
#define FOCUSUNION (mousefocus | (kbfocus << 1) | (windowmoved << 2))
|
||||
@@ -636,9 +589,6 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
||||
if (windowmoved && rendermode == render_opengl)
|
||||
{
|
||||
I_CheckDesktopRes();
|
||||
#ifdef USE_FBO_OGL
|
||||
I_DownSample();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (mousefocus && kbfocus)
|
||||
@@ -1289,9 +1239,6 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
I_CheckDesktopRes();
|
||||
#ifdef USE_FBO_OGL
|
||||
I_DownSample();
|
||||
#endif
|
||||
OglSdlSurface(vid.width, vid.height);
|
||||
}
|
||||
#endif
|
||||
|
||||
+3
-59
@@ -70,22 +70,6 @@ PFNglGetIntegerv pglGetIntegerv;
|
||||
PFNglGetString pglGetString;
|
||||
#endif
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
|
||||
#if defined (__unix__)
|
||||
static boolean xwaylandcrap = false;
|
||||
#endif
|
||||
|
||||
boolean UseScreenFBO(void)
|
||||
{
|
||||
return ((supportFBO && cv_glframebuffer.value && downsample)
|
||||
#if defined (__unix__)
|
||||
|| (supportFBO && xwaylandcrap)
|
||||
#endif
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** \brief SDL video display surface
|
||||
*/
|
||||
INT32 oglflags = 0;
|
||||
@@ -207,16 +191,6 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
||||
maximumAnisotropy = 1;
|
||||
|
||||
glanisotropicmode_cons_t[1].value = maximumAnisotropy;
|
||||
|
||||
#if defined (__unix__)
|
||||
#ifdef USE_FBO_OGL
|
||||
char videodriver[4] = {'S','D','L',0};
|
||||
if (supportFBO && strstr((const char*)gl_renderer, "NVIDIA")
|
||||
&& (*strncpy(videodriver, SDL_GetCurrentVideoDriver(), sizeof(videodriver)-1) != '\0')
|
||||
&& (strncasecmp("x11",videodriver,4) == 0))
|
||||
xwaylandcrap = true;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
|
||||
@@ -226,10 +200,7 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
||||
pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
if (UseScreenFBO())
|
||||
GL_Framebuffer_Enable();
|
||||
else
|
||||
GL_Framebuffer_Disable();
|
||||
GL_Framebuffer_Enable();
|
||||
#endif
|
||||
|
||||
if (!first_init)
|
||||
@@ -251,10 +222,6 @@ void OglSdlFinishUpdate(boolean waitvbl)
|
||||
static boolean oldwaitvbl = false;
|
||||
int sdlw, sdlh;
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
const boolean usefbo = UseScreenFBO();
|
||||
#endif
|
||||
|
||||
if (oldwaitvbl != waitvbl)
|
||||
{
|
||||
SDL_GL_SetSwapInterval(waitvbl ? 1 : 0);
|
||||
@@ -266,41 +233,18 @@ void OglSdlFinishUpdate(boolean waitvbl)
|
||||
HWR_MakeScreenFinalTexture();
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
if (usefbo)
|
||||
{
|
||||
GL_Framebuffer_Unbind();
|
||||
}
|
||||
GL_Framebuffer_Unbind();
|
||||
#endif
|
||||
|
||||
HWR_DrawScreenFinalTexture(sdlw, sdlh, HWR_ShouldUsePaletteRendering());
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
if (usefbo)
|
||||
{
|
||||
GL_Framebuffer_Enable();
|
||||
}
|
||||
GL_Framebuffer_Enable();
|
||||
#endif
|
||||
|
||||
SDL_GL_SwapWindow(window);
|
||||
|
||||
GL_GClipRect(0, 0, realwidth, realheight, NZCLIP_PLANE, FAR_ZCLIP_DEFAULT);
|
||||
|
||||
// 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
|
||||
// well we dont need it on native res it seems
|
||||
#ifdef USE_FBO_OGL
|
||||
if ((!I_CheckNativeRes() && !usefbo) || WipeInAction)
|
||||
#else
|
||||
if (!I_CheckNativeRes() || WipeInAction)
|
||||
#endif
|
||||
HWR_DrawScreenFinalTexture(realwidth, realheight, false);
|
||||
|
||||
#if defined (__unix__)
|
||||
#ifdef USE_FBO_OGL
|
||||
if (loaded_config)
|
||||
xwaylandcrap = false;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif //HWRENDER
|
||||
|
||||
Reference in new issue
Block a user