22 #ifndef SHERLOCK_OBJECTS_H 23 #define SHERLOCK_OBJECTS_H 25 #include "common/scummsys.h" 26 #include "common/rect.h" 27 #include "common/str-array.h" 28 #include "common/str.h" 29 #include "sherlock/image_file.h" 30 #include "sherlock/fixed_text.h" 31 #include "sherlock/saveload.h" 38 ALLOW_MOVE = 1, ALLOW_OPEN = 2, ALLOW_CLOSE = 4
53 HIDDEN_CHARACTER = 128
75 BEHIND = 0, NORMAL_BEHIND = 1, NORMAL_FORWARD = 2, FORWARD = 3
78 #define MAX_HOLMES_SEQUENCE 16 80 #define FIXED_INT_MULTIPLIER 1000 83 #define SEQ_TO_CODE 67 84 #define FLIP_CODE (64 + 128) 85 #define SOUND_CODE (34 + 128) 86 #define HIDE_CODE (7+128) // Code for hiding/unhiding an object from a Sequence 87 #define CALL_TALK_CODE (8+128) // Code for call a Talk File from a Sequence 88 #define TELEPORT_CODE (9+128) // Code for setting Teleport Data (X,Y) 89 #define MOVE_CODE (10+128) // Code for setting Movement Delta (X,Y) 92 #define TALK_SEQ_CODE 252 // Code specifying start of talk sequence frames in a Sequence 93 #define TALK_LISTEN_CODE 251 // Code specifying start of talk listen frames in a Sequence 94 #define ALLOW_TALK_CODE 250 97 #define LOWER_LIMIT (IS_SERRATED_SCALPEL ? CONTROLS_Y : SHERLOCK_SCREEN_HEIGHT) 99 #define RIGHT_LIMIT SHERLOCK_SCREEN_WIDTH 107 Point32(
int x1,
int y1) : x(x1), y(y1) {}
110 bool operator==(
const Point32 &p)
const {
return x == p.x && y == p.y; }
111 bool operator!=(
const Point32 &p)
const {
return x != p.x || y != p.y; }
116 void operator+=(
const Point32 &delta) { x += delta.x; y += delta.y; }
117 void operator-=(
const Point32 &delta) { x -= delta.x; y -= delta.y; }
138 const byte &operator[](
int idx) {
return _sequences[idx]; }
151 enum { REVERSE_DIRECTION = 0x80 };
152 #define NAMES_COUNT 4 195 bool checkEndOfSequence();
201 void setObjSequence(
int seq,
bool wait);
203 static bool _countCAnimFrames;
222 int _requiredFlag[2];
255 bool hasAborts()
const;
268 int checkNameForCodes(
const Common::String &name, FixedTextActionId fixedTextActionId = kFixedTextAction_Invalid);
297 int _oldWalkSequence;
312 void setImageFrame();
331 int frameWidth()
const {
return _imageFrame ? _imageFrame->_frame.w : 0; }
336 int frameHeight()
const {
return _imageFrame ? _imageFrame->_frame.h : 0; }
346 virtual void adjustSprite() = 0;
351 virtual void gotoStand() = 0;
357 virtual void setWalking() = 0;
360 enum { OBJ_BEHIND = 1, OBJ_FLIPPED = 2, OBJ_FORWARD = 4, TURNON_OBJ = 0x20, TURNOFF_OBJ = 0x40 };
394 void setFlagsAndToggles();
406 int pickUpObject(FixedTextActionId fixedTextActionId = kFixedTextAction_Invalid);
411 int frameWidth()
const {
return _imageFrame ? _imageFrame->_frame.w : 0; }
416 int frameHeight()
const {
return _imageFrame ? _imageFrame->_frame.h : 0; }
440 void setObjTalkSequence(
int seq)
override;
453 byte _sequences[MAX_FRAME];
void setObjTalkSequence(int seq) override
Definition: objects.h:326
Definition: objects.h:120
Definition: objects.h:132
int frameHeight() const
Definition: objects.h:336
int frameWidth() const
Definition: objects.h:411
Definition: animation.h:29
int frameWidth() const
Definition: objects.h:331
Definition: serializer.h:79
Definition: image_file.h:36
int frameHeight() const
Definition: objects.h:416
Definition: objects.h:466
Definition: objects.h:154
Definition: sherlock.h:76
Definition: objects.h:363
int16 x
Definition: rect.h:46
int16 y
Definition: rect.h:47
Definition: image_file.h:78
Definition: objects.h:168
Definition: objects.h:101
Definition: objects.h:146
Definition: objects.h:186
virtual void setObjTalkSequence(int seq)
Definition: objects.h:277
Definition: objects.h:280
Definition: objects.h:443