aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2011-02-24 01:19:10 +0100
committerJohannes Schickel2011-02-24 01:19:10 +0100
commit7f139f8dcfab740d6dacc2ea5e3a916618e7ce8f (patch)
tree94bddab4e0e82f149f3ee98d7609cc724a574482 /backends/graphics
parent87f260a66c94f4632a2f646dd64f45f9f02d027f (diff)
downloadscummvm-rg350-7f139f8dcfab740d6dacc2ea5e3a916618e7ce8f.tar.gz
scummvm-rg350-7f139f8dcfab740d6dacc2ea5e3a916618e7ce8f.tar.bz2
scummvm-rg350-7f139f8dcfab740d6dacc2ea5e3a916618e7ce8f.zip
SDL: Output a warning in case the focus rect does not fit inside the screen.
Sadly it seems the engines do not care whether their focus rect really fits inside the game screen. To ease finding such instances (which might cause odd clipping by the backend) I added a warning for them.
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index dc63c88b5c..09c4f39636 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -1487,6 +1487,9 @@ void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
_enableFocusRect = true;
_focusRect = rect;
+ if (rect.left < 0 || rect.top < 0 || rect.right > _videoMode.screenWidth || rect.bottom > _videoMode.screenHeight)
+ warning("SdlGraphicsManager::setFocusRectangle: Got a rect which does not fit inside the screen bounds: %d,%d,%d,%d", rect.left, rect.top, rect.right, rect.bottom);
+
// It's gross but we actually sometimes get rects, which are not inside the screen bounds,
// thus we need to clip the rect here...
_focusRect.clip(_videoMode.screenWidth, _videoMode.screenHeight);