22 #ifndef LURE_SURFACE_H 23 #define LURE_SURFACE_H 26 #include "common/str.h" 27 #include "common/ptr.h" 28 #include "lure/disk.h" 29 #include "lure/luredefs.h" 33 #define DEFAULT_TEXT_COLOR -1 38 uint16 _width, _height;
40 void egaCreateDialog();
41 void vgaCreateDialog();
42 void egaRefreshDialog();
43 void vgaRefreshDialog();
46 Surface(uint16 width, uint16 height);
48 static uint16 textX();
49 static uint16 textY();
50 static void getDialogBounds(
Common::Point &size,
int charWidth,
int numLines,
51 bool squashedLines =
true);
53 static void initialize();
54 static void deinitialize();
56 uint16 width() {
return _width; }
57 uint16 height() {
return _height; }
60 void loadScreen(uint16 resourceId);
62 int writeChar(uint16 x, uint16 y, uint8 ascii,
bool transparent,
int color);
63 void writeString(uint16 x, uint16 y,
Common::String line,
bool transparent,
64 int color = DEFAULT_TEXT_COLOR,
bool varLength =
true);
65 void writeSubstring(uint16 x, uint16 y,
Common::String line,
int len,
66 bool transparent,
int color = DEFAULT_TEXT_COLOR,
bool varLength =
true);
67 void transparentCopyTo(
Surface *dest);
69 void copyTo(
Surface *dest, uint16 x, uint16 y);
71 int transparentColor = -1);
72 void copyFrom(
MemoryBlock *src) { _data->copyFrom(src); }
74 void empty() { _data->empty(); }
78 void copyToScreen(uint16 x, uint16 y);
79 void centerOnScreen();
81 static uint16 textWidth(
const char *s,
int numChars = 0);
82 static void wordWrap(
char *text, uint16 width,
char **&lines, uint8 &numLines);
83 static Surface *newDialog(uint16 width, uint8 numLines,
const char **lines,
bool varLength =
true,
84 int color = DEFAULT_TEXT_COLOR,
bool squashedLines =
true);
85 static Surface *newDialog(uint16 width,
const char *lines,
int color = DEFAULT_TEXT_COLOR);
86 static Surface *getScreen(uint16 resourceId);
87 bool getString(
Common::String &line,
int maxSize,
bool isNumeric,
bool varLength, int16 x, int16 y);
92 static void show(
const char *text);
93 static void show(uint16 stringId,
const char *hotspotName,
const char *characterName);
94 static void show(uint16 stringId);
100 char _desc[MAX_DESC_SIZE];
103 int _endLine, _endIndex;
107 uint16 _destCharacterId;
108 uint16 _activeItemId;
111 int getArticle(uint16 msgId, uint16 objId);
112 void vgaTalkDialog(
Surface *s);
114 TalkDialog(uint16 characterId, uint16 destCharacterId, uint16 activeItemId, uint16 descId);
117 char *desc() {
return _desc; }
118 Surface &surface() {
return *_surface; }
119 void copyTo(
Surface *dest, uint16 x, uint16 y);
120 bool isBuilding() {
return _endLine < _numLines; }
128 static void toggleHightlight(
int xs,
int xe,
int ys,
int ye);
130 static bool show(
bool saveDialog);
141 HotspotsList _hotspots;
144 void chooseCharacters();
159 void toggleVisibility();
Definition: surface.h:126
Definition: surface.h:150
Definition: surface.h:138
Definition: surface.h:133