void Parallaction_br::runPendingZones() { ZonePtr z; _cmdExec->runSuspended(); if (_activeZone) { z = _activeZone; // speak Zone or sound _activeZone.reset(); if (ACTIONTYPE(z) == kZoneSpeak && z->u._speakDialogue) { enterDialogueMode(z); } else { runZone(z); // FIXME: BRA doesn't handle sound yet } } if (_activeZone2) { z = _activeZone2; // speak Zone or sound _activeZone2.reset(); if (ACTIONTYPE(z) == kZoneSpeak && z->u._speakDialogue) { enterDialogueMode(z); } else { runZone(z); // FIXME: BRA doesn't handle sound yet } } }
void Parallaction::runZone(ZonePtr z) { debugC(3, kDebugExec, "runZone (%s)", z->_name); uint16 actionType = ACTIONTYPE(z); debugC(3, kDebugExec, "actionType = %x, itemType = %x", actionType, ITEMTYPE(z)); switch (actionType) { case kZoneExamine: enterCommentMode(z); return; case kZoneGet: pickupItem(z); break; case kZoneDoor: if (z->_flags & kFlagsLocked) break; updateDoor(z, !(z->_flags & kFlagsClosed)); break; case kZoneHear: if (z->u._hearChannel == MUSIC_HEAR_CHANNEL) { _soundMan->execute(SC_SETMUSICFILE, z->u._filename.c_str()); _soundMan->execute(SC_PLAYMUSIC); } else { _soundMan->execute(SC_SETSFXCHANNEL, z->u._hearChannel); _soundMan->execute(SC_SETSFXLOOPING, (int)((z->_flags & kFlagsLooping) == kFlagsLooping)); _soundMan->execute(SC_SETSFXVOLUME, 60); _soundMan->execute(SC_PLAYSFX, z->u._filename.c_str()); } break; case kZoneSpeak: if (z->u._speakDialogue) { enterDialogueMode(z); return; } break; } debugC(3, kDebugExec, "runZone completed"); _cmdExec->run(z->_commands, z); return; }