diff options
author | Filippos Karapetis | 2015-12-15 01:01:44 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:34:05 +0100 |
commit | b661f2f8e69986ce93bea14847fc8f00208888e0 (patch) | |
tree | 58002961f409e86df8043c513f1355542f6fa4a0 /engines | |
parent | 521652e436f91cbbe32f2a5bc98a79ee1633f9af (diff) | |
download | scummvm-rg350-b661f2f8e69986ce93bea14847fc8f00208888e0.tar.gz scummvm-rg350-b661f2f8e69986ce93bea14847fc8f00208888e0.tar.bz2 scummvm-rg350-b661f2f8e69986ce93bea14847fc8f00208888e0.zip |
LAB: Use enums for the interface buttons
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lab/engine.cpp | 76 |
1 files changed, 48 insertions, 28 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index e9afb7dd69..00df1ebc4a 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -81,6 +81,30 @@ enum Monitors { //kMonitorLevers = 82 }; +enum MainButtons { + kButtonPickup, + kButtonUse, + kButtonOpen, + kButtonClose, + kButtonLook, + kButtonInventory, + kButtonLeft, + kButtonForward, + kButtonRight, + kButtonMap +}; + +enum AltButtons { + kButtonMainDisplay, + kButtonSaveLoad, + kButtonUseItem, + kButtonLookAtItem, + kButtonPrevItem, + kButtonNextItem, + kButtonBreadCrumbs, + kButtonFollowCrumbs +}; + static char initcolors[] = { '\x00', '\x00', '\x00', '\x30', '\x30', '\x30', '\x10', '\x10', '\x10', '\x14', '\x14', '\x14', @@ -879,11 +903,11 @@ void LabEngine::processMainButton(CloseDataPtr wrkClosePtr, uint16 &curInv, uint uint16 newDir; switch (buttonId) { - case 0: - case 1: - case 2: - case 3: - case 4: + case kButtonPickup: + case kButtonUse: + case kButtonOpen: + case kButtonClose: + case kButtonLook: if ((actionMode == 4) && (buttonId == 4) && _closeDataPtr) { doMainView(&_closeDataPtr); @@ -903,7 +927,7 @@ void LabEngine::processMainButton(CloseDataPtr wrkClosePtr, uint16 &curInv, uint drawStaticMessage(kTextTakeWhat + buttonId); } break; - case 5: + case kButtonInventory: eatMessages(); _alternate = true; @@ -926,15 +950,8 @@ void LabEngine::processMainButton(CloseDataPtr wrkClosePtr, uint16 &curInv, uint mayShowCrumbIndicator(); break; - case 9: - doUse(kItemMap); - - mayShowCrumbIndicator(); - break; - - case 6: - case 8: - // Arrow Buttons + case kButtonLeft: + case kButtonRight: _closeDataPtr = nullptr; wrkClosePtr = nullptr; if (buttonId == 6) @@ -955,7 +972,7 @@ void LabEngine::processMainButton(CloseDataPtr wrkClosePtr, uint16 &curInv, uint mayShowCrumbIndicator(); break; - case 7: + case kButtonForward: _closeDataPtr = nullptr; wrkClosePtr = nullptr; uint16 oldRoomNum = _roomNum; @@ -1025,7 +1042,13 @@ void LabEngine::processMainButton(CloseDataPtr wrkClosePtr, uint16 &curInv, uint mayShowCrumbIndicator(); break; + case kButtonMap: + doUse(kItemMap); + + mayShowCrumbIndicator(); + break; } + _graphics->screenUpdate(); } @@ -1035,7 +1058,7 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI _anim->_doBlack = true; switch (buttonId) { - case 0: + case kButtonMainDisplay: eatMessages(); _alternate = false; _anim->_doBlack = true; @@ -1048,7 +1071,7 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI drawRoomMessage(curInv, _closeDataPtr); break; - case 1: + case kButtonSaveLoad: interfaceOff(); _anim->stopDiff(); _curFileName = " "; @@ -1071,7 +1094,7 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI } break; - case 2: + case kButtonUseItem: if (!doUse(curInv)) { uint16 oldActionMode = actionMode; // Use button @@ -1085,7 +1108,7 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI } break; - case 3: + case kButtonLookAtItem: _mainDisplay = !_mainDisplay; if ((curInv == 0) || (curInv > _numInv)) { @@ -1100,32 +1123,28 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI break; - case 4: - // Left button + case kButtonPrevItem: decIncInv(&curInv, true); lastInv = curInv; _graphics->_doNotDrawMessage = false; drawRoomMessage(curInv, _closeDataPtr); break; - case 5: - // Right button + case kButtonNextItem: decIncInv(&curInv, false); lastInv = curInv; _graphics->_doNotDrawMessage = false; drawRoomMessage(curInv, _closeDataPtr); break; - case 6: - // bread crumbs + case kButtonBreadCrumbs: _breadCrumbs[0]._roomNum = 0; _numCrumbs = 0; _droppingCrumbs = true; mayShowCrumbIndicator(); break; - case 7: - // follow crumbs + case kButtonFollowCrumbs: if (_droppingCrumbs) { if (_numCrumbs > 0) { _followingCrumbs = true; @@ -1155,6 +1174,7 @@ void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonI } break; } + _graphics->screenUpdate(); } |