diff options
author | Eugene Sandulenko | 2015-12-14 09:26:55 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:34:04 +0100 |
commit | a7d5ae6b4b172e3f098358a5fb70175ebff5f056 (patch) | |
tree | 8523c93a6105abecc084200dbf8e4257cbe907fa /engines/lab | |
parent | 79eec20361530fa18577e89d1623948ca2a8d271 (diff) | |
download | scummvm-rg350-a7d5ae6b4b172e3f098358a5fb70175ebff5f056.tar.gz scummvm-rg350-a7d5ae6b4b172e3f098358a5fb70175ebff5f056.tar.bz2 scummvm-rg350-a7d5ae6b4b172e3f098358a5fb70175ebff5f056.zip |
LAB: Converted ifs into switch()
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/engine.cpp | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index 552bdf8645..892634ba17 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -865,7 +865,8 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo buttonId--; - if (buttonId == 0) { + switch (buttonId) { + case 0: interfaceOff(); _anim->stopDiff(); _curFileName = " "; @@ -887,7 +888,10 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo g_system->delayMillis(1000); } _graphics->screenUpdate(); - } else if (buttonId == 1) { + + break; + + case 1: if (!doUse(curInv)) { uint16 oldActionMode = actionMode; // Use button @@ -901,7 +905,10 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _graphics->screenUpdate(); } - } else if (buttonId == 2) { + + break; + + case 2: _mainDisplay = !_mainDisplay; if ((curInv == 0) || (curInv > _numInv)) { @@ -915,7 +922,10 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _nextFileName = getInvName(curInv); _graphics->screenUpdate(); - } else if (buttonId == 3) { + + break; + + case 3: // Left button decIncInv(&curInv, true); lastInv = curInv; @@ -923,7 +933,10 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo drawRoomMessage(curInv, _closeDataPtr); _graphics->screenUpdate(); - } else if (buttonId == 4) { + + break; + + case 4: // Right button decIncInv(&curInv, false); lastInv = curInv; @@ -931,14 +944,20 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo drawRoomMessage(curInv, _closeDataPtr); _graphics->screenUpdate(); - } else if (buttonId == 5) { + + break; + + case 5: // bread crumbs _breadCrumbs[0]._roomNum = 0; _numCrumbs = 0; _droppingCrumbs = true; mayShowCrumbIndicator(); _graphics->screenUpdate(); - } else if (buttonId == 6) { + + break; + + case 6: // follow crumbs if (_droppingCrumbs) { if (_numCrumbs > 0) { @@ -968,6 +987,7 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _graphics->screenUpdate(); } } + break; } } else if ((msgClass == MOUSEBUTTONS) && (IEQUALIFIER_LEFTBUTTON & qualifier) && _mainDisplay) { interfaceOff(); |