29 #ifndef HUGO_DISPLAY_H 30 #define HUGO_DISPLAY_H 32 #include "graphics/surface.h" 33 #include "graphics/fonts/dosfont.h" 37 class SeekableReadStream;
42 enum OverlayState {kOvlUndef, kOvlForeground, kOvlBackground};
44 static const int kCenter = -1;
59 virtual void loadFont(int16 fontId) = 0;
61 virtual int16 fontHeight()
const = 0;
62 virtual int16 stringLength(
const char *s)
const = 0;
64 void displayBackground();
65 virtual void displayFrame(
const int sx,
const int sy,
Seq *seq,
const bool foreFl) = 0;
66 void displayList(
int update, ...);
67 void displayRect(
const int16 x,
const int16 y,
const int16 dx,
const int16 dy);
68 void drawBoundaries();
69 void drawRectangle(
const bool filledFl,
const int16 x1,
const int16 y1,
const int16 x2,
const int16 y2,
const int color);
70 void drawShape(
const int x,
const int y,
const int color1,
const int color2);
71 void updateStatusText();
72 void updatePromptText(
const char *command,
char cursor);
73 void drawStatusText();
74 void displayStatusText();
75 void drawPromptText();
76 void displayPromptText();
80 void initNewScreenDisplay();
82 void moveImage(
ImagePtr srcImage,
const int16 x1,
const int16 y1,
const int16 dx, int16 dy,
const int16 width1,
ImagePtr dstImage,
const int16 x2,
const int16 y2,
const int16 width2);
83 void remapPal(uint16 oldIndex, uint16 newIndex);
84 void resetInventoryObjId();
87 void setBackgroundColor(
const uint16 color);
89 void selectInventoryObjId(
const int16 objId);
90 void shadowStr(int16 sx,
const int16 sy,
const char *s,
const byte color);
92 void userHelp()
const;
93 virtual void writeStr(int16 sx,
const int16 sy,
const char *s,
const byte color) = 0;
94 Common::Rect drawDosText(byte x, byte y,
const char *text, byte color);
95 byte getDosMessageBoxBorder()
const;
100 Icondib &getIconBuffer();
101 Viewdib &getBackBuffer();
102 Viewdib &getBackBufferBackup();
103 Viewdib &getFrontBuffer();
104 Viewdib &getGUIBuffer();
109 static const int kRectListSize = 16;
110 static const int kBlitListSize = kRectListSize * 2;
111 static const int kShapeSize = 24;
112 static const byte stdMouseCursorHeight = 20;
113 static const byte stdMouseCursorWidth = 12;
121 Viewdib _frontBuffer;
124 inline bool isInX(
const int16 x,
const Rect *rect)
const;
125 inline bool isInY(
const int16 y,
const Rect *rect)
const;
126 inline bool isOverlapping(
const Rect *rectA,
const Rect *rectB)
const;
128 int16 center(
const char *s)
const;
131 byte _iconImage[kInvDx * kInvDy];
135 int16 mergeLists(
Rect *list,
Rect *blist,
const int16 len, int16 blen);
139 Viewdib _backBufferBackup;
140 Viewdib _frontBufferBoxBackup;
143 int16 _dlAddIndex, _dlRestoreIndex;
144 Rect _dlRestoreList[kRectListSize];
145 Rect _dlAddList[kRectListSize];
146 Rect _dlBlistList[kBlitListSize];
150 void merge(
const Rect *rectA,
Rect *rectB);
158 void loadFont(int16 fontId)
override;
159 int16 fontHeight()
const override;
160 int16 stringLength(
const char *s)
const override;
162 void displayFrame(
const int sx,
const int sy,
Seq *seq,
const bool foreFl)
override;
166 void writeStr(int16 sx,
const int16 sy,
const char *s,
const byte color)
override;
168 OverlayState findOvl(
Seq *seqPtr,
ImagePtr dstPtr, uint16 y);
176 void loadFont(int16 fontId)
override;
177 int16 fontHeight()
const override;
178 int16 stringLength(
const char *s)
const override;
180 void displayFrame(
const int sx,
const int sy,
Seq *seq,
const bool foreFl)
override;
184 void writeStr(int16 sx,
const int16 sy,
const char *s,
const byte color)
override;
186 static const int kFontLength = 128;
187 static const int kFontSize = 1200;
188 static const int kNumFonts = 3;
190 bool fontLoadedFl[kNumFonts];
194 byte _fontdata[kNumFonts][kFontSize];
195 byte *_font[kNumFonts][kFontLength];
197 OverlayState findOvl(
Seq *seqPtr,
ImagePtr dstPtr, uint16 y);
199 void writeChr(
const int sx,
const int sy,
const byte color,
const char *local_fontdata);
204 #endif //HUGO_DISPLAY_H
byte * ImagePtr
Definition: game.h:97
Definition: algorithm.h:29
Definition: display.h:171
Definition: display.h:153
Definition: keyboard.h:294