add another early return

This commit is contained in:
Alug committed 2024-12-20 01:20:51 +01:00
1 parent 231a7f1366
commit a2e6ec4f5b
1 file changed
+19 -4
+19 -4
View File
@@ -710,9 +710,9 @@ static INT32 SDLJoyAxis(const Sint16 axis, evtype_t which)
boolean I_CheckNativeRes(void)
{
static int oldwidth = 0, oldheight = 0;
static INT32 oldwidth = 0, oldheight = 0;
static boolean resstate = false;
int currentDisplayIndex = 0;
int currentDisplayIndex = -1;
SDL_DisplayMode curmode;
if (cv_glscreentextures.value == 0)
@@ -727,6 +727,12 @@ boolean I_CheckNativeRes(void)
currentDisplayIndex = SDL_GetWindowDisplayIndex(window);
// No valid index
if (currentDisplayIndex < 0)
{
return false;
}
if (SDL_GetCurrentDisplayMode(currentDisplayIndex, &curmode) != 0)
{
return false;
@@ -742,14 +748,23 @@ boolean I_CheckNativeRes(void)
#ifdef USE_FBO_OGL
void I_DownSample(void)
{
int currentDisplayIndex = -1;
SDL_DisplayMode curmode;
if (!cv_glframebuffer.value || !supportFBO || I_CheckNativeRes()) //no sense to do this crap if we cant benefit from it
{
downsample = false;
return;
}
int currentDisplayIndex = SDL_GetWindowDisplayIndex(window);
SDL_DisplayMode curmode;
currentDisplayIndex = SDL_GetWindowDisplayIndex(window);
// No valid index
if (currentDisplayIndex < 0)
{
downsample = false;
return;
}
if (SDL_GetCurrentDisplayMode(currentDisplayIndex, &curmode) != 0)
{