void NoradElevator::openInteraction() { SpriteFrame *frame = new SpriteFrame(); frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kElevatorLabelID, true); _elevatorControls.addFrame(frame, 0, 0); frame = new SpriteFrame(); frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kElevatorButtonsID, true); _elevatorControls.addFrame(frame, 0, 0); frame = new SpriteFrame(); frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kElevatorDownOnID, true); _elevatorControls.addFrame(frame, 0, 0); frame = new SpriteFrame(); frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kElevatorUpOnID, true); _elevatorControls.addFrame(frame, 0, 0); _elevatorControls.setCurrentFrameIndex(0); _elevatorControls.setDisplayOrder(kElevatorControlsOrder); Common::Rect r; frame->getSurfaceBounds(r); r.moveTo(kNoradAlphaElevatorControlsLeft, kNoradAlphaElevatorControlsTop); _elevatorControls.setBounds(r); _elevatorControls.startDisplaying(); _elevatorControls.show(); }
EnergyMonitor::EnergyMonitor() : IdlerAnimation(kEnergyBarID), _energyLight(kWarningLightID) { PegasusEngine *vm = (PegasusEngine *)g_engine; _stage = kStageNoStage; _calibrating = false; _dontFlash = false; setBounds(338, 48, 434, 54); setDisplayOrder(kEnergyBarOrder); startDisplaying(); SpriteFrame *frame = new SpriteFrame(); frame->initFromPICTResource(vm->_resFork, kLightOffID); _energyLight.addFrame(frame, 0, 0); frame = new SpriteFrame(); frame->initFromPICTResource(vm->_resFork, kLightYellowID); _energyLight.addFrame(frame, 0, 0); frame = new SpriteFrame(); frame->initFromPICTResource(vm->_resFork, kLightOrangeID); _energyLight.addFrame(frame, 0, 0); frame = new SpriteFrame(); frame->initFromPICTResource(vm->_resFork, kLightRedID); _energyLight.addFrame(frame, 0, 0); _energyLight.setBounds(540, 35, 600, 59); _energyLight.setDisplayOrder(kEnergyLightOrder); _energyLight.startDisplaying(); setScale(1); setSegment(0, kMaxJMPEnergy); setEnergyValue(kCasualEnergy); g_energyMonitor = this; }
void SpriteSequence::openFrameSequence() { if (!isSequenceOpen()) { FrameSequence::openFrameSequence(); if (isSequenceOpen()) { uint32 numFrames = getNumFrames(); for (uint32 i = 0; i < numFrames; ++i) { SpriteFrame *frame = new SpriteFrame(); frame->initFromPICTResource(_resFork, i + 0x80, _transparent); _sprite.addFrame(frame, 0, 0); } _sprite.setBounds(_bounds); } } }
void PressureDoor::openInteraction() { if (_isUpperDoor) { _levelsMovie.initFromMovieFile("Images/Norad Alpha/Upper Levels Movie"); _levelsMovie.moveElementTo(kNoradUpperLevelsLeft, kNoradUpperLevelsTop); } else { _levelsMovie.initFromMovieFile("Images/Norad Alpha/Lower Levels Movie"); _levelsMovie.moveElementTo(kNoradLowerLevelsLeft, kNoradLowerLevelsTop); } _levelsScale = _levelsMovie.getScale(); _levelsMovie.setDisplayOrder(kPressureLevelsOrder); _levelsMovie.startDisplaying(); _levelsMovie.setSegment(kLevelsSplashStart * _levelsScale, kLevelsSplashStop * _levelsScale); _levelsMovie.setTime(kLevelsSplashStart * _levelsScale); _levelsMovie.redrawMovieWorld(); _levelsMovie.show(); _pressureCallBack.setNotification(&_pressureNotification); _pressureCallBack.initCallBack(&_levelsMovie, kCallBackAtExtremes); _pressureCallBack.setCallBackFlag(kSplashFinished); _pressureCallBack.scheduleCallBack(kTriggerAtStop, 0, 0); _pressureNotification.notifyMe(this, kPressureNotificationFlags, kPressureNotificationFlags); if (_isUpperDoor) { _typeMovie.initFromMovieFile("Images/Norad Alpha/Upper Type Movie"); _typeMovie.moveElementTo(kNoradUpperTypeLeft, kNoradUpperTypeTop); } else { _typeMovie.initFromMovieFile("Images/Norad Alpha/Lower Type Movie"); _typeMovie.moveElementTo(kNoradLowerTypeLeft, kNoradLowerTypeTop); } _typeScale = _typeMovie.getScale(); _typeMovie.setDisplayOrder(kPressureTypeOrder); _typeMovie.startDisplaying(); _typeMovie.setTime(kDoorSealedTime * _typeScale); _typeMovie.redrawMovieWorld(); SpriteFrame *frame = new SpriteFrame(); if (_isUpperDoor) frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kLowerPressureUpOffPICTID); else frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kUpperPressureUpOffPICTID); _upButton.addFrame(frame, 0, 0); frame = new SpriteFrame(); if (_isUpperDoor) frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kLowerPressureUpOnPICTID); else frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kUpperPressureUpOnPICTID); _upButton.addFrame(frame, 0, 0); _upButton.setCurrentFrameIndex(0); _upButton.setDisplayOrder(kPressureUpOrder); Common::Rect r; frame->getSurfaceBounds(r); if (_isUpperDoor) r.moveTo(kNoradUpperUpLeft, kNoradUpperUpTop); else r.moveTo(kNoradLowerUpLeft, kNoradLowerUpTop); _upButton.setBounds(r); _upButton.startDisplaying(); _upButton.show(); frame = new SpriteFrame(); if (_isUpperDoor) frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kLowerPressureDownOffPICTID); else frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kUpperPressureDownOffPICTID); _downButton.addFrame(frame, 0, 0); frame = new SpriteFrame(); if (_isUpperDoor) frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kLowerPressureDownOnPICTID); else frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kUpperPressureDownOnPICTID); _downButton.addFrame(frame, 0, 0); _downButton.setCurrentFrameIndex(0); _downButton.setDisplayOrder(kPressureDownOrder); frame->getSurfaceBounds(r); if (_isUpperDoor) r.moveTo(kNoradUpperDownLeft, kNoradUpperDownTop); else r.moveTo(kNoradLowerDownLeft, kNoradLowerDownTop); _downButton.setBounds(r); _downButton.startDisplaying(); _downButton.show(); _utilityCallBack.setNotification(&_utilityNotification); _utilityCallBack.initCallBack(&_utilityTimer, kCallBackAtTime); _utilityNotification.notifyMe(this, kUtilityNotificationFlags, kUtilityNotificationFlags); _utilityTimer.setMasterTimeBase(getOwner()->getNavMovie()); if (_playingAgainstRobot) _neighborhoodNotification->notifyMe(this, kExtraCompletedFlag | kDelayCompletedFlag | kSpotSoundCompletedFlag, kExtraCompletedFlag | kDelayCompletedFlag | kSpotSoundCompletedFlag); else _neighborhoodNotification->notifyMe(this, kDelayCompletedFlag | kSpotSoundCompletedFlag, kDelayCompletedFlag | kSpotSoundCompletedFlag); _gameState = kPlayingSplash; }
void Sprite::addPICTResourceFrame(const ResIDType pictID, bool transparent, const CoordType left, const CoordType top) { SpriteFrame *frame = new SpriteFrame(); frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, pictID, transparent); addFrame(frame, left, top); }