diff options
author | Max Horn | 2004-03-13 14:59:43 +0000 |
---|---|---|
committer | Max Horn | 2004-03-13 14:59:43 +0000 |
commit | 020d0702d1d68e7e5bd731193ec7fcf2f6cc63a0 (patch) | |
tree | 03e9705074564b93da7aedf485174cf490a813b7 | |
parent | 81584704b669e2b12690d645bd0408e2352fd8ff (diff) | |
download | scummvm-rg350-020d0702d1d68e7e5bd731193ec7fcf2f6cc63a0.tar.gz scummvm-rg350-020d0702d1d68e7e5bd731193ec7fcf2f6cc63a0.tar.bz2 scummvm-rg350-020d0702d1d68e7e5bd731193ec7fcf2f6cc63a0.zip |
Allow changing the scaler via keypad, too (FR #821415)
svn-id: r13251
-rw-r--r-- | backends/sdl/events.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/backends/sdl/events.cpp b/backends/sdl/events.cpp index 61098d3018..dae18ae51d 100644 --- a/backends/sdl/events.cpp +++ b/backends/sdl/events.cpp @@ -265,16 +265,19 @@ bool OSystem_SDL::poll_event(Event *event) { // Increase/decrease the scale factor // TODO: Shall we 'wrap around' here? - if (ev.key.keysym.sym == '=' || ev.key.keysym.sym == '+' || ev.key.keysym.sym == '-') { - factor += (ev.key.keysym.sym == '-' ? -1 : +1); + if (ev.key.keysym.sym == SDLK_EQUALS || ev.key.keysym.sym == SDLK_PLUS || ev.key.keysym.sym == SDLK_MINUS || + ev.key.keysym.sym == SDLK_KP_PLUS || ev.key.keysym.sym == SDLK_KP_MINUS) { + factor += (ev.key.keysym.sym == SDLK_MINUS || ev.key.keysym.sym == SDLK_KP_MINUS) ? -1 : +1; if (0 <= factor && factor < 4 && s_gfxModeSwitchTable[_scalerType][factor] >= 0) { setGraphicsMode(s_gfxModeSwitchTable[_scalerType][factor]); } break; } - if ('1' <= ev.key.keysym.sym && ev.key.keysym.sym <= '9') { - _scalerType = ev.key.keysym.sym - '1'; + const bool isNormalNumber = (SDLK_1 <= ev.key.keysym.sym && ev.key.keysym.sym <= SDLK_9); + const bool isKeypadNumber = (SDLK_KP1 <= ev.key.keysym.sym && ev.key.keysym.sym <= SDLK_KP9); + if (isNormalNumber || isKeypadNumber) { + _scalerType = ev.key.keysym.sym - (isNormalNumber ? SDLK_1 : SDLK_KP1); if (_scalerType >= ARRAYSIZE(s_gfxModeSwitchTable)) break; |