From 5b3ebdf43de0bd9f04138a6e841f816f34377021 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 15 Feb 2012 02:09:46 +0100 Subject: OPENGL: Prevent access to a few more members in the SDL OpenGL code. --- backends/graphics/opengl/opengl-graphics.cpp | 4 +--- backends/graphics/opengl/opengl-graphics.h | 19 ++++++++++++++----- backends/graphics/openglsdl/openglsdl-graphics.cpp | 5 ++--- 3 files changed, 17 insertions(+), 11 deletions(-) (limited to 'backends') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index f4ffd47f75..b69764f7c5 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -594,10 +594,8 @@ void OpenGLGraphicsManager::warpMouse(int x, int y) { scaledY += _displayY; } + setMousePosition(scaledX, scaledY); setInternalMousePosition(scaledX, scaledY); - - _cursorState.x = scaledX; - _cursorState.y = scaledY; } void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) { diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 17810ddb78..ad8765bab1 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -217,6 +217,7 @@ protected: uint getAspectRatio() const; + void setFormatIsBGR(bool isBGR) { _formatBGR = isBGR; } bool _formatBGR; // @@ -285,6 +286,14 @@ protected: int _cursorTargetScale; bool _cursorNeedsRedraw; + /** + * Set up the mouse position for graphics output. + * + * @param x X coordinate in native coordinates. + * @param y Y coordinate in native coordinates. + */ + void setMousePosition(int x, int y) { _cursorState.x = x; _cursorState.y = y; } + virtual void refreshCursor(); virtual void refreshCursorScale(); @@ -311,11 +320,6 @@ protected: virtual bool saveScreenshot(const char *filename); #ifdef USE_OSD - /** - * The OSD contents. - */ - Common::Array _osdLines; - /** * Returns the font used for on screen display */ @@ -326,6 +330,11 @@ protected: */ void updateOSD(); + /** + * The OSD contents. + */ + Common::Array _osdLines; + GLTexture *_osdTexture; Graphics::Surface _osdSurface; uint8 _osdAlpha; diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 4154b6731b..53688e2fb5 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -376,7 +376,7 @@ bool OpenGLSdlGraphicsManager::loadGFXMode() { } // Check if the screen is BGR format - _formatBGR = _hwscreen->format->Rshift != 0; + setFormatIsBGR(_hwscreen->format->Rshift != 0); if (isFullscreen) { _lastFullscreenModeWidth = _videoMode.hardwareWidth; @@ -671,8 +671,7 @@ void OpenGLSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) { } void OpenGLSdlGraphicsManager::notifyMousePos(Common::Point mouse) { - _cursorState.x = mouse.x; - _cursorState.y = mouse.y; + setMousePosition(mouse.x, mouse.y); } #endif -- cgit v1.2.3