Skip to content

Commit

Permalink
GRAPHICS: Fix GraphicsManager::setGamma()
Browse files Browse the repository at this point in the history
SDL_CalculateGammaRamp() fills in an array of 256 values. It doesn't
allocate any memory...
  • Loading branch information
DrMcCoy committed Oct 18, 2016
1 parent 7ea25a8 commit 6d194e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graphics/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,11 @@ void GraphicsManager::setGamma(float gamma) {
}

_gamma = gamma;
uint16* gammaRamp = 0;
uint16 gammaRamp[256];

SDL_CalculateGammaRamp(gamma, gammaRamp);

SDL_SetWindowGammaRamp(_screen, gammaRamp, gammaRamp, gammaRamp);
delete gammaRamp;
}

void GraphicsManager::setupScene() {
Expand Down

0 comments on commit 6d194e4

Please sign in to comment.