diff options
author | Strangerke | 2013-09-28 10:11:21 +0200 |
---|---|---|
committer | Strangerke | 2013-09-28 10:11:21 +0200 |
commit | 726fa64bbf04dc84b78d9a165652cdeced7f4cde (patch) | |
tree | eaa53953d412f5465159034dcfd446608b3303e5 /engines/avalanche | |
parent | 7d66cdf417f4e4673004fd5802e4a9649e38d179 (diff) | |
download | scummvm-rg350-726fa64bbf04dc84b78d9a165652cdeced7f4cde.tar.gz scummvm-rg350-726fa64bbf04dc84b78d9a165652cdeced7f4cde.tar.bz2 scummvm-rg350-726fa64bbf04dc84b78d9a165652cdeced7f4cde.zip |
AVALANCHE: Use an enum for the Mouse cursor identifier
Diffstat (limited to 'engines/avalanche')
-rw-r--r-- | engines/avalanche/avalanche.h | 1 | ||||
-rw-r--r-- | engines/avalanche/avalot.cpp | 24 | ||||
-rw-r--r-- | engines/avalanche/dialogs.cpp | 6 | ||||
-rw-r--r-- | engines/avalanche/enums.h | 4 | ||||
-rw-r--r-- | engines/avalanche/menu.cpp | 10 |
5 files changed, 20 insertions, 25 deletions
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 1d36c4c640..5736291ad7 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -348,7 +348,6 @@ public: void spriteRun(); Common::String intToStr(int32 num); - void setMousePointerWait(); // Makes hourglass. void setBackgroundColor(byte x); diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 33bffb0f52..bb69de864b 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -237,7 +237,7 @@ void Clock::chime() { if (hour == 0) hour = 12; - _vm->setMousePointerWait(); + _vm->_graphics->loadMouse(kCurWait); for (int i = 1; i <= hour; i++) { for (int j = 1; j <= 3; j++) @@ -420,7 +420,7 @@ void AvalancheEngine::init() { _scoreToDisplay[i] = -1; // Impossible digits. _holdTheDawn = false; - setMousePointerWait(); + _graphics->loadMouse(kCurWait); CursorMan.showMouse(true); } @@ -1082,7 +1082,7 @@ void AvalancheEngine::thinkAbout(byte object, bool type) { _thinks = object; object--; - setMousePointerWait(); + _graphics->loadMouse(kCurWait); if (type == kThing) { if (!file.open("thinks.avd")) @@ -1286,17 +1286,17 @@ void AvalancheEngine::checkClick() { after_the_scroll = false;*/ if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) - _graphics->loadMouse(0); // up arrow + _graphics->loadMouse(kCurUpArrow); // up arrow else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) - _graphics->loadMouse(7); //I-beam + _graphics->loadMouse(kCurIBeam); //I-beam else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) - _graphics->loadMouse(1); // screwdriver + _graphics->loadMouse(kCurScrewDriver); // screwdriver else if (!_menu->isActive()) { // Dropdown can handle its own pointers. if (_holdLeftMouse) { - _graphics->loadMouse(6); // Mark's crosshairs + _graphics->loadMouse(kCurCrosshair); // Mark's crosshairs guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around. } else - _graphics->loadMouse(3); // fletch + _graphics->loadMouse(kCurFletch); // fletch } if (_holdLeftMouse) { @@ -1454,14 +1454,6 @@ Common::String AvalancheEngine::intToStr(int32 num) { return Common::String::format("%d", num); } -/** - * Set the mouse pointer to 'HourGlass" - * @remarks Originally called 'wait' - */ -void AvalancheEngine::setMousePointerWait() { - _graphics->loadMouse(4); -} - void AvalancheEngine::resetVariables() { _animation->setDirection(kDirUp); _carryNum = 0; diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index d37d7592a4..32bf369068 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -115,7 +115,7 @@ void Dialogs::scrollModeNormal() { setReadyLight(3); _vm->_seeScroll = true; - _vm->_graphics->loadMouse(3); + _vm->_graphics->loadMouse(kCurFletch); ::Graphics::Surface temp; temp.copyFrom(_vm->_graphics->_surface); @@ -206,7 +206,7 @@ void Dialogs::scrollModeDialogue() { warning("STUB: Scrolls::scrollModeDialogue()"); // It should work with keypresses too! TODO: Implement it! - _vm->_graphics->loadMouse(5); + _vm->_graphics->loadMouse(kCurHand); ::Graphics::Surface temp; temp.copyFrom(_vm->_graphics->_surface); @@ -254,7 +254,7 @@ void Dialogs::scrollModeMusic() { setReadyLight(3); _vm->_seeScroll = true; CursorMan.showMouse(false); - _vm->_graphics->loadMouse(3); + _vm->_graphics->loadMouse(kCurFletch); TuneType played; for (unsigned int i = 0; i < sizeof(played); i++) diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h index a25b58e938..4abd35c0fc 100644 --- a/engines/avalanche/enums.h +++ b/engines/avalanche/enums.h @@ -87,4 +87,8 @@ enum VerbCode { } // End of namespace Avalanche +enum MouseCursor { + kCurUpArrow = 0, kCurScrewDriver = 1, kCurRightArrow = 2, kCurFletch = 3, kCurWait = 4, kCurHand = 5, + kCurCrosshair = 6, kCurIBeam = 7 +}; #endif // AVALANCHE_ENUMS_H diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp index c868765047..7beacc86b2 100644 --- a/engines/avalanche/menu.cpp +++ b/engines/avalanche/menu.cpp @@ -697,18 +697,18 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it... do { _vm->updateEvents(); - // We updadte the cursor's picture. + // We update the cursor's picture. cursorPos = _vm->getMousePos(); // Change arrow... if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) - _vm->_graphics->loadMouse(0); // Up arrow + _vm->_graphics->loadMouse(kCurUpArrow); // Up arrow else if ((22 <= cursorPos.y) && (cursorPos.y <= 339)) { if ((cursorPos.x >= _activeMenuItem._flx1 * 8) && (cursorPos.x <= _activeMenuItem._flx2 * 8) && (cursorPos.y > 21) && (cursorPos.y <= _activeMenuItem._fly * 2 + 1)) - _vm->_graphics->loadMouse(2); // Right-arrow + _vm->_graphics->loadMouse(kCurRightArrow); // Right-arrow else - _vm->_graphics->loadMouse(3); // Fletch + _vm->_graphics->loadMouse(kCurFletch); // Fletch } else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) - _vm->_graphics->loadMouse(1); // Screwdriver + _vm->_graphics->loadMouse(kCurScrewDriver); // Screwdriver _activeMenuItem.lightUp(cursorPos); |