Remove initial R_SetColorMappings() call

This happens before the SDL GL window is set up, which just
results in a warning. Another call will properly set the
gamma table after the window is initialized.
Make gammaTable a stack variable. This is sufficient, since SDL
already restores the gamma values for us on exit.
This commit is contained in:
dhewg 2012-01-19 00:35:41 +01:00
parent 0e3500b919
commit a18650b27e
2 changed files with 3 additions and 8 deletions

View file

@ -1731,6 +1731,7 @@ void R_SetColorMappings( void ) {
int i, j;
float g, b;
int inf;
unsigned short gammaTable[256];
b = r_brightness.GetFloat();
g = r_gamma.GetFloat();
@ -1753,10 +1754,10 @@ void R_SetColorMappings( void ) {
inf = 0xffff;
}
tr.gammaTable[i] = inf;
gammaTable[i] = inf;
}
GLimp_SetGamma( tr.gammaTable, tr.gammaTable, tr.gammaTable );
GLimp_SetGamma( gammaTable, gammaTable, gammaTable );
}
@ -2089,7 +2090,6 @@ void idRenderSystemLocal::Clear( void ) {
guiRecursionLevel = 0;
guiModel = NULL;
demoGuiModel = NULL;
memset( gammaTable, 0, sizeof( gammaTable ) );
takingScreenshot = false;
}
@ -2130,9 +2130,6 @@ void idRenderSystemLocal::Init( void ) {
idCinematic::InitCinematic( );
// build brightness translation tables
R_SetColorMappings();
R_InitMaterials();
renderModelManager->Init();

View file

@ -801,8 +801,6 @@ public:
int guiRecursionLevel; // to prevent infinite overruns
class idGuiModel * guiModel;
class idGuiModel * demoGuiModel;
unsigned short gammaTable[256]; // brightness / gamma modify this
};
extern backEndState_t backEnd;