Added an option to compleatly disable gamma ramps.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@961 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-04-18 05:41:39 +00:00
parent 998efee8c3
commit ee02371019

View file

@ -70,7 +70,7 @@ static float old_windowed_mouse = 0;
#ifdef WITH_VMODE
static qboolean vidmode_ext = false;
static int vidmode_ext = 0;
static XF86VidModeModeInfo **vidmodes;
static int num_vidmodes;
static qboolean vidmode_active = false;
@ -715,14 +715,14 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
#ifdef WITH_VMODE //find out if it's supported on this pc.
MajorVersion = MinorVersion = 0;
if (!XF86VidModeQueryVersion(vid_dpy, &MajorVersion, &MinorVersion))
if (COM_CheckParm("-novmode") || !XF86VidModeQueryVersion(vid_dpy, &MajorVersion, &MinorVersion))
{
vidmode_ext = false;
vidmode_ext = 0;
}
else
{
Con_Printf("Using XF86-VidModeExtension Ver. %d.%d\n", MajorVersion, MinorVersion);
vidmode_ext = true;
vidmode_ext = MajorVersion;
}
#endif
@ -819,7 +819,20 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
XFlush(vid_dpy);
#ifdef WITH_VMODE
if (vidmode_ext >= 2)
{
int rampsize = 256;
XF86VidModeGetGammaRampSize(vid_dpy, scrnum, &rampsize);
if (rampsize != 256)
{
origionalapplied = false;
Con_Printf("Gamma ramps are not of 256 componants.\n");
}
else
origionalapplied = XF86VidModeGetGammaRamp(vid_dpy, scrnum, 256, origionalramps[0], origionalramps[1], origionalramps[2]);
}
else
origionalapplied = false;
#endif
ctx = qglXCreateContext(vid_dpy, visinfo, NULL, True);