0x00494DE8 al: colour bx: string id cx: x dx: y esi: args edi: rt
| 624 | // esi: args |
| 625 | // edi: rt |
| 626 | static Ui::Point drawStringCentred( |
| 627 | TextDrawingState& drawState, |
| 628 | DrawingContext& ctx, |
| 629 | const RenderTarget& rt, |
| 630 | Ui::Point origin, |
| 631 | AdvancedColour colour, |
| 632 | StringId stringId, |
| 633 | FormatArgumentsView args) |
| 634 | { |
| 635 | char buffer[512]; |
| 636 | StringManager::formatString(buffer, std::size(buffer), stringId, args); |
| 637 | |
| 638 | uint16_t width = getStringWidth(drawState.font, buffer); |
| 639 | |
| 640 | auto point = origin; |
| 641 | point.x = origin.x - (width / 2); |
| 642 | |
| 643 | if (point.x < 0) |
| 644 | { |
| 645 | return origin; |
| 646 | } |
| 647 | |
| 648 | return drawString(drawState, ctx, rt, point, colour, buffer); |
| 649 | } |
| 650 | |
| 651 | // 0x00494C36 |
| 652 | // al: colour |
no test coverage detected