From 4ac2c3e93bd78d4e151035fcde0dae9f17eeb11a Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Fri, 18 Oct 2013 22:44:33 +0000 Subject: ZVISION: Move TimerNode to SideFX-based class. --- engines/zvision/actions.cpp | 2 +- engines/zvision/sidefx.h | 3 ++- engines/zvision/timer_node.cpp | 5 +++-- engines/zvision/timer_node.h | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index fbf2a58ad6..fb4034fbdb 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -387,7 +387,7 @@ ActionTimer::ActionTimer(const Common::String &line) { } bool ActionTimer::execute(ZVision *engine) { - engine->getScriptManager()->addControl(new TimerNode(engine, _key, _time)); + engine->getScriptManager()->addSideFX(new TimerNode(engine, _key, _time)); return true; } diff --git a/engines/zvision/sidefx.h b/engines/zvision/sidefx.h index 35d25d4431..d495655a22 100644 --- a/engines/zvision/sidefx.h +++ b/engines/zvision/sidefx.h @@ -37,7 +37,8 @@ class SideFX { public: enum SideFXType{ - SIDEFX_UNK = 0 + SIDEFX_UNK = 0, + SIDEFX_TIMER = 1 }; SideFX() : _engine(0), _key(0), _type(SIDEFX_UNK) {} diff --git a/engines/zvision/timer_node.cpp b/engines/zvision/timer_node.cpp index 55dfa51dfe..7fc3199a8a 100644 --- a/engines/zvision/timer_node.cpp +++ b/engines/zvision/timer_node.cpp @@ -32,8 +32,9 @@ namespace ZVision { -TimerNode::TimerNode(ZVision *engine, uint32 key, uint timeInSeconds) - : Control(engine, key), _timeLeft(timeInSeconds * 1000) { +TimerNode::TimerNode(ZVision *engine, uint32 key, uint timeInSeconds) + : SideFX(engine, key, SIDEFX_TIMER) { + _timeLeft = timeInSeconds * 1000; } bool TimerNode::process(uint32 deltaTimeInMillis) { diff --git a/engines/zvision/timer_node.h b/engines/zvision/timer_node.h index 32dca71548..afdbd39803 100644 --- a/engines/zvision/timer_node.h +++ b/engines/zvision/timer_node.h @@ -23,13 +23,13 @@ #ifndef ZVISION_TIMER_NODE_H #define ZVISION_TIMER_NODE_H -#include "zvision/control.h" +#include "zvision/sidefx.h" namespace ZVision { class ZVision; -class TimerNode : public Control { +class TimerNode : public SideFX { public: TimerNode(ZVision *engine, uint32 key, uint timeInSeconds); -- cgit v1.2.3