aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl
diff options
context:
space:
mode:
authorMax Horn2009-11-10 22:12:10 +0000
committerMax Horn2009-11-10 22:12:10 +0000
commit58ed9271f52c61a077a2235181fc821e77e96ff0 (patch)
treed8a8dc92ed4d26fe4b2fa90bef2064e2c3264e39 /backends/platform/sdl
parent8b8f1548919b39458b7a682b8ef67f2d69c9ce02 (diff)
downloadscummvm-rg350-58ed9271f52c61a077a2235181fc821e77e96ff0.tar.gz
scummvm-rg350-58ed9271f52c61a077a2235181fc821e77e96ff0.tar.bz2
scummvm-rg350-58ed9271f52c61a077a2235181fc821e77e96ff0.zip
SDL: cleanup
svn-id: r45817
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r--backends/platform/sdl/events.cpp10
-rw-r--r--backends/platform/sdl/graphics.cpp5
-rw-r--r--backends/platform/sdl/sdl.h2
3 files changed, 8 insertions, 9 deletions
diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp
index b7fe40adb7..3da3958738 100644
--- a/backends/platform/sdl/events.cpp
+++ b/backends/platform/sdl/events.cpp
@@ -301,9 +301,8 @@ bool OSystem_SDL::handleKeyDown(SDL_Event &ev, Common::Event &event) {
handleScalerHotkeys(ev.key);
return false;
}
- const bool event_complete = remapKey(ev, event);
- if (event_complete)
+ if (remapKey(ev, event))
return true;
event.type = Common::EVENT_KEYDOWN;
@@ -314,18 +313,15 @@ bool OSystem_SDL::handleKeyDown(SDL_Event &ev, Common::Event &event) {
}
bool OSystem_SDL::handleKeyUp(SDL_Event &ev, Common::Event &event) {
- byte b = 0;
- const bool event_complete = remapKey(ev, event);
-
- if (event_complete)
+ if (remapKey(ev, event))
return true;
event.type = Common::EVENT_KEYUP;
event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
- b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState());
// Ctrl-Alt-<key> will change the GFX mode
+ byte b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState());
if ((b & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) {
// Swallow these key up events
return false;
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 8b315a2d4e..077a9d519c 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -36,6 +36,7 @@
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{"1x", "Normal (no scaling)", GFX_NORMAL},
+#ifndef DISABLE_SCALERS
{"2x", "2x", GFX_DOUBLESIZE},
{"3x", "3x", GFX_TRIPLESIZE},
{"2xsai", "2xSAI", GFX_2XSAI},
@@ -49,6 +50,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
#endif
{"tv2x", "TV2x", GFX_TV2X},
{"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
+#endif
{0, 0, 0}
};
@@ -452,8 +454,7 @@ void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format)
assert(newFormat.bytesPerPixel > 0);
- if (newFormat != _videoMode.format)
- {
+ if (newFormat != _videoMode.format) {
_videoMode.format = newFormat;
_transactionDetails.formatChanged = true;
_screenFormat = newFormat;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 7e1bf92473..10dcb814cc 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -57,6 +57,7 @@ namespace Audio {
enum {
GFX_NORMAL = 0,
+#ifndef DISABLE_SCALERS
GFX_DOUBLESIZE = 1,
GFX_TRIPLESIZE = 2,
GFX_2XSAI = 3,
@@ -68,6 +69,7 @@ enum {
GFX_HQ3X = 9,
GFX_TV2X = 10,
GFX_DOTMATRIX = 11
+#endif
};
class AspectRatio {