diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/actions.cpp | 27 | ||||
-rw-r--r-- | engines/zvision/actions.h | 17 | ||||
-rw-r--r-- | engines/zvision/scr_file_handling.cpp | 2 |
3 files changed, 45 insertions, 1 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index 86eca58411..3d25fa9e99 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -246,6 +246,33 @@ bool ActionPlayAnimation::execute(ZVision *engine) { ////////////////////////////////////////////////////////////////////////////// +// ActionPlayPreloadAnimation +////////////////////////////////////////////////////////////////////////////// + +ActionPlayPreloadAnimation::ActionPlayPreloadAnimation(const Common::String &line) { + sscanf(line.c_str(), + "%*[^:]:%*[^:]:%u(%u %u %u %u %u %u %u %u)", + &_animationKey, &_controlKey, &_x1, &_y1, &_x2, &_y2, &_startFrame, &_endFrame, &_loopCount); +} + +bool ActionPlayPreloadAnimation::execute(ZVision *engine) { + // Find the control + AnimationControl *control = (AnimationControl *)engine->getScriptManager()->getControl(_controlKey); + + // Set the needed values within the control + control->setAnimationKey(_animationKey); + control->setLoopCount(_loopCount); + control->setXPos(_x1); + control->setYPost(_y1); + + // Enable the control. ScriptManager will take care of the rest + control->enable(); + + return true; +} + + +////////////////////////////////////////////////////////////////////////////// // ActionQuit ////////////////////////////////////////////////////////////////////////////// diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h index b36e277d0e..5d7cdad68f 100644 --- a/engines/zvision/actions.h +++ b/engines/zvision/actions.h @@ -242,6 +242,23 @@ private: uint _loopCount; }; +class ActionPlayPreloadAnimation : public ResultAction { +public: + ActionPlayPreloadAnimation(const Common::String &line); + bool execute(ZVision *engine); + +private: + uint32 _animationKey; + uint32 _controlKey; + uint32 _x1; + uint32 _y1; + uint32 _x2; + uint32 _y2; + uint _startFrame; + uint _endFrame; + uint _loopCount; +}; + class ActionPreloadAnimation : public ResultAction { public: ActionPreloadAnimation(const Common::String &line); diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp index 378408df66..3d4718557f 100644 --- a/engines/zvision/scr_file_handling.cpp +++ b/engines/zvision/scr_file_handling.cpp @@ -202,7 +202,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (line.matchString("*:pan_track*", true)) { // TODO: Implement ActionPanTrack } else if (line.matchString("*:playpreload*", true)) { - // TODO: Implement ActionPlayPreload + actionList.push_back(new ActionPlayPreloadAnimation(line)); } else if (line.matchString("*:preferences*", true)) { // TODO: Implement ActionPreferences } else if (line.matchString("*:quit*", true)) { |