aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl
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/opengl
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/opengl')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp14
-rw-r--r--backends/graphics/opengl/opengl-graphics.h6
2 files changed, 1 insertions, 19 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index d98dcda599..f3ea372b2a 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -58,7 +58,7 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
_cursor(nullptr),
_cursorHotspotX(0), _cursorHotspotY(0),
_cursorHotspotXScaled(0), _cursorHotspotYScaled(0), _cursorWidthScaled(0), _cursorHeightScaled(0),
- _cursorKeyColor(0), _cursorVisible(false), _cursorDontScale(false), _cursorPaletteEnabled(false)
+ _cursorKeyColor(0), _cursorDontScale(false), _cursorPaletteEnabled(false)
#ifdef USE_OSD
, _osdMessageChangeRequest(false), _osdMessageAlpha(0), _osdMessageFadeStartTime(0), _osdMessageSurface(nullptr),
_osdIconSurface(nullptr)
@@ -547,18 +547,6 @@ void OpenGLGraphicsManager::grabOverlay(void *buf, int pitch) const {
}
}
-bool OpenGLGraphicsManager::showMouse(bool visible) {
- // In case the mouse cursor visibility changed we need to redraw the whole
- // screen even when nothing else changed.
- if (_cursorVisible != visible) {
- _cursorNeedsRedraw = true;
- }
-
- bool last = _cursorVisible;
- _cursorVisible = visible;
- return last;
-}
-
namespace {
template<typename DstPixel, typename SrcPixel>
void applyColorKey(DstPixel *dst, const SrcPixel *src, uint w, uint h, uint dstPitch, uint srcPitch, SrcPixel keyColor, DstPixel alphaMask) {
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 92bb988a5e..df968aa67e 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -107,7 +107,6 @@ public:
virtual void clearOverlay() override;
virtual void grabOverlay(void *buf, int pitch) const override;
- virtual bool showMouse(bool visible) override;
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) override;
virtual void setCursorPalette(const byte *colors, uint start, uint num) override;
@@ -396,11 +395,6 @@ protected:
uint32 _cursorKeyColor;
/**
- * Whether the cursor is actually visible.
- */
- bool _cursorVisible;
-
- /**
* Whether no cursor scaling should be applied.
*/
bool _cursorDontScale;