-// LordHavoc: FIXME: finish this code, we need to allocate colors before we can store them
-#if 1
- return FALSE;
-#else
- int i, ncolors, c;
- unsigned int Rmask, Gmask, Bmask, Rloss, Gloss, Bloss, Rshift, Gshift, Bshift, mask;
- XColor xcmap[256];
- unsigned short ramp[256];
-
- if (COM_CheckParm("-nogamma"))
- return FALSE;
-
- if (vidx11_visual->class != DirectColor)
- {
- Con_Printf("X11 Visual class is %d, can only do gamma on %d\n", vidx11_visual->class, DirectColor);
- return FALSE;
- }
-
- Rmask = vidx11_visual->red_mask;
- Gmask = vidx11_visual->green_mask;
- Bmask = vidx11_visual->blue_mask;
-
- Rshift = 0;
- Rloss = 8;
- if ((mask = Rmask))
- {
- for (;!(mask & 1);mask >>= 1)
- ++Rshift;
- for (;(mask & 1);mask >>= 1)
- --Rloss;
- }
- Gshift = 0;
- Gloss = 8;
- if ((mask = Gmask))
- {
- for (;!(mask & 1);mask >>= 1)
- ++Gshift;
- for (;(mask & 1);mask >>= 1)
- --Gloss;
- }
- Bshift = 0;
- Bloss = 8;
- if ((mask = Bmask))
- {
- for (;!(mask & 1);mask >>= 1)
- ++Bshift;
- for (;(mask & 1);mask >>= 1)
- --Bloss;
- }
-
- BuildGammaTable16(prescale, gamma, scale, base, ramp);
+ return XF86VidModeSetGammaRamp(vidx11_display, vidx11_screen, 256, ramps, ramps + 256, ramps + 512);
+}