mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 14:30:48 +00:00
refresh.c: some minor tuning/cleaning.
This commit is contained in:
parent
04c5b881a2
commit
5b6f351e67
1 changed files with 17 additions and 16 deletions
|
@ -231,6 +231,7 @@ void CalculateGammaRamp(float gamma, Uint16* ramp, int len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets the hardware gamma
|
* Sets the hardware gamma
|
||||||
*/
|
*/
|
||||||
|
@ -292,7 +293,6 @@ UpdateHardwareGamma(void)
|
||||||
|
|
||||||
XRRFreeScreenResources(res);
|
XRRFreeScreenResources(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // no X11GAMMA
|
#else // no X11GAMMA
|
||||||
void
|
void
|
||||||
UpdateHardwareGamma(void)
|
UpdateHardwareGamma(void)
|
||||||
|
@ -341,10 +341,6 @@ static qboolean CreateSDLWindow(int flags)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set vsync - TODO: -1 could be set for "late swap tearing",
|
|
||||||
// i.e. only vsync if framerate is high enough
|
|
||||||
SDL_GL_SetSwapInterval(gl_swapinterval->value ? 1 : 0);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
window = SDL_SetVideoMode(vid.width, vid.height, 0, flags);
|
window = SDL_SetVideoMode(vid.width, vid.height, 0, flags);
|
||||||
|
@ -574,14 +570,13 @@ GLimp_InitGraphics(qboolean fullscreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !SDL_VERSION_ATLEAST(2, 0, 0)
|
#if !SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
/* Set the icon - for SDL1.2 this must be done before creating the window */
|
/* For SDL1.2, these things must be done before creating the window */
|
||||||
|
|
||||||
|
/* Set the icon */
|
||||||
SetSDLIcon();
|
SetSDLIcon();
|
||||||
|
|
||||||
/* Enable vsync */
|
/* Set vsync */
|
||||||
if (gl_swapinterval->value)
|
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, gl_swapinterval->value ? 1 : 0);
|
||||||
{
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
|
@ -592,7 +587,8 @@ GLimp_InitGraphics(qboolean fullscreen)
|
||||||
{
|
{
|
||||||
VID_Printf(PRINT_ALL, "SDL SetVideoMode failed: %s\n",
|
VID_Printf(PRINT_ALL, "SDL SetVideoMode failed: %s\n",
|
||||||
SDL_GetError());
|
SDL_GetError());
|
||||||
VID_Printf(PRINT_ALL, "Reverting to gl_mode %i (%ix%i) without MSAA.\n",
|
VID_Printf(PRINT_ALL, "Reverting to %s gl_mode %i (%ix%i) without MSAA.\n",
|
||||||
|
(flags & SDL_FULLSCREEN) ? "fullscreen" : "windowed",
|
||||||
(int)Cvar_VariableValue("gl_mode"), vid.width, vid.height);
|
(int)Cvar_VariableValue("gl_mode"), vid.width, vid.height);
|
||||||
|
|
||||||
/* Try to recover */
|
/* Try to recover */
|
||||||
|
@ -604,14 +600,14 @@ GLimp_InitGraphics(qboolean fullscreen)
|
||||||
{
|
{
|
||||||
VID_Printf(PRINT_ALL, "SDL SetVideoMode failed: %s\n",
|
VID_Printf(PRINT_ALL, "SDL SetVideoMode failed: %s\n",
|
||||||
SDL_GetError());
|
SDL_GetError());
|
||||||
VID_Printf(PRINT_ALL, "Reverting to gl_mode 4 (640x480) and windowed mode.\n");
|
VID_Printf(PRINT_ALL, "Reverting to windowed gl_mode 4 (640x480).\n");
|
||||||
|
|
||||||
/* Try to recover */
|
/* Try to recover */
|
||||||
Cvar_SetValue("gl_mode", 4);
|
Cvar_SetValue("gl_mode", 4);
|
||||||
Cvar_SetValue("vid_fullscreen", 0);
|
Cvar_SetValue("vid_fullscreen", 0);
|
||||||
flags &= ~SDL_FULLSCREEN;
|
|
||||||
vid.width = 640;
|
vid.width = 640;
|
||||||
vid.height = 480;
|
vid.height = 480;
|
||||||
|
flags &= ~SDL_FULLSCREEN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -624,9 +620,15 @@ GLimp_InitGraphics(qboolean fullscreen)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
/* Set the icon - for SDL2 this must be done after creating the window */
|
/* For SDL2, these things must be done after creating the window */
|
||||||
|
|
||||||
|
/* Set the icon */
|
||||||
SetSDLIcon();
|
SetSDLIcon();
|
||||||
|
|
||||||
|
/* Set vsync - TODO: -1 could be set for "late swap tearing" */
|
||||||
|
SDL_GL_SetSwapInterval(gl_swapinterval->value ? 1 : 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize the stencil buffer */
|
/* Initialize the stencil buffer */
|
||||||
|
@ -747,7 +749,6 @@ qboolean GLimp_InputIsGrabbed()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shuts the SDL render backend down
|
* Shuts the SDL render backend down
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue