0x00495224 al: colour bp: width bx: string id cx: x dx: y esi: args edi: rt
| 435 | // esi: args |
| 436 | // edi: rt |
| 437 | static Ui::Point drawStringLeftWrapped( |
| 438 | TextDrawingState& drawState, |
| 439 | DrawingContext& ctx, |
| 440 | const RenderTarget& rt, |
| 441 | Ui::Point origin, |
| 442 | int16_t width, |
| 443 | AdvancedColour colour, |
| 444 | StringId stringId, |
| 445 | FormatArgumentsView args) |
| 446 | { |
| 447 | char buffer[512]; |
| 448 | StringManager::formatString(buffer, std::size(buffer), stringId, args); |
| 449 | |
| 450 | // Setup the text colours (FIXME: This should be a separate function) |
| 451 | const auto curDrawState = drawState; |
| 452 | char empty[1] = ""; |
| 453 | drawString(drawState, ctx, rt, origin, colour, empty); |
| 454 | drawState = curDrawState; |
| 455 | |
| 456 | auto wrapResult = wrapString(drawState.font, buffer, width); |
| 457 | auto breakCount = wrapResult.second + 1; |
| 458 | |
| 459 | // wrapString might change the font due to formatting codes |
| 460 | uint16_t lineHeight = getLineHeight(drawState.font); // _112D404 |
| 461 | |
| 462 | auto point = origin; |
| 463 | |
| 464 | const char* ptr = buffer; |
| 465 | for (auto i = 0; ptr != nullptr && i < breakCount; i++) |
| 466 | { |
| 467 | drawString(drawState, ctx, rt, point, AdvancedColour::FE(), const_cast<char*>(ptr)); |
| 468 | ptr = advanceToNextLineWrapped(ptr); |
| 469 | point.y += lineHeight; |
| 470 | } |
| 471 | |
| 472 | return point; |
| 473 | } |
| 474 | |
| 475 | /** |
| 476 | * 0x00494B3F |
no test coverage detected