X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Foptions.cpp;h=3d5014a165413b010eabbdc8c2c1bef41602f3db;hb=ba027fd5579c333f6ff7049995f712c1237e9e07;hp=b1989bbcddb5dcdf2b24e7ae2e17097ec8b80b7b;hpb=79a76e9c954759649d270f49d831e2cb9c2f40a2;p=quix0rs-blobwars.git diff --git a/src/options.cpp b/src/options.cpp index b1989bb..3d5014a 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -75,7 +75,7 @@ void showCheatConfig() drawWidgets(); } - if (engine.keyState[SDLK_ESCAPE]) + if (engine.keyState[SDL_SCANCODE_ESCAPE]) { engine.clearInput(); engine.flushInput(); @@ -163,7 +163,7 @@ void showKeyConfig() defaults = 0; } - if (engine.keyState[SDLK_ESCAPE]) + if (engine.keyState[SDL_SCANCODE_ESCAPE]) { engine.clearInput(); engine.flushInput(); @@ -247,7 +247,7 @@ void showJoystickConfig() graphics.blit(header, 320, 25, graphics.screen, true); drawWidgets(); - if (engine.keyState[SDLK_ESCAPE]) + if (engine.keyState[SDL_SCANCODE_ESCAPE]) { engine.clearInput(); engine.flushInput(); @@ -365,15 +365,17 @@ void showOptions() audio.setMusicVolume(game.musicVol); if (engine.widgetChanged("fullscreen")) - SDL_WM_ToggleFullScreen(graphics.screen); + SDL_SetWindowFullscreen(graphics.window, engine.fullScreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); if (engine.widgetChanged("gamma")) { brightness = game.brightness; - if (brightness > 0) { - brightness /= 10; - SDL_SetGamma(brightness, brightness, brightness); - } + if (brightness > 0) { + brightness /= 10; + uint16_t ramp[256]; + SDL_CalculateGammaRamp(brightness, ramp); + SDL_SetWindowGammaRamp(graphics.window, ramp, ramp, ramp); + } } if ((joysticks) || (cheats) || (keys)) @@ -428,7 +430,7 @@ void showOptions() drawWidgets(); } - if (engine.keyState[SDLK_ESCAPE]) + if (engine.keyState[SDL_SCANCODE_ESCAPE]) { engine.clearInput(); engine.flushInput();