diff options
author | RichieSams | 2013-09-07 18:08:49 -0500 |
---|---|---|
committer | RichieSams | 2013-09-09 11:16:36 -0500 |
commit | b1587f8ba0f335aff7133f7422953be83aa4c5ae (patch) | |
tree | f6550f74f9211dbdb336a454ca7143bb1f1c534d /engines/zvision | |
parent | 5c3cfaa6d2428da3ed33bcdf163008457df8000b (diff) | |
download | scummvm-rg350-b1587f8ba0f335aff7133f7422953be83aa4c5ae.tar.gz scummvm-rg350-b1587f8ba0f335aff7133f7422953be83aa4c5ae.tar.bz2 scummvm-rg350-b1587f8ba0f335aff7133f7422953be83aa4c5ae.zip |
ZVISION: Implement ActionPlayPreloadAnimation
Diffstat (limited to 'engines/zvision')
-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)) { |