31 #include "common/stack.h" 32 #include "gob/video.h" 40 #define RENDERFLAG_NOINVALIDATE 0x0001 41 #define RENDERFLAG_CAPTUREPUSH 0x0002 42 #define RENDERFLAG_COLLISIONS 0x0004 43 #define RENDERFLAG_CAPTUREPOP 0x0008 44 #define RENDERFLAG_USEDELTAS 0x0010 45 #define RENDERFLAG_BORDERHOTSPOTS 0x0040 46 #define RENDERFLAG_HASWINDOWS 0x0080 47 #define RENDERFLAG_NOBLITINVALIDATED 0x0200 48 #define RENDERFLAG_NOSUBTITLES 0x0400 49 #define RENDERFLAG_FROMSPLIT 0x0800 50 #define RENDERFLAG_DOUBLECOORDS 0x1000 51 #define RENDERFLAG_DOUBLEVIDEO 0x2000 55 static const int kSpriteCount = 100;
56 static const int kFontCount = 16;
57 static const int kFrontSurface = 20;
58 static const int kBackSurface = 21;
59 static const int kAnimSurface = 22;
60 static const int kCursorSurface = 23;
61 static const int kCaptureSurface = 30;
68 FontToSprite() : sprite(0), base(0), width(0), height(0) {}
97 const char *_textToPrint;
104 int16 _subtitleColor;
107 Font *_fonts[kFontCount];
111 int16 _invalidatedCount;
112 int16 _invalidatedLefts[30];
113 int16 _invalidatedTops[30];
114 int16 _invalidatedRights[30];
115 int16 _invalidatedBottoms[30];
119 bool _noInvalidated57;
120 bool _paletteCleared;
126 int16 _unusedPalette1[18];
127 int16 _unusedPalette2[16];
138 int16 _transparentCursor;
139 uint32 _cursorTimeKey;
146 int32 _cursorHotspotXVar;
147 int32 _cursorHotspotYVar;
149 int32 _cursorHotspotX;
150 int32 _cursorHotspotY;
157 int8 _cursorAnimLow[40];
158 int8 _cursorAnimHigh[40];
159 int8 _cursorAnimDelays[40];
162 bool _cursorDrawnFromScripts;
166 int16 _palLoadData1[4];
167 int16 _palLoadData2[4];
175 int16 _scrollOffsetY;
176 int16 _scrollOffsetX;
184 int16 _winVarArrayLeft;
185 int16 _winVarArrayTop;
186 int16 _winVarArrayWidth;
187 int16 _winVarArrayHeight;
188 int16 _winVarArrayStatus;
189 int16 _winVarArrayLimitsX;
190 int16 _winVarArrayLimitsY;
193 void invalidateRect(int16 left, int16 top, int16 right, int16 bottom);
194 void blitInvalidated();
198 void dirtiedRect(int16 surface, int16 left, int16 top, int16 right, int16 bottom);
199 void dirtiedRect(
SurfacePtr surface, int16 left, int16 top, int16 right, int16 bottom);
201 void initSpriteSurf(int16 index, int16 width, int16 height, int16 flags, byte bpp = 0);
202 void freeSprite(int16 index);
203 void adjustCoords(
char adjust, int16 *coord1, int16 *coord2);
204 void adjustCoords(
char adjust, uint16 *coord1, uint16 *coord2) {
205 adjustCoords(adjust, (int16 *)coord1, (int16 *)coord2);
207 void resizeCursors(int16 width, int16 height, int16 count,
bool transparency);
208 int stringLength(
const char *str, uint16 fontIndex);
209 void printTextCentered(int16
id, int16 left, int16 top, int16 right,
210 int16 bottom,
const char *str, int16 fontIndex, int16 color);
211 void oPlaytoons_sub_F_1B( uint16
id, int16 left, int16 top, int16 right, int16 bottom,
char *paramStr, int16 var3, int16 var4, int16 shortId);
213 int32 getSpriteRectSize(int16 index);
214 void forceBlit(
bool backwards =
false);
216 static const int16 _wobbleTable[360];
217 void wobble(
Surface &surfDesc);
219 Font *loadFont(
const char *path)
const;
220 bool loadFont(uint16 fontIndex,
const char *path);
222 virtual void initScreen() = 0;
223 virtual void closeScreen() = 0;
224 virtual void blitCursor() = 0;
226 virtual void animateCursor(int16 cursor) = 0;
227 virtual void printTotText(int16
id) = 0;
228 virtual void spriteOperation(int16 operation,
bool ttsAddHotspotText =
true) = 0;
230 virtual int16 openWin(int16
id) {
return 0; }
231 virtual void closeWin(int16
id) {}
232 virtual int16 handleCurWin() {
return 0; }
233 virtual int16 getWinFromCoord(int16 &dx, int16 &dy) {
return -1; }
234 virtual void moveWin(int16
id) {}
235 virtual bool overlapWin(int16 idWin1, int16 idWin2) {
return false; }
236 virtual void closeAllWin() {}
237 virtual void activeWin(int16
id) {}
251 void initScreen()
override;
252 void closeScreen()
override;
253 void blitCursor()
override;
254 void animateCursor(int16 cursor)
override;
255 void printTotText(int16
id)
override;
256 void spriteOperation(int16 operation,
bool ttsAddHotspotText =
true)
override;
264 void initScreen()
override;
265 void closeScreen()
override;
266 void blitCursor()
override;
267 void animateCursor(int16 cursor)
override;
268 void printTotText(int16
id)
override;
269 void spriteOperation(int16 operation,
bool ttsAddHotspotText =
true)
override;
275 uint8 _mayorWorkaroundStatus;
277 void fixLittleRedStrings();
282 void initScreen()
override;
292 void spriteOperation(int16 operation,
bool ttsAddHotspotText =
true)
override;
294 void decompWin(int16 x, int16 y,
SurfacePtr destPtr);
295 void drawWin(int16 fct);
296 void saveWin(int16
id);
297 void restoreWin(int16
id);
298 void handleWinBorder(int16
id);
299 void drawWinTrace(int16 left, int16 top, int16 width, int16 height);
301 int16 openWin(int16
id)
override;
302 void closeWin(int16
id)
override;
303 int16 getWinFromCoord(int16 &dx, int16 &dy)
override;
304 int16 handleCurWin()
override;
305 void activeWin(int16
id)
override;
306 void moveWin(int16
id)
override;
307 bool overlapWin(int16 idWin1, int16 idWin2)
override;
308 void closeAllWin()
override;
316 void spriteOperation(int16 operation,
bool ttsAddHotspotText =
true)
override;
325 void initScreen()
override;
326 void animateCursor(int16 cursor)
override;
332 bool loadCursorFile();
338 #define DRAW_BLITSURF 0 339 #define DRAW_PUTPIXEL 1 340 #define DRAW_FILLRECT 2 341 #define DRAW_DRAWLINE 3 342 #define DRAW_INVALIDATE 4 343 #define DRAW_LOADSPRITE 5 344 #define DRAW_PRINTTEXT 6 345 #define DRAW_DRAWBAR 7 346 #define DRAW_CLEARRECT 8 347 #define DRAW_FILLRECTABS 9 348 #define DRAW_DRAWLETTER 10
Definition: algorithm.h:29
Definition: surface.h:106