* * rct2: 0x006C1DB7 * * left : cx * top : dx * numLines : bp * text : esi * rt : edi */
| 292 | * rt : edi |
| 293 | */ |
| 294 | void drawStringCentredRaw( |
| 295 | RenderTarget& rt, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle) |
| 296 | { |
| 297 | ScreenCoordsXY screenCoords(rt.x, rt.y); |
| 298 | drawText(rt, screenCoords, "", { Colour::black, fontStyle }); |
| 299 | screenCoords = coords; |
| 300 | |
| 301 | for (int32_t i = 0; i <= numLines; i++) |
| 302 | { |
| 303 | int32_t width = getStringWidth(text, fontStyle); |
| 304 | drawText(rt, screenCoords - ScreenCoordsXY{ width / 2, 0 }, text, { kColourNull, fontStyle }); |
| 305 | |
| 306 | const utf8* ch = text; |
| 307 | const utf8* nextCh = nullptr; |
| 308 | |
| 309 | while ((UTF8GetNext(ch, &nextCh)) != 0) |
| 310 | { |
| 311 | ch = nextCh; |
| 312 | } |
| 313 | text = const_cast<char*>(ch + 1); |
| 314 | |
| 315 | screenCoords.y += FontGetLineHeight(fontStyle); |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | int32_t getStringHeightRaw(std::string_view text, FontStyle fontStyle) |
| 320 | { |
no test coverage detected