|
From: Frank T. <ch...@us...> - 2004-09-30 18:30:25
|
Update of /cvsroot/bzflag/bzflag/src/platform In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25109/src/platform Modified Files: SDLDisplay.cxx Log Message: cosmetic changes Index: SDLDisplay.cxx =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/platform/SDLDisplay.cxx,v retrieving revision 1.40 retrieving revision 1.41 diff -w -u -r1.40 -r1.41 --- SDLDisplay.cxx 20 Sep 2004 22:32:08 -0000 1.40 +++ SDLDisplay.cxx 30 Sep 2004 18:30:16 -0000 1.41 @@ -603,10 +603,10 @@ Gamedev list, March 4, 2000. */ float sum = 0.0; - int i, count = 0; + int count = 0; float gamma = 1.0; - for (i = 1; i < 256; ++i) { + for (int i = 1; i < 256; ++i) { if ((ramp[i] != 0) && (ramp[i] != 65535)) { double B = (double)i / 256.0; double A = ramp[i] / 65535.0; @@ -624,17 +624,14 @@ Uint16 redRamp[256]; Uint16 greenRamp[256]; Uint16 blueRamp[256]; - float red; - float green; - float blue; float gamma = 1.0; int result = SDL_GetGammaRamp(redRamp, greenRamp, blueRamp); if (result == -1) { printf("Could not get Gamma: %s.\n", SDL_GetError()); } else { - red = CalculateGammaFromRamp(redRamp); - green = CalculateGammaFromRamp(greenRamp); - blue = CalculateGammaFromRamp(blueRamp); + float red = CalculateGammaFromRamp(redRamp); + float green = CalculateGammaFromRamp(greenRamp); + float blue = CalculateGammaFromRamp(blueRamp); gamma = (red + green + blue) / 3.0; } return gamma; |