Skip to content

Commit

Permalink
ZVISION: Move TimerNode to SideFX-based class.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa-Chan committed Oct 18, 2013
1 parent 96ac92a commit 4ac2c3e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion engines/zvision/actions.cpp
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion engines/zvision/sidefx.h
Expand Up @@ -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) {}
Expand Down
5 changes: 3 additions & 2 deletions engines/zvision/timer_node.cpp
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions engines/zvision/timer_node.h
Expand Up @@ -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);

Expand Down

0 comments on commit 4ac2c3e

Please sign in to comment.