diff options
author | Matthew Hoops | 2010-11-25 04:49:11 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-11-25 04:49:11 +0000 |
commit | 07ea74d37b636f27c4fc0075f35ec4f4ad50501b (patch) | |
tree | 086d7f463df9e867e6f2d81d4b97c062a809aee5 /engines/mohawk/myst.cpp | |
parent | 4c733c427862fa45315e56bcba07e03bb3872ed2 (diff) | |
download | scummvm-rg350-07ea74d37b636f27c4fc0075f35ec4f4ad50501b.tar.gz scummvm-rg350-07ea74d37b636f27c4fc0075f35ec4f4ad50501b.tar.bz2 scummvm-rg350-07ea74d37b636f27c4fc0075f35ec4f4ad50501b.zip |
MOHAWK: Refactor cursor handling
Cursor handling has now been moved to a new CursorManager class (which is subclassed for Myst/Riven) from the GraphicsManager classes. This will be needed for Living Books which will have a class for Windows and Mac cursors (coming soon!).
svn-id: r54469
Diffstat (limited to 'engines/mohawk/myst.cpp')
-rw-r--r-- | engines/mohawk/myst.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 4a577464cc..b4ec087b61 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -27,6 +27,7 @@ #include "common/debug-channels.h" #include "common/translation.h" +#include "mohawk/cursors.h" #include "mohawk/graphics.h" #include "mohawk/myst.h" #include "mohawk/myst_saveload.h" @@ -238,6 +239,7 @@ Common::Error MohawkEngine_Myst::run() { _loadDialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load")); _loadDialog->setSaveMode(false); _optionsDialog = new MystOptionsDialog(this); + _cursor = new MystCursorManager(this); // Start us on the first stack. if (getGameType() == GType_MAKINGOF) @@ -273,8 +275,8 @@ Common::Error MohawkEngine_Myst::run() { loadHelp(10000); // Set the cursor - _gfx->changeCursor(_currentCursor); - _gfx->showCursor(); + _cursor->setCursor(_currentCursor); + _cursor->showCursor(); Common::Event event; while (!shouldQuit()) { @@ -822,7 +824,7 @@ void MohawkEngine_Myst::loadCursorHints() { void MohawkEngine_Myst::setMainCursor(uint16 cursor) { _currentCursor = _mainCursor = cursor; - _gfx->changeCursor(_currentCursor); + _cursor->setCursor(_currentCursor); } void MohawkEngine_Myst::checkCursorHints() { @@ -841,7 +843,7 @@ void MohawkEngine_Myst::checkCursorHints() { _currentCursor = _cursorHints[i].variableHint.values[var_value]; if (_currentCursor == 0) _currentCursor = _mainCursor; - _gfx->changeCursor(_currentCursor); + _cursor->setCursor(_currentCursor); } } else if (_currentCursor != _cursorHints[i].cursor) { if (_cursorHints[i].cursor == 0) @@ -849,14 +851,14 @@ void MohawkEngine_Myst::checkCursorHints() { else _currentCursor = _cursorHints[i].cursor; - _gfx->changeCursor(_currentCursor); + _cursor->setCursor(_currentCursor); } return; } if (_currentCursor != _mainCursor) { _currentCursor = _mainCursor; - _gfx->changeCursor(_currentCursor); + _cursor->setCursor(_currentCursor); } } |