From 2c0147eb1a4789cb5c089e920da5b7e80a077f8c Mon Sep 17 00:00:00 2001 From: driAn Date: Tue, 18 May 2010 19:03:37 +0000 Subject: [PATCH] set default gamma when closing AC git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4923 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/src/main.cpp b/source/src/main.cpp index 301c6e9a..45df67f2 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -9,6 +9,7 @@ void cleanup(char *msg) // single program exit point; cleanupclient(); audiomgr.soundcleanup(); cleanupserver(); + setdefaultgamma(); } SDL_ShowCursor(1); if(msg) @@ -371,11 +372,16 @@ VARFP(gamma, 30, 100, 300, } }); +void setdefaultgamma() +{ + SDL_SetGamma(1, 1, 1); +} + void resetgamma() { float f = gamma/100.0f; if(f==1) return; - SDL_SetGamma(1, 1, 1); + setdefaultgamma(); SDL_SetGamma(f, f, f); }