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();