gamma bug workaround

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2170 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-06-09 22:19:09 +00:00
parent b7d7e3bf31
commit c237d6d37e
+10 -2
View File
@@ -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();