diff options
author | Eugene Sandulenko | 2014-01-18 13:42:18 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2014-01-18 13:42:18 +0200 |
commit | ce69278a48b5763270d14127bc74963627b3f4eb (patch) | |
tree | 2454867795be87fbd1184fce36ea6cb9239c5ad8 | |
parent | 7445f8935320739f81dd7a31bc039b37453eea87 (diff) | |
download | scummvm-rg350-ce69278a48b5763270d14127bc74963627b3f4eb.tar.gz scummvm-rg350-ce69278a48b5763270d14127bc74963627b3f4eb.tar.bz2 scummvm-rg350-ce69278a48b5763270d14127bc74963627b3f4eb.zip |
FULLPIPE: Implement sceneHandler37_updateRing()
-rw-r--r-- | engines/fullpipe/constants.h | 3 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene37.cpp | 40 |
2 files changed, 41 insertions, 2 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 13c1da6830..29680486c3 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -1290,8 +1290,11 @@ namespace Fullpipe { #define MSG_SC37_EXITLEFT 5006 #define MSG_SC37_PULL 2945 #define MV_GRD37_PULL 2589 +#define MV_RNG_CLOSE 2605 +#define MV_RNG_OPEN 4612 #define PIC_SC37_MASK 2608 #define SND_37_007 4547 +#define ST_GRD37_STAND 2590 #define ST_RNG_CLOSED2 4865 #define ST_RNG_OPEN 2606 diff --git a/engines/fullpipe/scenes/scene37.cpp b/engines/fullpipe/scenes/scene37.cpp index a20eaab4ca..82cf5e4d79 100644 --- a/engines/fullpipe/scenes/scene37.cpp +++ b/engines/fullpipe/scenes/scene37.cpp @@ -160,8 +160,44 @@ int scene37_updateCursor() { return g_fp->_cursorId; } -void sceneHandler37_updateRing(int num) { - warning("STUB: sceneHandler37_updateRing()"); +void sceneHandler37_updateRing(int ringNum) { + g_vars->scene37_var05[ringNum]->ani->changeStatics2(ST_GRD37_STAND); + g_vars->scene37_var05[ringNum]->ani->startAnim(MV_GRD37_PULL, 0, -1); + g_vars->scene37_var05[ringNum]->state = !g_vars->scene37_var05[ringNum]->state; + + StaticANIObject *ani; + + for (int i = 0; i < g_vars->scene37_var05[ringNum]->numSubRings; i++) { + ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_RING, g_vars->scene37_var05[ringNum]->subRings[i]); + + if ((ani->_movement && ani->_movement->_id != MV_RNG_CLOSE) || ani->_statics->_staticsId != ST_RNG_CLOSED2) { + ani->changeStatics2(ST_RNG_OPEN); + ani->startAnim(MV_RNG_CLOSE, 0, -1); + } else { + ani->changeStatics2(ST_RNG_CLOSED2); + ani->startAnim(MV_RNG_OPEN, 0, -1); + } + } + + g_vars->scene37_var07 = 1; + + for (int j = 0; j < g_vars->scene37_var05.size(); j++) { + for (int i = 0; i < g_vars->scene37_var05[ringNum]->numSubRings; i++) { + ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_RING, g_vars->scene37_var05[j]->subRings[i]); + + if ((ani->_movement && ani->_movement->_id != MV_RNG_CLOSE) || ani->_statics->_staticsId != ST_RNG_CLOSED2) + g_vars->scene37_var07 = 0; + } + } + + int state; + + if (g_vars->scene37_var07) + state = g_fp->getObjectEnumState(sO_LeftPipe_37, sO_IsOpened); + else + state = g_fp->getObjectEnumState(sO_LeftPipe_37, sO_IsClosed); + + g_fp->setObjectState(sO_LeftPipe_37, state); } void sceneHandler37_setRingsState() { |