aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorMarisa-Chan2013-10-30 16:21:38 +0700
committerMarisa-Chan2013-10-30 16:21:38 +0700
commitfa943f1044e78ad9b1305f2d91085c25a945aaa9 (patch)
treeaaa22bf6cde57bf13c2a83399762c33451e26cc6 /engines/zvision
parente38ca6e7a952b79e1432e322905687c9e11ebb47 (diff)
downloadscummvm-rg350-fa943f1044e78ad9b1305f2d91085c25a945aaa9.tar.gz
scummvm-rg350-fa943f1044e78ad9b1305f2d91085c25a945aaa9.tar.bz2
scummvm-rg350-fa943f1044e78ad9b1305f2d91085c25a945aaa9.zip
ZVISION: Move actionTimer to use ValueSlot class.
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/actions.cpp12
-rw-r--r--engines/zvision/actions.h5
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