diff options
Diffstat (limited to 'engines/fullpipe/scenes')
-rw-r--r-- | engines/fullpipe/scenes/scene26.cpp | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/engines/fullpipe/scenes/scene26.cpp b/engines/fullpipe/scenes/scene26.cpp index 3ddd6386a1..8a0a39e5af 100644 --- a/engines/fullpipe/scenes/scene26.cpp +++ b/engines/fullpipe/scenes/scene26.cpp @@ -196,8 +196,60 @@ void sceneHandler26_hideVent() { g_vars->scene26_var05->hide(); } -void sceneHandler26_sub01(StaticANIObject *ani) { - warning("STUB: sceneHandler26_sub01()"); +void sceneHandler26_animateVents(StaticANIObject *ani) { + int qId = 0; + + switch (ani->_okeyCode) { + case 0: + if (g_fp->getObjectState(sO_Valve1_26) == g_fp->getObjectEnumState(sO_Valve1_26, sO_Closed)) + qId = QU_SC26_OPEN1; + else + qId = QU_SC26_CLOSE1; + + break; + + case 1: + if (g_fp->getObjectState(sO_Valve2_26) == g_fp->getObjectEnumState(sO_Valve2_26, sO_Closed)) + qId = QU_SC26_OPEN2; + else + qId = QU_SC26_CLOSE2; + + break; + + case 2: + if (g_fp->getObjectState(sO_Valve3_26) == g_fp->getObjectEnumState(sO_Valve3_26, sO_Closed)) + qId = QU_SC26_OPEN3; + else + qId = QU_SC26_CLOSE3; + + break; + + case 3: + if (g_fp->getObjectState(sO_Valve4_26) == g_fp->getObjectEnumState(sO_Valve4_26, sO_Closed)) + qId = QU_SC26_OPEN4; + else + qId = QU_SC26_CLOSE4; + + break; + + case 4: + if (g_fp->getObjectState(sO_Valve5_26) == g_fp->getObjectEnumState(sO_Valve5_26, sO_Closed)) + qId = QU_SC26_OPEN5; + else + qId = QU_SC26_CLOSE5; + + break; + + default: + return; + } + + if (qId) { + MessageQueue *mq = g_fp->_currentScene->getMessageQueueById(qId); + + mq->setFlags(mq->getFlags() | 1); + mq->chain(0); + } } void sceneHandler26_clickVent(StaticANIObject *ani, ExCommand *cmd) { @@ -222,7 +274,7 @@ void sceneHandler26_clickVent(StaticANIObject *ani, ExCommand *cmd) { postExCommand(g_fp->_aniMan->_id, 2, x, y, 0, -1); } } else { - sceneHandler26_sub01(ani); + sceneHandler26_animateVents(ani); } } } |