X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Foptions.cpp;h=3d5014a165413b010eabbdc8c2c1bef41602f3db;hb=383e2361eed9c0cbed729fa5a3055141f1b66324;hp=586a9979fe71f4b38b70588ea3b3492968c9a689;hpb=78036bae87af5f4c35a6eeb56d443b7cf93fcf73;p=quix0rs-blobwars.git diff --git a/src/options.cpp b/src/options.cpp index 586a997..3d5014a 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 2004 Parallel Realities +Copyright (C) 2004-2011 Parallel Realities This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -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();