From dbf313157a0ba4ed173982db95cd7a7453020024 Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 14 Oct 2004 12:31:29 +0000 Subject: [PATCH] ATI drivers properly support SetDeviceGammaRamp, so now so do we. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@330 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_vidnt.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/engine/gl/gl_vidnt.c b/engine/gl/gl_vidnt.c index 52ad8a6c8..e8a2e64cf 100644 --- a/engine/gl/gl_vidnt.c +++ b/engine/gl/gl_vidnt.c @@ -873,13 +873,16 @@ void GLVID_ShiftPalette (unsigned char *palette) // VID_SetPalette (palette); if (ActiveApp && vid_hardwaregamma.value) //this is needed because ATI drivers don't work properly (or when task-switched out). + { + if (gammaworks) + { //we have hardware gamma applied - if we're doing a BF, we don't want to reset to the default gamma (yuck) + SetDeviceGammaRamp (maindc, ramps); + return; + } gammaworks = !!SetDeviceGammaRamp (maindc, ramps); + } else gammaworks = false; - if (!gammaworks) - { - SetDeviceGammaRamp(maindc, origionalgammaramps); - } } @@ -892,6 +895,7 @@ void VID_SetDefaultMode (void) void GLVID_Shutdown (void) { SetDeviceGammaRamp(maindc, origionalgammaramps); + gammaworks = false; VID_UnSetMode(); } @@ -1055,6 +1059,7 @@ void GLAppActivate(BOOL fActive, BOOL minimize) v_gamma.modified = true; //wham bam thanks. SetDeviceGammaRamp(maindc, origionalgammaramps); + gammaworks = false; } }