aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
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