ScummVM API documentation
view.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 AGI_VIEW_H
23 #define AGI_VIEW_H
24 
25 namespace Agi {
26 
27 struct AgiViewCel {
28  uint8 height;
29  uint8 width;
30  uint8 clearKey;
31  bool mirrored;
32  byte *rawBitmap;
33 };
34 
35 struct AgiViewLoop {
36  int16 celCount;
37  AgiViewCel *cel;
38 };
39 
43 struct AgiView {
44  byte headerStepSize;
45  byte headerCycleTime;
46  byte *description;
47  int16 loopCount;
48  AgiViewLoop *loop;
49 
50  void reset() {
51  headerStepSize = 0;
52  headerCycleTime = 0;
53  description = nullptr;
54  loopCount = 0;
55  loop = nullptr;
56  }
57 
58  AgiView() { reset(); }
59 };
60 
61 enum MotionType {
62  kMotionNormal = 0,
63  kMotionWander = 1,
64  kMotionFollowEgo = 2,
65  kMotionMoveObj = 3,
66  kMotionEgo = 4 // used by us for mouse movement only?
67 };
68 
69 enum CycleType {
70  kCycleNormal = 0,
71  kCycleEndOfLoop = 1,
72  kCycleRevLoop = 2,
73  kCycleReverse = 3
74 };
75 
76 enum ViewFlags {
77  fDrawn = (1 << 0), // 0x0001
78  fIgnoreBlocks = (1 << 1), // 0x0002
79  fFixedPriority = (1 << 2), // 0x0004
80  fIgnoreHorizon = (1 << 3), // 0x0008
81  fUpdate = (1 << 4), // 0x0010
82  fCycling = (1 << 5), // 0x0020
83  fAnimated = (1 << 6), // 0x0040
84  fMotion = (1 << 7), // 0x0080
85  fOnWater = (1 << 8), // 0x0100
86  fIgnoreObjects = (1 << 9), // 0x0200
87  fUpdatePos = (1 << 10), // 0x0400
88  fOnLand = (1 << 11), // 0x0800
89  fDontUpdate = (1 << 12), // 0x1000
90  fFixLoop = (1 << 13), // 0x2000
91  fDidntMove = (1 << 14), // 0x4000
92  fAdjEgoXY = (1 << 15) // 0x8000
93 };
94 
99  int16 objectNr; // 0-255 -> regular screenObjTable, -1 -> addToPic-view
100  uint8 stepTime;
101  uint8 stepTimeCount;
102  int16 xPos;
103  int16 yPos;
104  uint8 currentViewNr;
105  bool viewReplaced;
106  struct AgiView *viewResource;
107  uint8 currentLoopNr;
108  uint8 loopCount;
109  struct AgiViewLoop *loopData;
110  uint8 currentCelNr;
111  uint8 celCount;
112  struct AgiViewCel *celData;
113  //int16 xPos2;
114  //int16 yPos2;
115  int16 xSize;
116  int16 ySize;
117 
118  int16 xPos_prev;
119  int16 yPos_prev;
120  int16 xSize_prev;
121  int16 ySize_prev;
122 
123  uint8 stepSize;
124  uint8 cycleTime;
125  uint8 cycleTimeCount;
126  uint8 direction;
127  MotionType motionType;
128  CycleType cycle;
129  uint8 priority;
130  uint16 flags;
131  // kMotionMoveObj
132  int16 move_x;
133  int16 move_y;
134  uint8 move_stepSize;
135  uint8 move_flag;
136  // kMotionFollowEgo
137  uint8 follow_stepSize;
138  uint8 follow_flag;
139  uint8 follow_count;
140  // kMotionWander
141  uint8 wander_count;
142  // end of motion related variables
143  uint8 loop_flag;
144  bool ignoreLoopFlag;
145 
146  void reset() { memset(this, 0, sizeof(ScreenObjEntry)); }
147  ScreenObjEntry() { reset(); }
148 
149  void setLoopFlag(uint8 flag) {
150  loop_flag = flag;
151  ignoreLoopFlag = false;
152  }
153 }; // struct vt_entry
154 
155 } // End of namespace Agi
156 
157 #endif /* AGI_VIEW_H */
Definition: view.h:98
Definition: view.h:27
Definition: view.h:35
Definition: agi.h:63
Definition: view.h:43