From 1fc9a8a837515869afc9400aaebf5738f7dc1806 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 8 Aug 2011 00:23:40 +0000 Subject: [PATCH] ASYLUM: HiveControl puzzle: add completion checks --- engines/asylum/puzzles/hivecontrol.cpp | 31 ++++++++++++++++++++------ 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/engines/asylum/puzzles/hivecontrol.cpp b/engines/asylum/puzzles/hivecontrol.cpp index 4d230577928..e76456cc497 100644 --- a/engines/asylum/puzzles/hivecontrol.cpp +++ b/engines/asylum/puzzles/hivecontrol.cpp @@ -237,9 +237,17 @@ bool PuzzleHiveControl::mouseLeftDown(const AsylumEvent &) { getSound()->playSound(getWorld()->graphicResourceIds[83], false, Config.sfxVolume - 10); ++_frameIndexes[kElementSwirlRim]; - error("[PuzzleHiveControl::mouseLeftDown] Not implemented"); - //if (_frameIndexes[kElementSwirlRim] == 12) - // ... + // Check for puzzle completion + if (_frameIndexes[kElementSwirlRim] == 12) { + getSound()->stop(getWorld()->graphicResourceIds[73]); + getSound()->stop(getWorld()->graphicResourceIds[74]); + + getScreen()->clear(); + getScreen()->setupTransTables(3, getWorld()->cellShadeMask1, getWorld()->cellShadeMask2, getWorld()->cellShadeMask3); + getScreen()->selectTransTable(1); + + _vm->switchEventHandler(getScene()); + } } } break; @@ -252,8 +260,18 @@ bool PuzzleHiveControl::mouseLeftDown(const AsylumEvent &) { if (_glyphFlags[1][_leverPosition]) { getSound()->playSound(getWorld()->graphicResourceIds[83], false, Config.sfxVolume - 10); ++_frameIndexes[kElementSwirlRim]; - //if (_frameIndexes[kElementSwirlRim] == 12) - // ... + + // Check for puzzle completion + if (_frameIndexes[kElementSwirlRim] == 12) { + getSound()->stop(getWorld()->graphicResourceIds[73]); + getSound()->stop(getWorld()->graphicResourceIds[74]); + + getScreen()->clear(); + getScreen()->setupTransTables(3, getWorld()->cellShadeMask1, getWorld()->cellShadeMask2, getWorld()->cellShadeMask3); + getScreen()->selectTransTable(1); + + _vm->switchEventHandler(getScene()); + } } } break; @@ -408,8 +426,7 @@ void PuzzleHiveControl::updateScreen() { _frameIndexes[kElementWingLeft1 + 2*i] = (_frameIndexes[kElementWingLeft1 + 2*i] + 1) % GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[kElementWingLeft1 + 2*i]); if (_frameIndexes[kElementWingRight1 + 2*i] != GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[kElementWingRight1 + 2*i]) - 1) _frameIndexes[kElementWingRight1 + 2*i] = (_frameIndexes[kElementWingRight1 + 2*i] + 1) % GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[kElementWingRight1 + 2*i]); - } - else { + } else { if (_frameIndexes[kElementWingLeft1 + 2*i] > 0) { --_frameIndexes[kElementWingLeft1 + 2*i]; if (_resetFlag && _frameIndexes[kElementWingLeft1 + 2*i] == 0 && !reseted) {