diff options
author | Adrian Frühwirth | 2018-03-04 23:23:23 +0100 |
---|---|---|
committer | Adrian Frühwirth | 2018-03-14 21:59:17 +0100 |
commit | 57479c2fa45554e8b75843de4d3366758ee7bc9d (patch) | |
tree | 4ee30f149c90849c2dba7879ffd23784644f0364 | |
parent | 0df574abda0b9f1ca1bce8a34e59810ec5e42285 (diff) | |
download | scummvm-rg350-57479c2fa45554e8b75843de4d3366758ee7bc9d.tar.gz scummvm-rg350-57479c2fa45554e8b75843de4d3366758ee7bc9d.tar.bz2 scummvm-rg350-57479c2fa45554e8b75843de4d3366758ee7bc9d.zip |
TUCKER: Use Verb enum in even more places
-rw-r--r-- | engines/tucker/tucker.cpp | 21 | ||||
-rw-r--r-- | engines/tucker/tucker.h | 11 |
2 files changed, 19 insertions, 13 deletions
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index 6673164589..59506bde7e 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -986,19 +986,21 @@ void TuckerEngine::updateFlagsForCharPosition() { return; } switch (_previousActionVerb) { - case 3: - case 4: - case 8: - case 2: + case kVerbTalk: + case kVerbOpen: + case kVerbClose: + case kVerbUse: debug(3, "updateFlagsForCharPosition() set flag %d value %d", _charPositionFlagNum, _charPositionFlagValue); _flagsTable[_charPositionFlagNum] = _charPositionFlagValue; break; - case 6: + case kVerbTake: if (_charPositionFlagValue == 1) { addObjectToInventory(_charPositionFlagNum); _forceRedrawPanelItems = true; } break; + default: + break; } if (_pendingActionIndex > 0) { _nextAction = _pendingActionIndex; @@ -1058,9 +1060,10 @@ void TuckerEngine::updateCursor() { } if (_rightMouseButtonPressed) { if (!_updateCursorFlag) { - ++_actionVerb; - if (_actionVerb > 8) { - _actionVerb = kVerbWalk; + if (_actionVerb == kVerbLast) { + _actionVerb = kVerbFirst; + } else { + _actionVerb = (Verb)(_actionVerb + 1); } _updateCursorFlag = true; _actionVerbLocked = true; @@ -3473,7 +3476,7 @@ void TuckerEngine::setActionVerbUnderCursor() { } else if (_mousePosX > 195) { _actionVerb = kVerbLook; } else if (_panelStyle == kPanelStyleVerbs) { - _actionVerb = ((_mousePosY - 150) / 17) * 3 + (_mousePosX / 67); + _actionVerb = (Verb)(((_mousePosY - 150) / 17) * 3 + (_mousePosX / 67)); } else { _actionVerb = kVerbWalk; if (_mousePosX < 30) { diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 2972052ce2..6088231afd 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -95,7 +95,10 @@ enum Verb { kVerbGive = 5, kVerbTake = 6, kVerbMove = 7, - kVerbUse = 8 + kVerbUse = 8, + + kVerbFirst = kVerbWalk, + kVerbLast = kVerbUse }; enum VerbPreposition { @@ -798,7 +801,9 @@ protected: int _pendingActionDelay; int _charPositionFlagNum; int _charPositionFlagValue; - int _actionVerb; + Verb _actionVerb; + Verb _currentActionVerb; + Verb _previousActionVerb; int _nextAction; int _selectedObjectNum; int _selectedObjectType; @@ -865,8 +870,6 @@ protected: int _characterAnimationsTable[200]; int _characterStateTable[200]; int _backgroundSprOffset; - int _currentActionVerb; - int _previousActionVerb; int _mainSpritesBaseOffset; int _currentSpriteAnimationLength; int _currentSpriteAnimationFrame; |