From 28d33e01e97c43c68244ec536b4d4380d5282cc5 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 18 Dec 2008 20:36:16 +0000 Subject: Fixed cursor palette when returning from GMM/Debugger. (Thanks to jvprat for testing) svn-id: r35428 --- engines/groovie/cursor.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp index 31f1caca3c..de52e77d99 100644 --- a/engines/groovie/cursor.cpp +++ b/engines/groovie/cursor.cpp @@ -26,6 +26,13 @@ #include "groovie/cursor.h" #include "groovie/groovie.h" +#include "graphics/cursorman.h" + +// HACK: Since CursorMan is the name of the global +// cursor manager we just undefine it here +#define GlobCursorMan (::Graphics::CursorManager::instance()) +#undef CursorMan + namespace Groovie { // Cursor Manager @@ -39,6 +46,8 @@ CursorMan::~CursorMan() { for (uint cursor = 0; cursor < _cursors.size(); cursor++) { delete _cursors[cursor]; } + + GlobCursorMan.popAllCursors(); } uint8 CursorMan::getStyle() { @@ -104,13 +113,13 @@ Cursor_t7g::Cursor_t7g(OSystem *system, uint8 *img, uint8 *pal) : void Cursor_t7g::enable() { // Apply the palette - _syst->setCursorPalette(_pal, 0, 32); + GlobCursorMan.replaceCursorPalette(_pal, 0, 32); } void Cursor_t7g::showFrame(uint16 frame) { // Set the mouse cursor int offset = _width * _height * frame; - _syst->setMouseCursor((const byte *)_img + offset, _width, _height, _width >> 1, _height >> 1, 0); + GlobCursorMan.replaceCursor((const byte *)_img + offset, _width, _height, _width >> 1, _height >> 1, 0); } -- cgit v1.2.3