aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/surfacesdl
diff options
context:
space:
mode:
authorColin Snover2017-09-13 00:43:56 -0500
committerColin Snover2017-10-15 13:24:20 -0500
commitda0a8db704f610994d665dfd7c080b49476ce76d (patch)
treed22ed14f81f2a698f053df52e5ac57d8f9793957 /backends/graphics/surfacesdl
parentde2bbe3b9738ef95b2529db989570770ef434f9d (diff)
downloadscummvm-rg350-da0a8db704f610994d665dfd7c080b49476ce76d.tar.gz
scummvm-rg350-da0a8db704f610994d665dfd7c080b49476ce76d.tar.bz2
scummvm-rg350-da0a8db704f610994d665dfd7c080b49476ce76d.zip
BACKENDS: Also hide mouse cursor outside game area when an engine has hidden the cursor
The only reason we show the system cursor outside the game area is to show users where their mouse is when the window is resized and the mouse is outside the game area. If the game cannot be interacted with, then the mouse also does not need to be shown in the black areas.
Diffstat (limited to 'backends/graphics/surfacesdl')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp15
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h2
2 files changed, 2 insertions, 15 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 52104ffb7a..f610922cc2 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -145,7 +145,7 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
#endif
_overlayscreen(0), _tmpscreen2(0),
_scalerProc(0), _screenChangeCount(0),
- _mouseVisible(false), _mouseData(0), _mouseSurface(0),
+ _mouseData(0), _mouseSurface(0),
_mouseOrigSurface(0), _cursorDontScale(false), _cursorPaletteDisabled(true),
_currentShakePos(0), _newShakePos(0),
_paletteDirtyStart(0), _paletteDirtyEnd(0),
@@ -1863,17 +1863,6 @@ void SurfaceSdlGraphicsManager::copyRectToOverlay(const void *buf, int pitch, in
#pragma mark --- Mouse ---
#pragma mark -
-bool SurfaceSdlGraphicsManager::showMouse(bool visible) {
- if (_mouseVisible == visible)
- return visible;
-
- bool last = _mouseVisible;
- _mouseVisible = visible;
- _cursorNeedsRedraw = true;
-
- return last;
-}
-
void SurfaceSdlGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
#ifdef USE_RGB_COLOR
if (!format)
@@ -2123,7 +2112,7 @@ void SurfaceSdlGraphicsManager::undrawMouse() {
}
void SurfaceSdlGraphicsManager::drawMouse() {
- if (!_mouseVisible || !_mouseSurface) {
+ if (!_cursorVisible || !_mouseSurface) {
_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
return;
}
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index c1e49b953a..0ed8d79296 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -129,7 +129,6 @@ public:
virtual int16 getOverlayHeight() const override { return _videoMode.overlayHeight; }
virtual int16 getOverlayWidth() const override { return _videoMode.overlayWidth; }
- virtual bool showMouse(bool visible) override;
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL) override;
virtual void setCursorPalette(const byte *colors, uint start, uint num) override;
@@ -318,7 +317,6 @@ protected:
{ }
};
- bool _mouseVisible;
byte *_mouseData;
SDL_Rect _mouseBackup;
MousePos _mouseCurState;