aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2011-02-24 01:15:27 +0100
committerJohannes Schickel2011-02-24 01:15:27 +0100
commit87f260a66c94f4632a2f646dd64f45f9f02d027f (patch)
treeecc9b0ed9fde0a151719067baaddd6e1f63a0498 /backends/graphics
parent466030443a925b27625a7151679e252dc956c817 (diff)
downloadscummvm-rg350-87f260a66c94f4632a2f646dd64f45f9f02d027f.tar.gz
scummvm-rg350-87f260a66c94f4632a2f646dd64f45f9f02d027f.tar.bz2
scummvm-rg350-87f260a66c94f4632a2f646dd64f45f9f02d027f.zip
SDL: Add config file variable to enable the focus rect debug code.
The variable is named "use_sdl_debug_focusrect" for now. The debug code is still only enabled, when a ScummVM debug version is built though.
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp15
-rw-r--r--backends/graphics/sdl/sdl-graphics.h1
2 files changed, 15 insertions, 1 deletions
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 3cda8aabac..dc63c88b5c 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -143,7 +143,7 @@ SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *sdlEventSource)
_screenIsLocked(false),
_graphicsMutex(0),
#ifdef USE_SDL_DEBUG_FOCUSRECT
- _enableFocusRect(false), _focusRect(),
+ _enableFocusRectDebugCode(false), _enableFocusRect(false), _focusRect(),
#endif
_transactionMode(kTransactionNone) {
@@ -172,6 +172,11 @@ SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *sdlEventSource)
}
#endif
+#ifdef USE_SDL_DEBUG_FOCUSRECT
+ if (ConfMan.hasKey("use_sdl_debug_focusrect"))
+ _enableFocusRectDebugCode = ConfMan.getBool("use_sdl_debug_focusrect");
+#endif
+
SDL_ShowCursor(SDL_DISABLE);
memset(&_oldVideoMode, 0, sizeof(_oldVideoMode));
@@ -1475,6 +1480,10 @@ void SdlGraphicsManager::setShakePos(int shake_pos) {
void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
#ifdef USE_SDL_DEBUG_FOCUSRECT
+ // Only enable focus rectangle debug code, when the user wants it
+ if (!_enableFocusRectDebugCode)
+ return;
+
_enableFocusRect = true;
_focusRect = rect;
@@ -1490,6 +1499,10 @@ void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
void SdlGraphicsManager::clearFocusRectangle() {
#ifdef USE_SDL_DEBUG_FOCUSRECT
+ // Only enable focus rectangle debug code, when the user wants it
+ if (!_enableFocusRectDebugCode)
+ return;
+
_enableFocusRect = false;
// We just fake this as a dirty rect for now, to easily force an screen update whenever
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index a5a8b2b385..f467c38d5f 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -306,6 +306,7 @@ protected:
OSystem::MutexRef _graphicsMutex;
#ifdef USE_SDL_DEBUG_FOCUSRECT
+ bool _enableFocusRectDebugCode;
bool _enableFocusRect;
Common::Rect _focusRect;
#endif