ScummVM API documentation
anihandler.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 NGI_ANIHANDLER_H
23 #define NGI_ANIHANDLER_H
24 
25 namespace NGI {
26 
27 class ExCommand2;
28 class Movement;
29 class Statics;
30 
31 struct MGMSubItem {
32  Movement *movement;
33  int staticsIndex;
34  int field_8;
35  int field_C;
36  int x;
37  int y;
38 
39  MGMSubItem();
40 
41  void reset() {
42  movement = nullptr;
43  staticsIndex = 0;
44  field_8 = 0;
45  field_C = 0;
46  x = 0;
47  y = 0;
48  }
49 };
50 
51 struct MGMItem {
52  int16 objId;
55  Common::Array<Movement *> movements1;
56  Common::Array<int> movements2;
57 
58  MGMItem();
59 };
60 
62  StaticANIObject *ani;
63  int staticsId1;
64  int staticsId2;
65  int movementId;
66  int field_10;
67  int x1;
68  int y1;
69  int field_1C;
70  int x2;
71  int y2;
72  int flags;
73 
74  MakeQueueStruct() { reset(); }
75 
76  void reset() {
77  ani = nullptr;
78  staticsId1 = 0;
79  staticsId2 = 0;
80  movementId = 0;
81  field_10 = 0;
82  x1 = 0;
83  y1 = 0;
84  field_1C = 0;
85  x2 = 0;
86  y2 = 0;
87  flags = 0;
88  }
89 };
90 
91 class AniHandler : public CObject {
92 protected:
94 
95 public:
96  void detachAllObjects();
97  void attachObject(int objId);
98  void resetData(int objId);
99  int getIndex(int objId);
100 
101  MessageQueue *makeRunQueue(MakeQueueStruct *mkQueue);
102  void putObjectToStatics(StaticANIObject *ani, int staticsId);
103  Common::Point getTransitionSize(int aniId, int staticsId1, int staticsId2);
104  int getStaticsIndexById(int idx, int16 id);
105  int getStaticsIndex(int idx, Statics *st);
106  void clearVisitsList(int idx);
107  int seekWay(int idx, int st1idx, int st2idx, bool flip, bool flop);
108  Common::Point getNumCycles(Movement *mov, int x, int y, int *mult, int *len, int flag);
109  ExCommand2 *createCommand(Movement *mov, int objId, int x1, int y1, Common::Point &x2, Common::Point &y2, int len);
110  MessageQueue *makeQueue(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr);
111  int getFramesCount(int idx, int subIdx, int subOffset, int flag);
112  int getNumMovements(int objectId, int idx1, int idx2);
113 };
114 
115 } // End of namespace NGI
116 
117 #endif /* NGI_ANIHANDLER_H */
Definition: array.h:52
Definition: statics.h:107
Definition: anihandler.h:31
Definition: statics.h:87
Definition: messages.h:108
Definition: anihandler.h:61
Definition: anihandler.h:91
Definition: rect.h:45
Movement
Definition: walking.h:85
Definition: statics.h:172
Definition: anihandler.h:25
Definition: anihandler.h:51
Definition: messages.h:84
Definition: utils.h:106