diff options
author | richiesams | 2013-07-06 00:29:15 -0500 |
---|---|---|
committer | richiesams | 2013-08-04 13:32:00 -0500 |
commit | a77ae2163b460c081f969d764bcdb6ad001396a5 (patch) | |
tree | f11cd2ddb713989a5e38dab319d7d484c8b1131d /engines/zvision | |
parent | ebb546c46850475485753346594376cf62465765 (diff) | |
download | scummvm-rg350-a77ae2163b460c081f969d764bcdb6ad001396a5.tar.gz scummvm-rg350-a77ae2163b460c081f969d764bcdb6ad001396a5.tar.bz2 scummvm-rg350-a77ae2163b460c081f969d764bcdb6ad001396a5.zip |
ZVISION: Add definitions for more ResultActions
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/result_action.cpp | 93 | ||||
-rw-r--r-- | engines/zvision/result_action.h | 93 |
2 files changed, 169 insertions, 17 deletions
diff --git a/engines/zvision/result_action.cpp b/engines/zvision/result_action.cpp index 4721c5bd61..c61fcca398 100644 --- a/engines/zvision/result_action.cpp +++ b/engines/zvision/result_action.cpp @@ -27,6 +27,7 @@ namespace ZVision { +////////////////////////////////////////////////////////////////////////////// // ActionAdd ////////////////////////////////////////////////////////////////////////////// @@ -40,6 +41,7 @@ bool ActionAdd::execute(ZVision *zVision) { } +////////////////////////////////////////////////////////////////////////////// // ActionAssign ////////////////////////////////////////////////////////////////////////////// @@ -53,6 +55,83 @@ bool ActionAssign::execute(ZVision *zVision) { } +////////////////////////////////////////////////////////////////////////////// +// ActionAttenuate +////////////////////////////////////////////////////////////////////////////// + +ActionAttenuate::ActionAttenuate(Common::String line) { + sscanf(line.c_str(), ":assign(%u, %hd)", &_key, &_attenuation); +} + +bool ActionAttenuate::execute(ZVision *zVision) { + // TODO: Implement + return true; +} + + +////////////////////////////////////////////////////////////////////////////// +// ActionChangeLocation +////////////////////////////////////////////////////////////////////////////// + +ActionChangeLocation::ActionChangeLocation(Common::String line) { + sscanf(line.c_str(), ":change_location(%c,%c,%2c,%hu)", &_world, &_room, &_nodeview, &_x); +} + +bool ActionChangeLocation::execute(ZVision *zVision) { + // TODO: Implement + return true; +} + + +////////////////////////////////////////////////////////////////////////////// +// ActionCrossfade +////////////////////////////////////////////////////////////////////////////// + +ActionCrossfade::ActionCrossfade(Common::String line) { + sscanf(line.c_str(), + ":crossfade(%u %u %hhu %hhu %hhu %hhu %hu)", + &_keyOne, &_keyTwo, &_oneStartVolume, &_twoStartVolume, &_oneEndVolume, &_twoEndVolume, &_timeInMillis); +} + +bool ActionCrossfade::execute(ZVision *zVision) { + // TODO: Implement + return true; +} + + +////////////////////////////////////////////////////////////////////////////// +// ActionPreloadAnimation +////////////////////////////////////////////////////////////////////////////// + +ActionPreloadAnimation::ActionPreloadAnimation(Common::String line) { + // The two %*hhu are always 0 and dont seem to have a use + sscanf(line.c_str(), ":animpreload:%u(%s %*hhu %*hhu %u %hhu)", &_key, &_fileName, &_mask, &_framerate); +} + +bool ActionPreloadAnimation::execute(ZVision *zVision) { + // TODO: Implement + return true; +} + + +////////////////////////////////////////////////////////////////////////////// +// ActionPlayAnimation +////////////////////////////////////////////////////////////////////////////// + +ActionPlayAnimation::ActionPlayAnimation(Common::String line) { + // The two %*hhu are always 0 and dont seem to have a use + sscanf(line.c_str(), + ":animplay:%u(%s %u %u %u %u %u %u %hhu %*hhu %*hhu %u %hhu)", + &_key, &_x, &_y, &_width, &_height, &_start, &_end, &_loop, &_mask, &_framerate); +} + +bool ActionPlayAnimation::execute(ZVision *zVision) { + // TODO: Implement + return true; +} + + +////////////////////////////////////////////////////////////////////////////// // ActionRandom ////////////////////////////////////////////////////////////////////////////// @@ -66,4 +145,18 @@ bool ActionRandom::execute(ZVision *zVision) { return true; } + +////////////////////////////////////////////////////////////////////////////// +// ActionTimer +////////////////////////////////////////////////////////////////////////////// + +ActionTimer::ActionTimer(Common::String line) { + sscanf(line.c_str(), ":timer:%u(%hu)", &_key, &_time); +} + +bool ActionTimer::execute(ZVision *zVision) { + // TODO: Implement + return true; +} + } // End of namespace ZVision diff --git a/engines/zvision/result_action.h b/engines/zvision/result_action.h index fbf8e7f019..a58ef68e34 100644 --- a/engines/zvision/result_action.h +++ b/engines/zvision/result_action.h @@ -40,13 +40,6 @@ public: // The different types of actions -// ADD, -// ANIM_PLAY, -// ANIM_PRELOAD, -// ANIM_UNLOAD, -// ATTENUATE, -// ASSIGN, -// CHANGE_LOCATION, // CROSSFADE, // DEBUG, // DELAY_RENDER, @@ -76,7 +69,6 @@ public: // STOP, // STREAM_VIDEO, // SYNC_SOUND, -// TIMER, // TTY_TEXT, // UNIVERSE_MUSIC, @@ -90,34 +82,91 @@ private: byte _value; }; -class ActionPlayAnimation : public ResultAction { +class ActionAssign : public ResultAction { public: - ActionPlayAnimation(Common::String line); + ActionAssign(Common::String line); bool execute(ZVision *zVision); + +private: + uint32 _key; + byte _value; }; -class ActionPreloadAnimation : public ResultAction { +class ActionAttenuate : public ResultAction { public: - ActionPreloadAnimation(Common::String line); + ActionAttenuate(Common::String line); bool execute(ZVision *zVision); + +private: + uint32 _key; + int16 _attenuation; }; -class ActionAttenuate : public ResultAction { +class ActionChangeLocation : public ResultAction { public: - ActionAttenuate(Common::String line); + ActionChangeLocation(Common::String line); bool execute(ZVision *zVision); + +private: + char _world; + char _room; + char _nodeview[2]; + int16 _x; }; -class ActionAssign : public ResultAction { +class ActionCrossfade : public ResultAction { public: - ActionAssign(Common::String line); + ActionCrossfade(Common::String line); + bool execute(ZVision *zVision); + +private: + uint32 _keyOne; + uint32 _keyTwo; + byte _oneStartVolume; + byte _twoStartVolume; + byte _oneEndVolume; + byte _twoEndVolume; + uint16 _timeInMillis; +}; + +class ActionPlayAnimation : public ResultAction { +public: + ActionPlayAnimation(Common::String line); bool execute(ZVision *zVision); private: uint32 _key; - byte _value; + Common::String _fileName; + uint32 _x; + uint32 _y; + uint32 _width; + uint32 _height; + uint32 _start; + uint32 _end; + uint32 _mask; + byte _framerate; + bool _loop; }; +class ActionPreloadAnimation : public ResultAction { +public: + ActionPreloadAnimation(Common::String line); + bool execute(ZVision *zVision); + +private: + uint32 _key; + Common::String _fileName; + uint32 _mask; + byte _framerate; +}; + +// TODO: See if this exists in ZGI. It doesn't in ZNem +//class ActionUnloadAnimation : public ResultAction { +//public: +// ActionUnloadAnimation(Common::String line); +// bool execute(ZVision *zVision); +//}; + class ActionRandom : public ResultAction { public: ActionRandom(Common::String line); @@ -128,6 +177,16 @@ private: uint32 _max; }; +class ActionTimer : public ResultAction { +public: + ActionTimer(Common::String line); + bool execute(ZVision *zVision); + +private: + uint32 _key; + uint32 _time; +}; + } // End of namespace ZVision #endif |