aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/action.h
diff options
context:
space:
mode:
authorMatthew Stewart2018-06-21 23:33:02 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commit08ead492d8ff338a469ca92881919d8ff22e12b3 (patch)
tree7b51f34ef76ca28cc12d3daa7c663ffb53bca773 /engines/startrek/action.h
parent16042faa655f53553ec26ef908e5528871e046ce (diff)
downloadscummvm-rg350-08ead492d8ff338a469ca92881919d8ff22e12b3.tar.gz
scummvm-rg350-08ead492d8ff338a469ca92881919d8ff22e12b3.tar.bz2
scummvm-rg350-08ead492d8ff338a469ca92881919d8ff22e12b3.zip
STARTREK: LOVE3 finished.
Added "callback" variants of the "walkCrewman" and "loadActorAnim" functions to simplify chains of calls in room-specific code.
Diffstat (limited to 'engines/startrek/action.h')
-rw-r--r--engines/startrek/action.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/startrek/action.h b/engines/startrek/action.h
index a501b7860a..4270eb97ea 100644
--- a/engines/startrek/action.h
+++ b/engines/startrek/action.h
@@ -27,6 +27,8 @@
namespace StarTrek {
+class Room;
+
enum Acton {
ACTION_TICK = 0,
@@ -41,7 +43,9 @@ enum Acton {
ACTION_TIMER_EXPIRED = 8,
ACTION_FINISHED_ANIMATION = 10,
ACTION_FINISHED_WALKING = 12,
- ACTION_OPTIONS = 13 // Not really an action, but selectable from action menu
+ ACTION_OPTIONS = 13, // Not really an action, but selectable from action menu
+
+ ACTION_CALLBACK = 255 // Custom action in ScummVM; calls a function in the Room class
};
struct Action : Common::Serializable {
@@ -50,6 +54,8 @@ struct Action : Common::Serializable {
byte b2;
byte b3;
+ void (Room::*roomFuncPtr)();
+
Action() {}
Action(int _type, int _b1, int _b2, int _b3)
: type((byte)_type),
@@ -57,6 +63,10 @@ struct Action : Common::Serializable {
b2((byte)_b2),
b3((byte)_b3) {}
+ Action(int _type, void (Room::*funcPtr)())
+ : type((byte)_type),
+ roomFuncPtr(funcPtr) {}
+
// ACTION_USE, ACTION_GET, ACTION_LOOK, ACTION_TALK
byte activeObject() { return b1; }