ScummVM API documentation
animator_lok.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef KYRA_ANIMATOR_LOK_H
23 #define KYRA_ANIMATOR_LOK_H
24 
25 namespace Kyra {
26 class KyraEngine_LoK;
27 class Screen;
28 
29 class Animator_LoK {
30 public:
31  struct AnimObject {
32  uint8 index;
33  uint32 active;
34  uint32 refreshFlag;
35  uint32 bkgdChangeFlag;
36  bool disable;
37  uint32 flags;
38  int16 drawY;
39  uint8 *sceneAnimPtr;
40  int16 animFrameNumber;
41  uint8 *background;
42  uint16 rectSize;
43  int16 x1, y1;
44  int16 x2, y2;
45  uint16 width;
46  uint16 height;
47  uint16 width2;
48  uint16 height2;
49  AnimObject *nextAnimObject;
50  };
51 
52  Animator_LoK(KyraEngine_LoK *vm, OSystem *system);
53  virtual ~Animator_LoK();
54 
55  operator bool() const { return _initOk; }
56 
57  void init(int actors, int items, int sprites);
58  void close();
59 
60  AnimObject *objects() { return _screenObjects; }
61  AnimObject *actors() { return _actors; }
62  AnimObject *items() { return _items; }
63  AnimObject *sprites() { return _sprites; }
64 
65  void initAnimStateList();
66  void preserveAllBackgrounds();
67  void flagAllObjectsForBkgdChange();
68  void flagAllObjectsForRefresh();
69  void restoreAllObjectBackgrounds();
70  void preserveAnyChangedBackgrounds();
71  virtual void prepDrawAllObjects();
72  void copyChangedObjectsForward(int refreshFlag, bool refreshScreen = true);
73 
74  void updateAllObjectShapes(bool refreshScreen = true);
75  void animRemoveGameItem(int index);
76  void animAddGameItem(int index, uint16 sceneId);
77  void animAddNPC(int character);
78  void animRefreshNPC(int character);
79 
80  void clearQueue() { _objectQueue = 0; }
81  void addObjectToQueue(AnimObject *object);
82  void refreshObject(AnimObject *object);
83 
84  void makeBrandonFaceMouse();
85  void setBrandonAnimSeqSize(int width, int height);
86  void resetBrandonAnimSeqSize();
87  void setCharacterDefaultFrame(int character);
88  void setCharactersHeight();
89 
90  int16 fetchAnimWidth(const uint8 *shape, int16 mult);
91  int16 fetchAnimHeight(const uint8 *shape, int16 mult);
92 
93  int _noDrawShapesFlag;
94  uint16 _brandonDrawFrame;
95  int _brandonScaleX;
96  int _brandonScaleY;
97 
98 protected:
99  KyraEngine_LoK *_vm;
100  Screen *_screen;
101  OSystem *_system;
102  bool _initOk;
103 
104  AnimObject *_screenObjects;
105 
106  AnimObject *_actors;
107  AnimObject *_items;
108  AnimObject *_sprites;
109 
110  uint8 *_actorBkgBackUp[2];
111 
112  AnimObject *objectRemoveQueue(AnimObject *queue, AnimObject *rem);
113  AnimObject *objectAddHead(AnimObject *queue, AnimObject *head);
114  AnimObject *objectQueue(AnimObject *queue, AnimObject *add);
115 
116  void preserveOrRestoreBackground(AnimObject *obj, bool restore);
117 
118  AnimObject *_objectQueue;
119 
120  int _brandonAnimSeqSizeWidth;
121  int _brandonAnimSeqSizeHeight;
122 };
123 
124 } // End of namespace Kyra
125 
126 #endif
Definition: screen.h:565
Definition: atari-screen.h:60
Definition: animator_lok.h:31
Definition: animator_lok.h:29
Definition: kyra_lok.h:97
Definition: detection.h:27
Definition: system.h:161