25 #include "common/scummsys.h" 26 #include "common/str.h" 27 #include "common/rect.h" 28 #include "twine/shared.h" 34 #define TEXT_MAX_FADE_IN_CHR 32 36 enum class ProgressiveTextState {
47 void initVoxBank(TextBankId bankIdx);
54 void drawCharacter(int32 x, int32 y, uint16 character);
62 void drawCharacterShadow(int32 x, int32 y, uint16 character, int32 color,
Common::Rect& dirtyRect);
63 void initProgressiveTextBuffer();
68 struct LineCharacter {
72 WordSize getWordSize(
const char *completeText,
char *wordBuf, int32 wordBufSize);
73 uint16 getNextChar(
const char *&dialogue);
74 void processTextLine();
75 void appendProgressiveTextBuffer(
const char *s,
int &x, uint &i);
77 void renderContinueReadingTriangle();
81 void fillFadeInBuffer(int16 baseX, int16 y,
const LineCharacter &chr);
88 void fadeInCharacters(int32 counter, int32 fontColor);
90 TextBankId _currentBankIdx = TextBankId::None;
92 LineCharacter _progressiveTextBuffer[256];
93 const char *_currentTextPosition =
nullptr;
95 int32 _dialTextBaseXPos = 0;
96 int32 _dialTextYPos = 0;
99 const LineCharacter *_progressiveTextBufferPtr =
nullptr;
101 int32 _dialTextBoxCurrentLine = 0;
102 struct BlendInCharacter {
107 BlendInCharacter _fadeInCharacters[TEXT_MAX_FADE_IN_CHR];
108 int32 _fadeInCharactersPos = 0;
111 const char *_currDialTextPtr =
nullptr;
113 int32 _currDialTextSize = 0;
115 char _currMenuTextBuffer[256];
116 TextBankId _currMenuTextBank = TextBankId::None;
117 TextId _currMenuTextIndex = TextId::kNone;
120 int32 _dialSpaceBetween = 0;
122 int32 _dialCharSpace = 0;
124 int32 _dialTextColor = 0;
127 int32 _dialTextStartColor = 0;
129 int32 _dialTextStopColor = 0;
135 int32 _dialTextStepSize = 0;
137 int32 _dialTextBufferSize = 0;
141 int32 _dialTextBoxLines = 0;
142 int32 _dialTextBoxMaxX = 0;
144 bool _isShiftJIS =
false;
145 bool _isVisualRTL =
false;
147 bool displayText(TextId index,
bool showText,
bool playVox,
bool loop);
152 static const int32 lineHeight = 38;
155 bool _hasValidTextHandle =
false;
157 bool _renderTextTriangle =
false;
158 bool _drawTextBoxBackground =
false;
159 bool _hasHiddenVox =
false;
160 int32 _voxHiddenIndex = 0;
163 const TextEntry *_currDialTextEntry =
nullptr;
168 bool _showDialogueBubble =
true;
174 void initDial(TextBankId bankIdx);
175 void initSceneTextBank();
176 inline TextBankId textBank()
const {
177 return _currentBankIdx;
186 void drawText(int32 x, int32 y,
const char *dialogue,
bool shadow =
false);
188 bool drawTextProgressive(TextId index,
bool playVox =
true,
bool loop =
true);
194 int32 getTextSize(
const char *dialogue);
195 int32 getCharWidth(uint16 chr)
const;
196 int32 getCharHeight(uint16 chr)
const;
198 void initDialogueBox();
199 void initInventoryDialogueBox();
201 void initText(TextId index);
203 void initInventoryText(InventoryItems index);
204 void initItemFoundText(InventoryItems index);
205 void fadeInRemainingChars();
206 ProgressiveTextState updateProgressiveText();
213 void setFontParameters(int32 spaceBetween, int32 charSpace);
219 void setFontCrossColor(int32 color);
225 void setFontColor(int32 color);
233 void setTextCrossColor(int32 stopColor, int32 startColor, int32 stepSize);
240 bool getText(TextId index);
248 bool getMenuText(TextId index,
char *text, uint32 textSize);
251 void normalWinDial();
253 void drawAskQuestion(TextId index);
254 void drawHolomapLocation(TextId index);
257 bool playVoxSimple(
const TextEntry *text);
259 bool initVoxToPlay(
const TextEntry *text);
260 bool initVoxToPlayTextId(TextId index);
Definition: achievements_tables.h:27