Skip to content

Commit

Permalink
GRAPHICS: Make sure gamma changing is always done in the main thread
Browse files Browse the repository at this point in the history
Otherwise, dispatch a gamma change request.
This should be the correct fix for issue xoreos#3.
  • Loading branch information
DrMcCoy committed Jan 18, 2012
1 parent c782381 commit 4eec9ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/graphics/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ float GraphicsManager::getGamma() const {
}

void GraphicsManager::setGamma(float gamma) {
if (!Common::isMainThread()) {
// Not the main thread, send a request instead
RequestMan.dispatchAndWait(RequestMan.changeGamma(gamma));
return;
}

_gamma = gamma;

SDL_SetGamma(gamma, gamma, gamma);
Expand Down

0 comments on commit 4eec9ba

Please sign in to comment.