25 #include "common/scummsys.h" 26 #include "common/str.h" 27 #include "common/rect.h" 28 #include "twine/shared.h" 35 #define TEXT_MAX_FADE_IN_CHR 32 40 enum class ProgressiveTextState {
51 void initVoxBank(TextBankId bankIdx);
58 void drawCharacter(int32 x, int32 y, uint16 character);
66 void drawCharacterShadow(int32 x, int32 y, uint16 character, int32 color,
Common::Rect& dirtyRect);
72 struct LineCharacter {
76 WordSize getNextWord(
const char *completeText,
char *wordBuf, int32 wordBufSize);
77 uint16 getNextChar(
const char *&dialogue);
79 void appendText(
const char *s, uint &i);
81 void renderContinueReadingTriangle();
85 void pushChar(int16 baseX, int16 y,
const LineCharacter &chr);
91 void fadeInCharacters(int32 counter, int32 fontColor);
93 TextBankId _currentBankIdx = TextBankId::None;
95 LineCharacter _bufLine[256];
96 const char *_ptDial =
nullptr;
102 const LineCharacter *_ptLine =
nullptr;
104 int32 _nbLineDial = 0;
105 struct BlendInCharacter {
110 BlendInCharacter _stackChar[TEXT_MAX_FADE_IN_CHR];
114 int32 _nbBigSpace = 0;
115 int32 _sizeSpace = 0;
118 const char *_ptText =
nullptr;
120 int32 _currDialTextSize = 0;
122 char _currMenuTextBuffer[256];
123 TextBankId _currMenuTextBank = TextBankId::None;
124 TextId _currMenuTextIndex = TextId::kNone;
127 int32 _interLeave = 0;
129 int32 _interSpace = 0;
131 int32 _dialTextColor = 0;
134 int32 _maxDegrade = 0;
136 int32 _minDegrade = 0;
142 int32 _stepDegrade = 0;
144 int32 _nbDegrade = 0;
149 int32 _maxLineDial = 0;
150 int32 _dialMaxSize = 0;
152 bool _isShiftJIS =
false;
153 bool _isVisualRTL =
false;
155 bool displayText(TextId index,
bool showText,
bool playVox,
bool loop);
160 static const int32 lineHeight = INTER_LINE;
162 bool _flagRunningDial =
false;
163 bool _flagEndDial =
false;
164 bool _flagEnd3Line =
false;
166 bool _renderTextTriangle =
false;
167 bool _flagMessageShade =
false;
168 bool _hasHiddenVox =
false;
169 int32 _voxHiddenIndex = 0;
172 const TextEntry *_currDialTextEntry =
nullptr;
177 bool _showDialogueBubble =
true;
183 void initDial(TextBankId bankIdx);
184 void initSceneTextBank();
185 inline TextBankId textBank()
const {
186 return _currentBankIdx;
195 void drawText(int32 x, int32 y,
const char *dialogue,
bool shadow =
false);
197 bool drawTextProgressive(TextId index,
bool playVox =
true,
bool loop =
true);
203 int32 sizeFont(
const char *dialogue);
204 int32 getCharWidth(uint16 chr)
const;
205 int32 getCharHeight(uint16 chr)
const;
207 void initDialWindow();
208 void secondInitDialWindow();
210 void commonOpenDial(TextId index);
212 void initInventoryText(InventoryItems index);
213 void initItemFoundText(InventoryItems index);
214 void fadeInRemainingChars();
215 ProgressiveTextState nextDialChar();
222 void setFont(int32 interLeave, int32 interSpace);
228 void setFontCrossColor(int32 color);
234 void setFontColor(int32 color);
242 void setTextCrossColor(int32 stopColor, int32 startColor, int32 stepSize);
249 bool getText(TextId index);
257 bool getMenuText(TextId index,
char *text, uint32 textSize);
260 void normalWinDial();
262 void drawAskQuestion(TextId index);
263 void drawHolomapLocation(TextId index);
266 bool playVoxSimple(
const TextEntry *text);
268 bool initVoxToPlay(
const TextEntry *text);
269 bool initVoxToPlayTextId(TextId index);
Definition: achievements_tables.h:27