22 #ifndef QUEEN_CUTAWAY_H 23 #define QUEEN_CUTAWAY_H 25 #include "common/util.h" 26 #include "queen/structs.h" 36 static void run(
const char *filename,
char *nextFilename,
QueenEngine *vm);
47 MAX_BANK_NAME_COUNT = 5,
48 MAX_FILENAME_LENGTH = 12,
49 MAX_FILENAME_SIZE = (MAX_FILENAME_LENGTH + 1),
50 MAX_PERSON_FACE_COUNT = 13,
51 MAX_STRING_LENGTH = 255,
52 MAX_STRING_SIZE = (MAX_STRING_LENGTH + 1),
61 OBJECT_TYPE_ANIMATION = 0,
62 OBJECT_TYPE_PERSON = 1,
63 OBJECT_TYPE_NO_ANIMATION = 2,
64 OBJECT_TYPE_TEXT_SPEAK = 3,
65 OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK = 4,
66 OBJECT_TYPE_TEXT_DISPLAY = 5
71 struct CutawayObject {
93 int person[MAX_PERSON_COUNT];
115 struct ObjectDataBackup {
141 uint16 _nextSentenceOff;
147 int16 _cutawayObjectCount;
150 bool _anotherCutaway;
162 char _bankNames[MAX_BANK_NAME_COUNT][MAX_FILENAME_SIZE];
165 char _basename[MAX_FILENAME_SIZE];
168 char _talkFile[MAX_FILENAME_SIZE];
174 ObjectDataBackup _personData[MAX_PERSON_COUNT];
177 int _personDataCount;
180 PersonFace _personFace[MAX_PERSON_FACE_COUNT];
183 int _personFaceCount;
189 int16 _songBeforeComic;
197 void run(
char *nextFilename);
200 void load(
const char *filename);
203 void loadStrings(uint16 offset);
206 const byte *turnOnPeople(
const byte *ptr, CutawayObject &
object);
209 void limitBob(CutawayObject &
object);
212 void changeRooms(CutawayObject &
object);
215 ObjectType getObjectType(CutawayObject &
object);
218 const byte *handleAnimation(
const byte *ptr, CutawayObject &
object);
221 void handlePersonRecord(
int index, CutawayObject &
object,
const char *sentence);
224 void handleText(
int index,
ObjectType type, CutawayObject &
object,
const char *sentence);
227 void restorePersonData();
233 void updateGameState();
236 void talk(
char *nextFilename);
239 const byte *getCutawayAnim(
const byte *ptr,
int header, CutawayAnim &anim);
242 int makeComplexAnimation(int16 currentImage, CutawayAnim *objAnim,
int frameCount);
245 static const byte *getCutawayObject(
const byte *ptr, CutawayObject &
object);
248 void dumpCutawayObject(
int index, CutawayObject &
object);
251 int countSpaces(
ObjectType type,
const char *segment);
254 int scale(CutawayObject &
object);
257 static void dumpCutawayAnim(CutawayAnim &anim);
259 bool inRange(int16 x, int16 l, int16 h)
const {
return (x <= h && x >= l); }
static void run(const char *filename, char *nextFilename, QueenEngine *vm)
Public interface to run a cutaway from a file.
ObjectType
Different kinds of cutaway objects.
Definition: cutaway.h:60