22 #ifndef QUEEN_GRAPHICS_H 23 #define QUEEN_GRAPHICS_H 25 #include "common/util.h" 26 #include "queen/structs.h" 58 uint16 firstFrame, lastFrame;
75 void curPos(int16 xx, int16 yy);
76 void move(int16 dstx, int16 dsty, int16 spd);
80 void animString(
const AnimFrame *animBuf);
81 void animNormal(uint16 firstFrame, uint16 lastFrame, uint16 speed,
bool rebound,
bool xflip);
83 void scaleWalkSpeed(uint16 ms);
86 void clear(
const Box *defaultBox);
98 void unpackControlBank();
104 void setupMouseCursor();
110 void drawInventoryItem(uint32
frameNum, uint16 x, uint16 y);
113 void pasteBob(uint16 objNum, uint16 image);
116 void shrinkFrame(
const BobFrame *bf, uint16 percentage);
133 void clearBob(
int index) { bob(index)->clear(&_defaultBox); }
136 void setBobText(
const BobSlot *bob,
const char *text,
int textX,
int textY,
int color,
int flags);
139 void handleParallax(uint16 roomNum);
141 void setupNewRoom(
const char *room, uint16 roomNum, int16 *furniture, uint16 furnitureCount);
143 void setBobCutawayAnim(uint16 bobNum,
bool xflip,
const AnimFrame *af, uint8 frameCount);
144 void fillAnimBuffer(
const char *anim,
AnimFrame *af);
145 uint16 countAnimFrames(
const char *anim);
146 void setupObjectAnim(
const GraphicData *gd, uint16 firstImage, uint16 bobNum,
bool visible);
147 uint16 setupPersonAnim(
const ActorData *ad,
const char *anim, uint16 curImage);
148 void resetPersonAnim(uint16 bobNum);
149 void erasePersonAnim(uint16 bobNum);
150 void eraseAllAnims();
152 uint16 refreshObject(uint16 obj);
154 void setupRoomFurniture(int16 *furniture, uint16 furnitureCount);
155 void setupRoomObjects();
157 uint16 setupPerson(uint16 noun, uint16 curImage);
158 uint16 allocPerson(uint16 noun, uint16 curImage);
160 uint16 personFrames(uint16 bobNum)
const {
return _personFrames[bobNum]; }
161 void clearPersonFrames() { memset(_personFrames, 0,
sizeof(_personFrames)); }
162 uint16 numFrames()
const {
return _numFrames; }
163 uint16 numStaticFurniture()
const {
return _numFurnitureStatic; }
164 uint16 numAnimatedFurniture()
const {
return _numFurnitureAnimated; }
165 uint16 numFurnitureFrames()
const {
return _numFurnitureStatic + _numFurnitureAnimatedLen; }
167 void putCameraOnBob(
int bobNum) { _cameraBob = bobNum; }
169 void update(uint16 room);
174 MAX_BOBS_NUMBER = 64,
175 MAX_STRING_LENGTH = 255,
176 MAX_STRING_SIZE = (MAX_STRING_LENGTH + 1),
177 BOB_SHRINK_BUF_SIZE = 60000
183 BobSlot _bobs[MAX_BOBS_NUMBER];
186 BobSlot *_sortedBobs[MAX_BOBS_NUMBER];
189 uint16 _sortedBobsCount;
200 uint16 _personFrames[4];
203 uint16 _numFurnitureAnimated;
206 uint16 _numFurnitureStatic;
209 uint16 _numFurnitureAnimatedLen;
219 const Box _defaultBox;
220 const Box _gameScreenBox;
221 const Box _fullScreenBox;
230 void prepareAnimation();
231 void updateCarAnimation();
232 void updateFightAnimation();
234 void saveState(byte *&ptr);
235 void loadState(uint32 ver, byte *&ptr);
249 uint16 _flag, _index;
258 struct BamDataBlock {
269 const BamDataBlock *_fightData;
270 uint16 _lastSoundIndex;
274 static const BamDataBlock _carData[];
275 static const BamDataBlock _fight1Data[];
276 static const BamDataBlock _fight2Data[];
277 static const BamDataBlock _fight3Data[];
278 static const BamDataBlock _fight4Data[];
Definition: graphics.h:30
int frameDir
'direction' for the next frame (-1, 1)
Definition: graphics.h:42
struct Queen::BobSlot::@726::@728 normal
normal moving animation
bool xmajor
move along x axis instead of y
Definition: graphics.h:67
bool animating
animation stuff
Definition: graphics.h:45
Definition: structs.h:345
int16 x
current position
Definition: graphics.h:33
struct Queen::BobSlot::@726::@727 string
string based animation
Box box
bounding box
Definition: graphics.h:35
int16 speed
moving speed
Definition: graphics.h:47
Definition: formatinfo.h:28
int16 endx
destination point
Definition: graphics.h:71
Definition: structs.h:575
Definition: structs.h:147
int8 xdir
moving direction
Definition: graphics.h:69
uint16 frameNum
associated BobFrame
Definition: graphics.h:40
uint16 scale
shrinking percentage
Definition: graphics.h:38
Definition: structs.h:537
Definition: graphics.h:224