MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / drawStringLeftUnderline

Function drawStringLeftUnderline

src/OpenLoco/src/Graphics/TextRenderer.cpp:593–617  ·  view source on GitHub ↗

0x00494D78 al: colour bx: string id cx: x dx: y esi: args edi: rt

Source from the content-addressed store, hash-verified

591 // esi: args
592 // edi: rt
593 static Ui::Point drawStringLeftUnderline(
594 TextDrawingState& drawState,
595 DrawingContext& ctx,
596 const RenderTarget& rt,
597 Ui::Point origin,
598 AdvancedColour colour,
599 StringId stringId,
600 FormatArgumentsView args)
601 {
602 char buffer[512];
603 StringManager::formatString(buffer, std::size(buffer), stringId, args);
604
605 uint16_t width = getStringWidth(drawState.font, buffer);
606
607 auto point = drawString(drawState, ctx, rt, origin, colour, buffer);
608
609 // Draw underline
610 ctx.drawRect(origin.x, origin.y + 11, width, 1, drawState.textColours[PaletteIndex::textRemap0], RectFlags::none);
611 if (drawState.textColours[PaletteIndex::textRemap1] != 0)
612 {
613 ctx.drawRect(origin.x, origin.y + 12, width, 1, drawState.textColours[PaletteIndex::textRemap1], RectFlags::none);
614 }
615
616 return point;
617 }
618
619 // 0x00494DE8
620 // al: colour

Callers 1

Calls 4

formatStringFunction · 0.85
getStringWidthFunction · 0.85
drawStringFunction · 0.85
drawRectMethod · 0.45

Tested by

no test coverage detected