diff options
author | Torbjörn Andersson | 2006-05-25 22:51:42 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-05-25 22:51:42 +0000 |
commit | 8062eb6ec33e32012da28f0cd06b8f9334c26937 (patch) | |
tree | 088c83206fbb0e4feea93ebeada0a505599572bb /gui | |
parent | d56c65bf4a47007dc874b70eb04be9ed7de27b01 (diff) | |
download | scummvm-rg350-8062eb6ec33e32012da28f0cd06b8f9334c26937.tar.gz scummvm-rg350-8062eb6ec33e32012da28f0cd06b8f9334c26937.tar.bz2 scummvm-rg350-8062eb6ec33e32012da28f0cd06b8f9334c26937.zip |
Set and show/hide mouse cursors through a "cursor manager" (analogous to the
recently added (cursor) palette manager) so that the cursor can be properly
restored after returning from the GUI.
If there's any C++ magic that can keep the backend functions from being called
by anything else than these managing classes, that would probably be a good
idea. Also, since the cursor manager keeps a copy of the cursor image, perhaps
there are at least some backends that will no longer need to?
svn-id: r22639
Diffstat (limited to 'gui')
-rw-r--r-- | gui/ThemeNew.cpp | 3 | ||||
-rw-r--r-- | gui/newgui.cpp | 8 | ||||
-rw-r--r-- | gui/newgui.h | 1 |
3 files changed, 6 insertions, 6 deletions
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp index 0ff6b45fa4..ca50e5d11a 100644 --- a/gui/ThemeNew.cpp +++ b/gui/ThemeNew.cpp @@ -27,6 +27,7 @@ #include "graphics/imageman.h" #include "graphics/imagedec.h" #include "graphics/colormasks.h" +#include "graphics/cursorman.h" #include "graphics/paletteman.h" #include "common/config-manager.h" @@ -1549,7 +1550,7 @@ OverlayColor ThemeNew::calcDimColor(OverlayColor col) { void ThemeNew::setUpCursor() { PaletteMan.pushCursorPalette(_cursorPal, 0, MAX_CURS_COLORS); - _system->setMouseCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale); + CursorMan.pushCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale); } void ThemeNew::createCursor() { diff --git a/gui/newgui.cpp b/gui/newgui.cpp index db45d94e3c..f0d58d8982 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -22,6 +22,7 @@ #include "common/stdafx.h" #include "common/system.h" #include "common/util.h" +#include "graphics/cursorman.h" #include "graphics/paletteman.h" #include "gui/newgui.h" #include "gui/dialog.h" @@ -156,6 +157,7 @@ void NewGui::runLoop() { }; PaletteMan.pushCursorPalette(palette, 0, 4); + CursorMan.pushCursor(NULL, 0, 0, 0, 0); } while (!_dialogStack.empty() && activeDialog == _dialogStack.top()) { @@ -286,8 +288,6 @@ void NewGui::runLoop() { void NewGui::saveState() { // Backup old cursor - _oldCursorMode = _system->showMouse(true); - _currentKeyDown.keycode = 0; _lastClick.x = _lastClick.y = 0; _lastClick.time = 0; @@ -297,7 +297,7 @@ void NewGui::saveState() { } void NewGui::restoreState() { - _system->showMouse(_oldCursorMode); + CursorMan.popCursor(); _system->updateScreen(); @@ -333,7 +333,7 @@ void NewGui::animateCursor() { } } - _system->setMouseCursor(_cursor, 16, 16, 7, 7); + CursorMan.replaceCursor(_cursor, 16, 16, 7, 7); _cursorAnimateTimer = time; _cursorAnimateCounter = (_cursorAnimateCounter + 1) % 4; diff --git a/gui/newgui.h b/gui/newgui.h index 58bdf4715b..055f616131 100644 --- a/gui/newgui.h +++ b/gui/newgui.h @@ -107,7 +107,6 @@ protected: } _lastClick; // mouse cursor state - bool _oldCursorMode; int _cursorAnimateCounter; int _cursorAnimateTimer; byte _cursor[2048]; |