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);
133 void clearBob(
int index) {
bob(index)->clear(&_defaultBox); }
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;
192 BobFrame _shrinkBuffer;
195 AnimFrame _newAnim[17][30];
198 AnimFrame _cutAnim[21][30];
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:224
void setupArrows()
setup dialog arrows
void setupMouseCursor()
setup mouse cursor
void handleParallax(uint16 roomNum)
handles parallax scrolling for the specified room
void stopBobs()
stop all animating/movings bobs
void drawInventoryItem(uint32 frameNum, uint16 x, uint16 y)
draw an inventory item
void clearBobs()
clear all setup bobs
void drawBobs()
draw all the sorted bobs
void pasteBob(uint16 objNum, uint16 image)
draw a bob directly on the backdrop bitmap
void sortBobs()
animate/move bobs and sort them
BobSlot * bob(int index)
returns a reference to the specified bob
void unpackControlBank()
unpacks control frames (ie. arrows)
void shrinkFrame(const BobFrame *bf, uint16 percentage)
resize a bobframe
void setBobText(const BobSlot *bob, const char *text, int textX, int textY, int color, int flags)
display a text 'near' the specified bob
void drawBob(const BobSlot *bs, const BobFrame *bf, const Box *box, int16 x, int16 y)
draw a bob
Definition: formatinfo.h:28
Definition: structs.h:345
Definition: structs.h:537
Definition: structs.h:575
Definition: graphics.h:30
int8 xdir
moving direction
Definition: graphics.h:69
uint16 frameNum
associated BobFrame
Definition: graphics.h:40
struct Queen::BobSlot::@918::@920 normal
normal moving animation
int frameDir
'direction' for the next frame (-1, 1)
Definition: graphics.h:42
struct Queen::BobSlot::@918::@919 string
string based animation
int16 x
current position
Definition: graphics.h:33
uint16 scale
shrinking percentage
Definition: graphics.h:38
int16 speed
moving speed
Definition: graphics.h:47
bool xmajor
move along x axis instead of y
Definition: graphics.h:67
int16 endx
destination point
Definition: graphics.h:71
bool animating
animation stuff
Definition: graphics.h:45
Box box
bounding box
Definition: graphics.h:35
Definition: structs.h:147