aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_stack.h
diff options
context:
space:
mode:
authorBastien Bouclet2017-07-01 22:44:22 +0200
committerEugene Sandulenko2017-07-03 08:50:10 +0200
commitea303ab682c9d8167f827e0a84cc72336ce2cc42 (patch)
tree0366282afbe39ae2dca88be92c50b7d848a71ed1 /engines/mohawk/riven_stack.h
parentee70244fbfb981fc16c77b10bab6546cf5e5cb0d (diff)
downloadscummvm-rg350-ea303ab682c9d8167f827e0a84cc72336ce2cc42.tar.gz
scummvm-rg350-ea303ab682c9d8167f827e0a84cc72336ce2cc42.tar.bz2
scummvm-rg350-ea303ab682c9d8167f827e0a84cc72336ce2cc42.zip
MOHAWK: Switch timers to script commands
Diffstat (limited to 'engines/mohawk/riven_stack.h')
-rw-r--r--engines/mohawk/riven_stack.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/engines/mohawk/riven_stack.h b/engines/mohawk/riven_stack.h
index a70faf3fc2..96bd07b04c 100644
--- a/engines/mohawk/riven_stack.h
+++ b/engines/mohawk/riven_stack.h
@@ -81,6 +81,8 @@ public:
RivenStack(MohawkEngine_Riven *vm, uint16 id);
virtual ~RivenStack();
+ typedef Common::Functor0<void> TimerProc;
+
/** Get the id of the stack */
uint16 getId() const;
@@ -112,6 +114,9 @@ public:
/** Install a timer for the current card if one is defined */
virtual void installCardTimer();
+ /** Clear any currently installed timer */
+ void removeTimer();
+
/** Handle a mouse down event */
void onMouseDown(const Common::Point &mouse);
@@ -162,6 +167,9 @@ protected:
/** Register an external command for use by the scripts */
void registerCommand(const Common::String &name, ExternalCommand *command);
+ /** Register a proc for planned execution */
+ void installTimer(TimerProc *proc, uint32 time);
+
private:
typedef Common::HashMap<Common::String, Common::SharedPtr<ExternalCommand>, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> CommandsMap;
@@ -170,9 +178,13 @@ private:
#method, new Common::Functor2Mem<uint16, uint16 *, void, cls>(this, &cls::method) \
)
+#define TIMER(cls, method) \
+ new Common::Functor0Mem<void, cls>(this, &cls::method)
+
void loadResourceNames();
void loadCardIdMap();
void setCurrentStackVariable();
+ void checkTimer();
uint16 _id;
@@ -192,6 +204,10 @@ private:
bool _mouseIsDown;
Common::Point _mousePosition;
Common::Point _mouseDragStartPosition;
+
+ // Timer
+ Common::SharedPtr<TimerProc> _timerProc;
+ uint32 _timerTime;
};
namespace RivenStacks {