aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/objects.h
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-14 08:56:00 -0400
committerPaul Gilbert2015-06-14 08:56:00 -0400
commit5364b46d6ac2a0907d864ec1aa60cd4835f4d1dc (patch)
tree5584c3478f619b0532a9d8be46cce33af6f32151 /engines/sherlock/objects.h
parenta33a4fa591cdcf35e377de84383047d819f1ecc9 (diff)
downloadscummvm-rg350-5364b46d6ac2a0907d864ec1aa60cd4835f4d1dc.tar.gz
scummvm-rg350-5364b46d6ac2a0907d864ec1aa60cd4835f4d1dc.tar.bz2
scummvm-rg350-5364b46d6ac2a0907d864ec1aa60cd4835f4d1dc.zip
SHERLOCK: RT: Move checkObject from Object to BaseObject
checkObject needs to be called in checkSprite now, which is in the Sprite class. So the method and a few others it depeends on have been moved into BaseObject
Diffstat (limited to 'engines/sherlock/objects.h')
-rw-r--r--engines/sherlock/objects.h78
1 files changed, 42 insertions, 36 deletions
diff --git a/engines/sherlock/objects.h b/engines/sherlock/objects.h
index e73a8c3140..35129304e1 100644
--- a/engines/sherlock/objects.h
+++ b/engines/sherlock/objects.h
@@ -167,6 +167,23 @@ struct UseType: public ActionType {
};
class BaseObject {
+protected:
+ static SherlockEngine *_vm;
+protected:
+ /**
+ * This will check to see if the object has reached the end of a sequence.
+ * If it has, it switch to whichever next sequence should be started.
+ * @returns true if the end of a sequence was reached
+ */
+ bool checkEndOfSequence();
+
+ /**
+ * Scans through the sequences array and finds the designated sequence.
+ * It then sets the frame number of the start of that sequence
+ */
+ void setObjSequence(int seq, bool wait);
+public:
+ static bool _countCAnimFrames;
public:
SpriteType _type; // Type of object/sprite
Common::String _description; // Description lines
@@ -210,6 +227,7 @@ public:
public:
BaseObject();
virtual ~BaseObject() {}
+ static void setVm(SherlockEngine *vm);
/**
* Returns true if the the object has an Allow Talk Code in the sequence that it's
@@ -218,12 +236,32 @@ public:
* If it's above 128, then it's one of the Listen sequences.
*/
bool hasAborts() const;
+
+ /**
+ * Check the state of the object
+ */
+ void checkObject();
+
+ /**
+ * Checks for codes
+ * @param name The name to check for codes
+ * @param messages Provides a lookup list of messages that can be printed
+ * @returns 0 if no codes are found, 1 if codes were found
+ */
+ int checkNameForCodes(const Common::String &name, const char *const messages[]);
+
+ /**
+ * Adjusts the frame and sequence variables of a sprite that corresponds to the current speaker
+ * so that it points to the beginning of the sequence number's talk sequence in the object's
+ * sequence buffer
+ * @param seq Which sequence to use (if there's more than 1)
+ * @remarks 1: First talk seq, 2: second talk seq, etc.
+ */
+ virtual void setObjTalkSequence(int seq) = 0;
};
class Sprite: public BaseObject {
protected:
- static SherlockEngine *_vm;
-
/**
* Free the alternate graphics used by NPCs
*/
@@ -275,7 +313,7 @@ public:
* @param seq Which sequence to use (if there's more than 1)
* @remarks 1: First talk seq, 2: second talk seq, etc.
*/
- void setObjTalkSequence(int seq);
+ virtual void setObjTalkSequence(int seq);
/**
* Return frame width
@@ -319,25 +357,6 @@ enum { OBJ_BEHIND = 1, OBJ_FLIPPED = 2, OBJ_FORWARD = 4, TURNON_OBJ = 0x20, TURN
#define USE_COUNT 4
class Object: public BaseObject {
-private:
- static SherlockEngine *_vm;
-
- /**
- * This will check to see if the object has reached the end of a sequence.
- * If it has, it switch to whichever next sequence should be started.
- * @returns true if the end of a sequence was reached
- */
- bool checkEndOfSequence();
-
- /**
- * Scans through the sequences array and finds the designated sequence.
- * It then sets the frame number of the start of that sequence
- */
- void setObjSequence(int seq, bool wait);
-public:
- static bool _countCAnimFrames;
-
- static void setVm(SherlockEngine *vm);
public:
Common::String _name; // Name
Common::String _examine; // Examine in-depth description
@@ -367,19 +386,6 @@ public:
void toggleHidden();
/**
- * Check the state of the object
- */
- void checkObject();
-
- /**
- * Checks for codes
- * @param name The name to check for codes
- * @param messages Provides a lookup list of messages that can be printed
- * @returns 0 if no codes are found, 1 if codes were found
- */
- int checkNameForCodes(const Common::String &name, const char *const messages[]);
-
- /**
* Handle setting any flags associated with the object
*/
void setFlagsAndToggles();
@@ -428,7 +434,7 @@ public:
* @param seq Which sequence to use (if there's more than 1)
* @remarks 1: First talk seq, 2: second talk seq, etc.
*/
- void setObjTalkSequence(int seq);
+ virtual void setObjTalkSequence(int seq);
};