diff options
Diffstat (limited to 'engines/fullpipe/scenes/scene37.cpp')
-rw-r--r-- | engines/fullpipe/scenes/scene37.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/engines/fullpipe/scenes/scene37.cpp b/engines/fullpipe/scenes/scene37.cpp index 0e5685f4a9..ba181642df 100644 --- a/engines/fullpipe/scenes/scene37.cpp +++ b/engines/fullpipe/scenes/scene37.cpp @@ -52,6 +52,11 @@ void scene37_initScene(Scene *sc) { Ring *ring; StaticANIObject *ani; + for (uint i = 0; i < g_vars->scene37_rings.size(); i++) + delete g_vars->scene37_rings[i]; + + g_vars->scene37_rings.clear(); + g_vars->scene37_lastDudeX = -1; ring = new Ring(); @@ -96,7 +101,7 @@ void scene37_initScene(Scene *sc) { g_fp->_currentScene = sc; - g_vars->scene37_cursorIsLocked = false; + g_vars->scene37_pipeIsOpen = false; g_vars->scene37_plusMinus1 = sc->getStaticANIObject1ById(ANI_PLUSMINUS, 1); @@ -149,7 +154,7 @@ int scene37_updateCursor() { g_fp->updateCursorCommon(); if (g_fp->_cursorId == PIC_CSR_ITN && g_fp->_objectIdAtCursor == PIC_SC37_MASK) { - if (g_vars->scene37_cursorIsLocked) + if (g_vars->scene37_pipeIsOpen) g_fp->_cursorId = PIC_CSR_GOL; } @@ -175,20 +180,29 @@ void sceneHandler37_updateRing(int ringNum) { } } - g_vars->scene37_cursorIsLocked = true; + g_vars->scene37_pipeIsOpen = true; + + for (uint i = 0; i < g_vars->scene37_rings.size(); i++) { + for (int j = 0; j < g_vars->scene37_rings[i]->numSubRings; j++) { + ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_RING, g_vars->scene37_rings[i]->subRings[j]); - for (uint j = 0; j < g_vars->scene37_rings.size(); j++) { - for (int i = 0; i < g_vars->scene37_rings[ringNum]->numSubRings; i++) { - ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_RING, g_vars->scene37_rings[j]->subRings[i]); + debugC(2, kDebugSceneLogic, "ring[%d][%d]: mov: %d st: %d", i, j, (ani->_movement ? ani->_movement->_id : 0), ani->_statics->_staticsId); - if ((ani->_movement && ani->_movement->_id != MV_RNG_CLOSE) || ani->_statics->_staticsId != ST_RNG_CLOSED2) - g_vars->scene37_cursorIsLocked = false; + if (ani->_movement) { + if (ani->_movement->_id == MV_RNG_CLOSE) + g_vars->scene37_pipeIsOpen = false; + } else { + if (ani->_statics->_staticsId == ST_RNG_CLOSED2) + g_vars->scene37_pipeIsOpen = false; + } } } + debugC(1, kDebugSceneLogic, "Pipe is: %s", g_vars->scene37_pipeIsOpen ? "open" : "closed"); + int state; - if (g_vars->scene37_cursorIsLocked) + if (g_vars->scene37_pipeIsOpen) state = g_fp->getObjectEnumState(sO_LeftPipe_37, sO_IsOpened); else state = g_fp->getObjectEnumState(sO_LeftPipe_37, sO_IsClosed); |