diff options
author | Eugene Sandulenko | 2014-01-18 12:01:06 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2014-01-18 12:01:06 +0200 |
commit | 8a229f5a665037d0cdf65ae77c818b7c92cd19e8 (patch) | |
tree | 19c18ac3d871105196391433819db72c9e5ce086 /engines/fullpipe/scenes/scene37.cpp | |
parent | 9a4d233fc5457687474c0b08c6e828beb8cafeb4 (diff) | |
download | scummvm-rg350-8a229f5a665037d0cdf65ae77c818b7c92cd19e8.tar.gz scummvm-rg350-8a229f5a665037d0cdf65ae77c818b7c92cd19e8.tar.bz2 scummvm-rg350-8a229f5a665037d0cdf65ae77c818b7c92cd19e8.zip |
FULLPIPE: Implement sceneHandler37()
Diffstat (limited to 'engines/fullpipe/scenes/scene37.cpp')
-rw-r--r-- | engines/fullpipe/scenes/scene37.cpp | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/engines/fullpipe/scenes/scene37.cpp b/engines/fullpipe/scenes/scene37.cpp index 0383212b84..9bbc6ea901 100644 --- a/engines/fullpipe/scenes/scene37.cpp +++ b/engines/fullpipe/scenes/scene37.cpp @@ -160,4 +160,107 @@ int scene37_updateCursor() { return g_fp->_cursorId; } +void sceneHandler37_updateRing(int num) { + warning("STUB: sceneHandler37_updateRing()"); +} + +void sceneHandler37_setRingsState() { + warning("STUB: sceneHandler37_setRingsState()"); +} + +int sceneHandler37(ExCommand *cmd) { + if (cmd->_messageKind != 17) + return 0; + + switch(cmd->_messageNum) { + case MSG_SC37_EXITLEFT: + sceneHandler37_updateRing(0); + sceneHandler37_updateRing(1); + sceneHandler37_updateRing(2); + + break; + + case 29: + { + StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY); + + if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) { + int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY); + PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0); + + if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) { + if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1) + || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) { + g_fp->processArcade(cmd); + break; + } + } + } + } + + break; + + case 33: + if (g_fp->_aniMan2) { + int x = g_fp->_aniMan2->_ox; + + g_vars->scene37_var10 = x; + + if (x >= 500) { + if (x < g_fp->_sceneRect.left + g_vars->scene37_var01) + g_fp->_currentScene->_x = x - g_vars->scene37_var03 - g_fp->_sceneRect.left; + } else { + g_fp->_currentScene->_x = -g_fp->_sceneRect.left; + } + x = g_vars->scene37_var10; + + if (x > g_fp->_sceneRect.right - g_vars->scene37_var01) + g_fp->_currentScene->_x = x + g_vars->scene37_var03 - g_fp->_sceneRect.right; + } + + sceneHandler37_setRingsState(); + + g_fp->_behaviorManager->updateBehaviors(); + g_fp->startSceneTrack(); + + ++g_vars->scene37_var09; + + break; + + case MSG_SC37_PULL: + if (g_vars->scene37_var05[0]->ani->_movement && g_vars->scene37_var05[0]->ani->_movement->_id == MV_GRD37_PULL) { + if ((g_fp->getObjectState(sO_Guard_1) == g_fp->getObjectEnumState(sO_Guard_1, sO_On) && !g_vars->scene37_var05[0]->state) + || (g_fp->getObjectState(sO_Guard_1) == g_fp->getObjectEnumState(sO_Guard_1, sO_Off) && g_vars->scene37_var05[0]->state)) { + g_vars->scene37_plusMinus1->_statics = g_vars->scene37_plusMinus1->getStaticsById(ST_PMS_PLUS); + } else { + g_vars->scene37_plusMinus1->_statics = g_vars->scene37_plusMinus1->getStaticsById(ST_PMS_MINUS); + } + } else if (g_vars->scene37_var05[1]->ani->_movement && g_vars->scene37_var05[1]->ani->_movement->_id == MV_GRD37_PULL) { + if ((g_fp->getObjectState(sO_Guard_2) == g_fp->getObjectEnumState(sO_Guard_2, sO_On) && !g_vars->scene37_var05[1]->state) + || (g_fp->getObjectState(sO_Guard_2) == g_fp->getObjectEnumState(sO_Guard_2, sO_Off) && g_vars->scene37_var05[1]->state)) { + g_vars->scene37_plusMinus2->_statics = g_vars->scene37_plusMinus2->getStaticsById(ST_PMS_PLUS); + } else { + g_vars->scene37_plusMinus2->_statics = g_vars->scene37_plusMinus2->getStaticsById(ST_PMS_MINUS); + } + } else if (g_vars->scene37_var05[2]->ani->_movement && g_vars->scene37_var05[2]->ani->_movement->_id == MV_GRD37_PULL) { + if ((g_fp->getObjectState(sO_Guard_3) == g_fp->getObjectEnumState(sO_Guard_3, sO_On) && !g_vars->scene37_var05[2]->state) + || (g_fp->getObjectState(sO_Guard_3) == g_fp->getObjectEnumState(sO_Guard_3, sO_Off) && g_vars->scene37_var05[2]->state)) { + g_vars->scene37_plusMinus3->_statics = g_vars->scene37_plusMinus3->getStaticsById(ST_PMS_PLUS); + } else { + g_vars->scene37_plusMinus3->_statics = g_vars->scene37_plusMinus3->getStaticsById(ST_PMS_MINUS); + } + } + + if (g_vars->scene37_var09) { + g_fp->playSound(SND_37_007, 0); + + g_vars->scene37_var09 = 0; + } + + break; + } + + return 0; +} + } // End of namespace Fullpipe |