diff options
author | Nicola Mettifogo | 2007-09-22 18:45:43 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-09-22 18:45:43 +0000 |
commit | d7ae40b65d9e6b8f30c071fb3327f39484eae898 (patch) | |
tree | a7239fb51168c22e83292e0ae0407298d77aff5d /engines/parallaction/parallaction.h | |
parent | 7524244581bcec8d95da2fc65455704a31c3a517 (diff) | |
download | scummvm-rg350-d7ae40b65d9e6b8f30c071fb3327f39484eae898.tar.gz scummvm-rg350-d7ae40b65d9e6b8f30c071fb3327f39484eae898.tar.bz2 scummvm-rg350-d7ae40b65d9e6b8f30c071fb3327f39484eae898.zip |
Refactored a lot of Character-related code and put it into the Character class.
svn-id: r29025
Diffstat (limited to 'engines/parallaction/parallaction.h')
-rw-r--r-- | engines/parallaction/parallaction.h | 61 |
1 files changed, 26 insertions, 35 deletions
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 6fc9477214..c0401c4ad2 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -175,16 +175,6 @@ extern const char *_minidonnaName; extern const char *_minidoughName; extern const char *_minidrkiName; -// Various ways of detecting character modes used to exist -// inside the engine, so they have been unified in the two -// following macros. -// Mini characters are those used in far away shots, like -// the highway scenery, while Dummy characters are a mere -// workaround to keep the engine happy when showing slides. -// As a sidenote, standard sized characters' names start -// with a lowercase 'd'. -#define IS_MINI_CHARACTER(s) (((s)[0] == 'm')) -#define IS_DUMMY_CHARACTER(s) (((s)[0] == 'D')) void waitUntilLeftClick(); @@ -215,41 +205,43 @@ struct Location { CommandList _escapeCommands; }; + + + struct Character { + Parallaction *_vm; + + Animation _ani; Graphics::Surface *_head; Frames *_talk; Frames *_objs; PathBuilder _builder; - Character() : _builder(&_ani) { - _talk = NULL; - _head = NULL; - _objs = NULL; - - _ani._left = 150; - _ani._top = 100; - _ani._z = 10; - _ani._oldPos.x = -1000; - _ani._oldPos.y = -1000; - _ani._frame = 0; - _ani._flags = kFlagsActive | kFlagsNoName; - _ani._type = kZoneYou; - _ani._label._cnv.pixels = NULL; - _ani._label._text = strdup("yourself"); - } + Character(Parallaction *vm); + void getFoot(Common::Point &foot); + void setFoot(const Common::Point &foot); + void scheduleWalk(int16 x, int16 y); - void getFoot(Common::Point &foot) { - foot.x = _ani._left + _ani.width() / 2; - foot.y = _ani._top + _ani.height(); - } + void free(); - void setFoot(const Common::Point &foot) { - _ani._left = foot.x - _ani.width() / 2; - _ani._top = foot.y - _ani.height(); - } +protected: + const char *_prefix; + const char *_suffix; + char _name[30]; + char _baseName[30]; + char _fullName[30]; + static const char _prefixMini[]; + static const char _suffixTras[]; + static const char _empty[]; +public: + void setName(const char *name); + void transform(); + const char *getName() const; + const char *getBaseName() const; + const char *getFullName() const; }; @@ -471,7 +463,6 @@ public: Disk* _disk; Character _char; - char _characterName[30]; uint32 _localFlags[NUM_LOCATIONS]; char _locationNames[NUM_LOCATIONS][32]; |