int gl_support_vertex_shader = false;
// GL_ARB_fragment_shader
int gl_support_fragment_shader = false;
-// GL_NV_half_float
-int gl_support_half_float = false;
// LordHavoc: if window is hidden, don't update screen
qboolean vid_hidden = true;
if ((gl_support_shading_language_100 = GL_CheckExtension("GL_ARB_shading_language_100", NULL, "-noshadinglanguage100", false)))
if ((gl_support_vertex_shader = GL_CheckExtension("GL_ARB_vertex_shader", vertexshaderfuncs, "-novertexshader", false)))
gl_support_fragment_shader = GL_CheckExtension("GL_ARB_fragment_shader", NULL, "-nofragmentshader", false);
-
-// COMMANDLINEOPTION: GL: -nohalffloat disables GL_NV_half_float extension
- gl_support_half_float = GL_CheckExtension("GL_NV_half_float", NULL, "-nohalffloat", false);
}
void Force_CenterView_f (void)
vid_gammarampsize = rampsize;
if (vid_gammaramps)
Z_Free(vid_gammaramps);
- vid_gammaramps = Z_Malloc(6 * vid_gammarampsize * sizeof(unsigned short));
+ vid_gammaramps = (unsigned short *)Z_Malloc(6 * vid_gammarampsize * sizeof(unsigned short));
vid_systemgammaramps = vid_gammaramps + 3 * vid_gammarampsize;
}
Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_GetGamma(vid_systemgammaramps, vid_gammarampsize));
if (cachecolorenable)
{
- BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[0]), cachewhite[0], cacheblack[0], vid_gammaramps);
- BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[1]), cachewhite[1], cacheblack[1], vid_gammaramps + vid_gammarampsize);
- BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[2]), cachewhite[2], cacheblack[2], vid_gammaramps + vid_gammarampsize*2);
+ BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[0]), cachewhite[0], cacheblack[0], vid_gammaramps, rampsize);
+ BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[1]), cachewhite[1], cacheblack[1], vid_gammaramps + vid_gammarampsize, rampsize);
+ BuildGammaTable16(1.0f, invpow(0.5, 1 - cachegrey[2]), cachewhite[2], cacheblack[2], vid_gammaramps + vid_gammarampsize*2, rampsize);
}
else
{
- BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps);
- BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps + vid_gammarampsize);
- BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps + vid_gammarampsize*2);
+ BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps, rampsize);
+ BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps + vid_gammarampsize, rampsize);
+ BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps + vid_gammarampsize*2, rampsize);
}
// LordHavoc: this code came from Ben Winslow and Zinx Verituse, I have
for (x = 0, ramp = vid_gammaramps;x < 3;x++)
for (y = 0, t = n[x] - 0.75f;y < vid_gammarampsize;y++, t += 0.75f * (2.0f / vid_gammarampsize))
- *ramp++ = cos(t*(M_PI*2.0)) * 32767.0f + 32767.0f;
+ *ramp++ = (unsigned short)(cos(t*(M_PI*2.0)) * 32767.0f + 32767.0f);
}
Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_SetGamma(vid_gammaramps, vid_gammarampsize));