From c237d6d37ee4e62bd1cdd02a7b8a89501e1caff0 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 9 Jun 2008 22:19:09 +0000 Subject: [PATCH] gamma bug workaround git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2170 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/src/main.cpp b/source/src/main.cpp index ab9c8c7a..e8fc9d2c 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -198,6 +198,14 @@ VARFP(gamma, 30, 100, 300, } }); +void resetgamma() +{ + float f = gamma/100.0f; + if(f==1) return; + SDL_SetGamma(1, 1, 1); + SDL_SetGamma(f, f, f); +} + void setupscreen(int &usedcolorbits, int &useddepthbits, int &usedfsaa) { int flags = SDL_RESIZABLE; @@ -297,8 +305,6 @@ void resetgl() setupscreen(usedcolorbits, useddepthbits, usedfsaa); gl_init(scr_w, scr_h, usedcolorbits, useddepthbits, usedfsaa); - touchvar("gamma"); - extern void reloadfonts(); extern void reloadtextures(); c2skeepalive(); @@ -307,6 +313,8 @@ void resetgl() fatal("failed to reload core texture"); loadingscreen(); c2skeepalive(); + resetgamma(); + c2skeepalive(); reloadfonts(); reloadtextures(); c2skeepalive();