Conditions seem to be reversed, frankly.
[scummvm-innocent.git] / engines / innocent / actor.h
blobedc01e1d6d94c445b6284a36df93952ab6222bf9
1 #ifndef INNOCENT_ACTOR_H
2 #define INNOCENT_ACTOR_H
4 #include "common/queue.h"
6 #include "innocent/animation.h"
7 #include "innocent/value.h"
9 namespace Innocent {
12 class MainDat;
13 class Program;
15 class Actor : public Animation {
17 public:
18 friend class MainDat;
19 friend class Program;
20 enum {
21 Size = 0x71
24 enum ActorOffsets {
25 kOffsetOffset = 2,
26 kOffsetLeft = 4,
27 kOffsetTop = 6,
28 kOffsetMainSprite = 8,
29 kOffsetTicksLeft = 0xa,
30 kOffsetCode = 0xc,
31 kOffsetInterval = 0x10,
32 kOffsetRoom = 0x59
35 void setFrame(uint16 f) { _frame = f; }
37 uint16 room() const { return _room; }
38 void setRoom(uint16, uint16 frame = 0, uint16 nextFrame = 0);
40 bool isVisible() const;
42 void setAnimation(const CodePointer &anim);
44 void whenYouHideUpCall(const CodePointer &cp);
46 Animation::Status tick();
48 void toggleDebug();
49 private:
50 Actor(const CodePointer &code);
52 // just in case, we'll explicitly add those if needed
53 Actor();
54 Actor(const Actor &);
55 Actor &operator=(const Actor &);
57 void readHeader(const byte *code);
59 uint16 _frame;
60 uint16 _nextFrame;
61 uint16 _room;
62 byte _dir63;
64 Common::Queue<CodePointer> _callBacks;
65 void callBacks();
67 bool _debug;
69 template <int opcode>
70 Animation::Status opcodeHandler();
72 template <int N>
73 void init_opcodes();
75 virtual Animation::Status op(byte code);
77 typedef Animation::Status (Actor::*OpcodeHandler)();
78 OpcodeHandler _handlers[38];
83 #endif