22 #ifndef SCI_GRAPHICS_TEXT32_H 23 #define SCI_GRAPHICS_TEXT32_H 25 #include "sci/engine/state.h" 26 #include "sci/graphics/celobj32.h" 27 #include "sci/graphics/frameout.h" 28 #include "sci/graphics/helpers.h" 33 kTextAlignDefault = -1,
39 enum ScrollDirection {
64 int16 _width, _height;
96 GuiResourceId _fontId;
112 TextAlign _alignment;
119 void drawFrame(
const Common::Rect &rect,
const int16 size,
const uint8 color,
const bool doScaling);
121 void drawChar(
const uint16 charIndex);
122 void drawText(
const uint index, uint length);
131 uint getLongest(uint *charIndex,
const int16 maxWidth);
137 int16 getTextWidth(
const uint index, uint length)
const;
143 void getTextDimensions(
const uint index, uint length, int16 &width, int16& height)
const;
147 const int16 scriptWidth =
g_sci->_gfxFrameout->getScriptWidth();
148 const int16 scriptHeight =
g_sci->_gfxFrameout->getScriptHeight();
151 mulinc(scaledRect, scaleX, scaleY);
191 reg_t createFontBitmap(int16 width, int16 height,
const Common::Rect &rect,
const Common::String &text,
const uint8 foreColor,
const uint8 backColor,
const uint8 skipColor,
const GuiResourceId fontId, TextAlign alignment,
const int16 borderColor,
bool dimmed,
const bool doScaling,
const bool gc);
201 reg_t createTitledFontBitmap(int16 width, int16 height,
const Common::Rect &textRect,
const Common::String &text,
const uint8 foreColor,
const uint8 backColor,
const uint8 skipColor,
const GuiResourceId fontId,
const TextAlign alignment,
const int16 borderColor,
const Common::String &title,
const uint8 titleForeColor,
const uint8 titleBackColor,
const GuiResourceId titleFontId,
const bool doScaling,
const bool gc);
203 inline int scaleUpWidth(
int value)
const {
204 const int scriptWidth =
g_sci->_gfxFrameout->getScriptWidth();
205 return (value * scriptWidth + _xResolution - 1) /
_xResolution;
208 inline int scaleUpHeight(
int value)
const {
209 const int scriptHeight =
g_sci->_gfxFrameout->getScriptHeight();
210 return (value * scriptHeight + _yResolution - 1) /
_yResolution;
232 void invertRect(
const reg_t bitmap,
const int16 bitmapStride,
const Common::Rect &rect,
const uint8 foreColor,
const uint8 backColor,
const bool doScaling);
238 void setFont(
const GuiResourceId fontId);
248 uint16
getCharWidth(
const uint16 charIndex,
const bool doScaling)
const;
259 int16 getTextWidth(
const Common::String &text,
const uint index,
const uint length);
283 void scrollLine(
const Common::String &textLine,
int numLines, uint8 color, TextAlign align, GuiResourceId fontId, ScrollDirection dir);
285 bool SwitchToFont1001OnKorean(
const char *text);
291 #endif // SCI_GRAPHICS_TEXT32_H reg_t createTitledFontBitmap(int16 width, int16 height, const Common::Rect &textRect, const Common::String &text, const uint8 foreColor, const uint8 backColor, const uint8 skipColor, const GuiResourceId fontId, const TextAlign alignment, const int16 borderColor, const Common::String &title, const uint8 titleForeColor, const uint8 titleBackColor, const GuiResourceId titleFontId, const bool doScaling, const bool gc)
static int16 _yResolution
Definition: text32.h:178
int16 getTextCount(const Common::String &text, const uint index, const Common::Rect &textRect, const bool doScaling)
Common::Rect getTextSize(const Common::String &text, const int16 maxWidth, bool doScaling)
Definition: rational.h:40
reg_t _bitmap
Definition: text32.h:166
void scrollLine(const Common::String &textLine, int numLines, uint8 color, TextAlign align, GuiResourceId fontId, ScrollDirection dir)
Definition: celobj32.h:64
int16 getStringWidth(const Common::String &text)
int16 getScaledFontHeight() const
void erase(const Common::Rect &rect, const bool doScaling)
static int16 _xResolution
Definition: text32.h:172
Definition: seg_manager.h:48
GfxFont * _font
Definition: text32.h:186
void setFont(const GuiResourceId fontId)
Definition: vm_types.h:39
uint16 getCharWidth(const uint16 charIndex, const bool doScaling) const
reg_t createFontBitmap(int16 width, int16 height, const Common::Rect &rect, const Common::String &text, const uint8 foreColor, const uint8 backColor, const uint8 skipColor, const GuiResourceId fontId, TextAlign alignment, const int16 borderColor, bool dimmed, const bool doScaling, const bool gc)