diff options
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/actions.cpp | 12 | ||||
-rw-r--r-- | engines/zvision/actions.h | 5 |
2 files changed, 13 insertions, 4 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index 8340c02428..08e99dc501 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -399,11 +399,19 @@ bool ActionStreamVideo::execute() { ActionTimer::ActionTimer(ZVision *engine, const Common::String &line) : ResultAction(engine) { - sscanf(line.c_str(), "%*[^:]:%*[^:]:%u(%u)", &_key, &_time); + char time_buf[64]; + memset(time_buf, 0, 64); + sscanf(line.c_str(), "%*[^:]:%*[^:]:%u(%s)", &_key, time_buf); + _time = new ValueSlot(_engine->getScriptManager(), time_buf); +} + +ActionTimer::~ActionTimer() { + if (_time) + delete _time; } bool ActionTimer::execute() { - _engine->getScriptManager()->addSideFX(new TimerNode(_engine, _key, _time)); + _engine->getScriptManager()->addSideFX(new TimerNode(_engine, _key, _time->getValue())); return true; } diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h index f779c1fa2f..e900167068 100644 --- a/engines/zvision/actions.h +++ b/engines/zvision/actions.h @@ -32,6 +32,7 @@ namespace ZVision { // Forward declaration of ZVision. This file is included before ZVision is declared class ZVision; +class ValueSlot; /** * The base class that represents any action that a Puzzle can take. @@ -337,11 +338,11 @@ private: class ActionTimer : public ResultAction { public: ActionTimer(ZVision *engine, const Common::String &line); + ~ActionTimer(); bool execute(); - private: uint32 _key; - uint _time; + ValueSlot *_time; }; } // End of namespace ZVision |