From 7f139f8dcfab740d6dacc2ea5e3a916618e7ce8f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 24 Feb 2011 01:19:10 +0100 Subject: 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. --- backends/graphics/sdl/sdl-graphics.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends/graphics/sdl') 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); -- cgit v1.2.3