opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_COLORCONTROL_ITEMS - visible)) * 8;
M_Options_PrintCommand( " Reset to defaults", true);
- M_Options_PrintCheckbox("Hardware Gamma Control", vid_hardwaregammasupported, v_hwgamma.integer);
- M_Options_PrintSlider( " Gamma", !v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer, v_gamma.value, 1, 5);
+ M_Options_PrintCheckbox("Hardware Gamma Control", vid_hardwaregammasupported.integer, v_hwgamma.integer);
+ M_Options_PrintSlider( " Gamma", !v_color_enable.integer && vid_hardwaregammasupported.integer && v_hwgamma.integer, v_gamma.value, 1, 5);
M_Options_PrintSlider( " Contrast", !v_color_enable.integer, v_contrast.value, 1, 5);
M_Options_PrintSlider( " Brightness", !v_color_enable.integer, v_brightness.value, 0, 0.8);
M_Options_PrintCheckbox(" Color Level Controls", true, v_color_enable.integer);
M_Options_PrintSlider( " Black: Green", v_color_enable.integer, v_color_black_g.value, 0, 0.8);
M_Options_PrintSlider( " Black: Blue ", v_color_enable.integer, v_color_black_b.value, 0, 0.8);
M_Options_PrintSlider( " Black: Grey ", v_color_enable.integer, (v_color_black_r.value + v_color_black_g.value + v_color_black_b.value) / 3, 0, 0.8);
- M_Options_PrintSlider( " Grey: Red ", v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer, v_color_grey_r.value, 0, 0.95);
- M_Options_PrintSlider( " Grey: Green", v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer, v_color_grey_g.value, 0, 0.95);
- M_Options_PrintSlider( " Grey: Blue ", v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer, v_color_grey_b.value, 0, 0.95);
- M_Options_PrintSlider( " Grey: Grey ", v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer, (v_color_grey_r.value + v_color_grey_g.value + v_color_grey_b.value) / 3, 0, 0.95);
+ M_Options_PrintSlider( " Grey: Red ", v_color_enable.integer && vid_hardwaregammasupported.integer && v_hwgamma.integer, v_color_grey_r.value, 0, 0.95);
+ M_Options_PrintSlider( " Grey: Green", v_color_enable.integer && vid_hardwaregammasupported.integer && v_hwgamma.integer, v_color_grey_g.value, 0, 0.95);
+ M_Options_PrintSlider( " Grey: Blue ", v_color_enable.integer && vid_hardwaregammasupported.integer && v_hwgamma.integer, v_color_grey_b.value, 0, 0.95);
+ M_Options_PrintSlider( " Grey: Grey ", v_color_enable.integer && vid_hardwaregammasupported.integer && v_hwgamma.integer, (v_color_grey_r.value + v_color_grey_g.value + v_color_grey_b.value) / 3, 0, 0.95);
M_Options_PrintSlider( " White: Red ", v_color_enable.integer, v_color_white_r.value, 1, 5);
M_Options_PrintSlider( " White: Green", v_color_enable.integer, v_color_white_g.value, 1, 5);
M_Options_PrintSlider( " White: Blue ", v_color_enable.integer, v_color_white_b.value, 1, 5);
int vid_allowhwgamma = false;
// we don't know until we try it!
-int vid_hardwaregammasupported = true;
+cvar_t vid_hardwaregammasupported = {CVAR_READONLY,"vid_hardwaregammasupported","1"};
// whether hardware gamma ramps are currently in effect
int vid_usinghwgamma = false;
if (!vid_usinghwgamma)
{
vid_usinghwgamma = true;
- vid_hardwaregammasupported = VID_GetGamma(vid_systemgammaramps);
+ Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_GetGamma(vid_systemgammaramps));
}
BOUNDCVAR(v_gamma, 0.1, 5);cachegamma = v_gamma.value;
BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps + 512);
}
- vid_hardwaregammasupported = VID_SetGamma(vid_gammaramps);
+ Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_SetGamma(vid_gammaramps));
}
else
{
if (vid_usinghwgamma)
{
vid_usinghwgamma = false;
- vid_hardwaregammasupported = VID_SetGamma(vid_systemgammaramps);
+ Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_SetGamma(vid_systemgammaramps));
}
}
}
void VID_Shared_Init(void)
{
+ Cvar_RegisterVariable(&vid_hardwaregammasupported);
Cvar_RegisterVariable(&v_gamma);
Cvar_RegisterVariable(&v_brightness);
Cvar_RegisterVariable(&v_contrast);