/*
-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
drawWidgets();
}
- if (engine.keyState[SDLK_ESCAPE])
+ if (engine.keyState[SDL_SCANCODE_ESCAPE])
{
engine.clearInput();
engine.flushInput();
defaults = 0;
}
- if (engine.keyState[SDLK_ESCAPE])
+ if (engine.keyState[SDL_SCANCODE_ESCAPE])
{
engine.clearInput();
engine.flushInput();
graphics.blit(header, 320, 25, graphics.screen, true);
drawWidgets();
- if (engine.keyState[SDLK_ESCAPE])
+ if (engine.keyState[SDL_SCANCODE_ESCAPE])
{
engine.clearInput();
engine.flushInput();
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))
drawWidgets();
}
- if (engine.keyState[SDLK_ESCAPE])
+ if (engine.keyState[SDL_SCANCODE_ESCAPE])
{
engine.clearInput();
engine.flushInput();