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 /engines/sword1/mouse.cpp | |
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 'engines/sword1/mouse.cpp')
-rw-r--r-- | engines/sword1/mouse.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/sword1/mouse.cpp b/engines/sword1/mouse.cpp index 6b72d2238a..eefdf99466 100644 --- a/engines/sword1/mouse.cpp +++ b/engines/sword1/mouse.cpp @@ -24,6 +24,8 @@ #include "common/endian.h" #include "common/system.h" +#include "graphics/cursorman.h" + #include "sword1/mouse.h" #include "sword1/menu.h" #include "sword1/screen.h" @@ -63,7 +65,7 @@ void Mouse::initialize(void) { for (uint8 cnt = 0; cnt < 17; cnt++) // force res manager to keep mouse _resMan->resOpen(MSE_POINTER + cnt); // cursors in memory all the time - _system->showMouse(false); + CursorMan.showMouse(false); createPointer(0, 0); } @@ -251,10 +253,10 @@ void Mouse::setPointer(uint32 resId, uint32 rate) { createPointer(resId, _currentLuggageId); if ((resId == 0) || (!(Logic::_scriptVars[MOUSE_STATUS] & 1) && (!_mouseOverride))) { - _system->showMouse(false); + CursorMan.showMouse(false); } else { animate(); - _system->showMouse(true); + CursorMan.showMouse(true); } } @@ -269,7 +271,7 @@ void Mouse::animate(void) { _frame = (_frame + 1) % _currentPtr->numFrames; uint8 *ptrData = (uint8*)_currentPtr + sizeof(MousePtr); ptrData += _frame * _currentPtr->sizeX * _currentPtr->sizeY; - _system->setMouseCursor(ptrData, _currentPtr->sizeX, _currentPtr->sizeY, _currentPtr->hotSpotX, _currentPtr->hotSpotY); + CursorMan.replaceCursor(ptrData, _currentPtr->sizeX, _currentPtr->sizeY, _currentPtr->hotSpotX, _currentPtr->hotSpotY); } } |