aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/openpandora/op-graphics.cpp
diff options
context:
space:
mode:
authorDavid-John Willis2012-07-24 10:05:42 +0100
committerDavid-John Willis2012-07-24 10:08:58 +0100
commit6f978ee78b19be19329adef2618d814012440071 (patch)
tree96fcbb80db2f8d6326301bcd2ffe8b5b15356f1a /backends/graphics/openpandora/op-graphics.cpp
parent45354676ebe14df8d382681621f1d994258dbb72 (diff)
downloadscummvm-rg350-6f978ee78b19be19329adef2618d814012440071.tar.gz
scummvm-rg350-6f978ee78b19be19329adef2618d814012440071.tar.bz2
scummvm-rg350-6f978ee78b19be19329adef2618d814012440071.zip
OPENPANDORA: Free hiddenCursor on unloadGFXMode and cleanup screen setup.
* Also remove some old cruft in the form of commented code.
Diffstat (limited to 'backends/graphics/openpandora/op-graphics.cpp')
-rw-r--r--backends/graphics/openpandora/op-graphics.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/backends/graphics/openpandora/op-graphics.cpp b/backends/graphics/openpandora/op-graphics.cpp
index 1a3d7d3e2e..f371081fde 100644
--- a/backends/graphics/openpandora/op-graphics.cpp
+++ b/backends/graphics/openpandora/op-graphics.cpp
@@ -26,7 +26,6 @@
#include "backends/graphics/openpandora/op-graphics.h"
#include "backends/events/openpandora/op-events.h"
-//#include "backends/platform/openpandora/op-sdl.h"
#include "graphics/scaler/aspect.h"
#include "common/mutex.h"
#include "common/textconsole.h"
@@ -54,18 +53,32 @@ bool OPGraphicsManager::loadGFXMode() {
SDL_ShowCursor(SDL_ENABLE);
SDL_SetCursor(hiddenCursor);
- /* FIXME: For now we just cheat and set the overlay to 640*480 not 800*480 and let SDL
- deal with the boarders (it saves cleaning up the overlay when the game screen is
- smaller than the overlay ;)
- */
- //_videoMode.overlayWidth = 640;
- //_videoMode.overlayHeight = 480;
_videoMode.fullscreen = true;
+ _videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+ _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
+
if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400)
_videoMode.aspectRatioCorrection = false;
+ if (_videoMode.aspectRatioCorrection)
+ _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
+
+ _videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+ _videoMode.hardwareHeight = effectiveScreenHeight();
+
return SurfaceSdlGraphicsManager::loadGFXMode();
}
+void OPGraphicsManager::unloadGFXMode() {
+
+ uint8_t hiddenCursorData = 0;
+ hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0);
+
+ // Free the hidden SDL cursor created in loadGFXMode
+ SDL_FreeCursor(hiddenCursor);
+
+ SurfaceSdlGraphicsManager::unloadGFXMode();
+}
+
#endif