From da0a8db704f610994d665dfd7c080b49476ce76d Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Wed, 13 Sep 2017 00:43:56 -0500 Subject: 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. --- backends/graphics/opengl/opengl-graphics.cpp | 14 +------------- backends/graphics/opengl/opengl-graphics.h | 6 ------ 2 files changed, 1 insertion(+), 19 deletions(-) (limited to 'backends/graphics/opengl') 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 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; @@ -395,11 +394,6 @@ protected: */ uint32 _cursorKeyColor; - /** - * Whether the cursor is actually visible. - */ - bool _cursorVisible; - /** * Whether no cursor scaling should be applied. */ -- cgit v1.2.3