26 #include "common/scummsys.h" 27 #include "common/serializer.h" 28 #include "scumm/scumm.h" 32 #define CHORE_REDIRECT_INIT 56 33 #define CHORE_REDIRECT_WALK 57 34 #define CHORE_REDIRECT_STAND 58 35 #define CHORE_REDIRECT_START_TALK 59 36 #define CHORE_REDIRECT_STOP_TALK 60 70 uint16 heJumpOffsetTable[16] = {};
71 uint16 heJumpCountTable[16] = {};
72 uint32 heCondMaskTable[16] = {};
79 memset(animType, 0,
sizeof(animType));
80 memset(curpos, 0xFF,
sizeof(curpos));
81 memset(start, 0xFF,
sizeof(start));
82 memset(end, 0xFF,
sizeof(end));
83 memset(frame, 0xFF,
sizeof(frame));
99 static byte kInvalidBox;
108 int _top = 0, _bottom = 0;
116 int _talkFrequency = 0;
118 byte _talkVolume = 0;
119 uint16 _boxscale = 0;
120 byte _scalex = 0, _scaley = 0;
123 bool _ignoreBoxes =
false;
125 uint16 _lastValidX = 0, _lastValidY = 0;
129 byte _standFrame = 0;
130 byte _talkStartFrame = 0;
131 byte _talkStopFrame = 0;
133 bool _needRedraw =
false, _needBgReset =
false, _visible =
false;
134 byte _shadowMode = 0;
138 int16 _talkPosX = 0, _talkPosY = 0;
139 uint16 _talkScript = 0, _walkScript = 0;
140 bool _ignoreTurns =
false;
141 bool _drawToBackBuf =
false;
143 uint16 _sound[32] = {};
147 int _heOffsX = 0, _heOffsY = 0;
148 bool _heSkipLimbs =
false;
149 uint32 _heCondMask = 0;
150 uint32 _hePaletteNum = 0;
151 uint32 _heShadow = 0;
165 int32 deltaXFactor = 0, deltaYFactor = 0;
166 uint16 xfrac = 0, yfrac = 0;
167 uint16 xAdd = 0, yAdd = 0;
177 point3.
x = point3.
y = 0;
189 uint16 _palette[256] = {};
192 uint16 _targetFacing = 0;
193 uint _speedx = 0, _speedy = 0;
194 byte _animProgress = 0, _animSpeed = 0;
195 bool _costumeNeedsInit =
false;
197 int16 _animVariable[27] = {};
205 virtual void hideActor();
208 virtual void initActor(
int mode);
211 putActor(_pos.
x, _pos.
y, _room);
214 void putActor(
int room) {
215 putActor(_pos.
x, _pos.
y, room);
218 void putActor(
int x,
int y) {
219 putActor(x, y, _room);
222 void putActor(
int x,
int y,
int room);
223 void setActorWalkSpeed(uint newSpeedX, uint newSpeedY);
226 virtual int actorWalkStep();
227 virtual int remapDirection(
int dir,
bool is_walking);
228 virtual void setupActorScale();
230 void setBox(
int box);
231 int updateActorDirection(
bool is_walking);
234 void adjustActorPos();
237 virtual void setDirection(
int direction);
238 void faceToObject(
int obj);
239 virtual void turnToDirection(
int newdir);
240 virtual void walkActor();
241 void drawActorCostume(
bool hitTestMode =
false);
243 virtual void animateCostume();
244 virtual void setActorCostume(
int c);
246 void animateLimb(
int limb,
int f);
248 bool actorHitTest(
int x,
int y);
250 const byte *getActorName();
251 void startWalkActor(
int x,
int y,
int dir);
252 void stopActorMoving();
254 void startWalkAnim(
int cmd,
int angle);
256 void runActorTalkScript(
int f);
257 virtual void startAnimActor(
int frame);
259 void remapActorPalette(
int r_fact,
int g_fact,
int b_fact,
int threshold);
260 void remapActorPaletteColor(
int slot,
int color);
262 void animateActor(
int anim);
264 bool isInCurrentRoom()
const {
265 return _room == _vm->_currentRoom;
271 p.
x *= V12_X_MULTIPLIER;
272 p.
y *= V12_Y_MULTIPLIER;
281 int getRoom()
const {
285 int getFacing()
const {
289 void setFacing(
int newFacing) {
293 int getAnimVar(byte var)
const;
294 void setAnimVar(byte var,
int value);
296 void setAnimSpeed(byte newAnimSpeed) {
297 _animSpeed = newAnimSpeed;
301 int getAnimSpeed()
const {
305 int getAnimProgress()
const {
306 return _animProgress;
309 int getElevation()
const {
313 void setElevation(
int newElevation) {
314 if (_elevation != newElevation) {
315 _elevation = newElevation;
325 void setPalette(
int idx,
int val) {
330 void setScale(
int sx,
int sy) {
342 void classChanged(
int cls,
bool value);
347 bool isInClass(
int cls);
349 virtual bool isPlayer();
351 bool findPathTowards(byte box, byte box2, byte box3,
Common::Point &foundPath);
358 void initActor(
int mode)
override;
359 void walkActor()
override;
365 void setupActorScale()
override;
369 virtual int actorWalkStep()
override;
371 const int _facingXYratio;
378 void initActor(
int mode)
override;
379 void walkActor()
override;
383 bool isPlayer()
override;
386 int actorWalkStep()
override;
387 int remapDirection(
int dir,
bool is_walking)
override;
394 void initActor(
int mode)
override;
395 void walkActor()
override;
396 void turnToDirection(
int newdir)
override;
397 void startAnimActor(
int frame)
override;
400 int updateActorDirection();
403 enum ActorV0MiscFlags {
404 kActorMiscFlagStrong = 0x01,
405 kActorMiscFlagGTFriend = 0x02,
406 kActorMiscFlagWatchedTV = 0x04,
407 kActorMiscFlagEdsEnemy = 0x08,
408 kActorMiscFlag_10 = 0x10,
409 kActorMiscFlag_20 = 0x20,
410 kActorMiscFlagFreeze = 0x40,
411 kActorMiscFlagHide = 0x80
420 byte _walkboxQueue[0x10] = {};
421 byte _walkboxQueueIndex = 0;
423 byte _costCommandNew = 0;
424 byte _costCommand = 0;
428 byte _walkCountModulo = 0;
429 bool _newWalkBoxEntered =
false;
434 byte _walkYCountGreaterThanXCount = 0;
435 byte _walkXCount = 0;
436 byte _walkXCountInc = 0;
437 byte _walkYCount = 0;
438 byte _walkYCountInc = 0;
440 byte _walkMaxXYCountInc = 0;
444 byte _tmp_WalkBox = 0;
445 bool _tmp_NewWalkBoxEntered =
false;
447 int8 _animFrameRepeat = 0;
448 int8 _limbFrameRepeatNew[8] = {};
449 int8 _limbFrameRepeat[8] = {};
451 bool _limb_flipped[8] = {};
455 bool walkBoxQueueAdd(
int box);
456 bool walkBoxQueueFind(
int box);
457 void walkboxQueueReverse();
462 void initActor(
int mode)
override;
463 void animateActor(
int anim);
464 void animateCostume()
override;
466 void limbFrameCheck(
int limb);
468 void directionUpdate();
470 void setDirection(
int direction)
override;
471 void startAnimActor(
int f)
override;
473 bool calcWalkDistances();
474 void walkActor()
override;
475 void actorSetWalkTo();
476 byte actorWalkXCalculate();
477 byte actorWalkYCalculate();
478 byte updateWalkbox();
480 void walkBoxQueueReset();
481 bool walkBoxQueuePrepare();
486 void setActorToTempPosition();
487 void setActorToOriginalPosition();
Common::Point _pos
Definition: actor.h:105
byte heversion
Definition: detection.h:82
Definition: serializer.h:79
byte version
Definition: detection.h:79
Definition: serializer.h:308
int16 x
Definition: rect.h:46
Definition: base-costume.h:68
int16 y
Definition: rect.h:47