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

Function drawStringRightUnderline

src/OpenLoco/src/Graphics/TextRenderer.cpp:558–584  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

556 // esi: args
557 // edi: rt
558 static Ui::Point drawStringRightUnderline(
559 TextDrawingState& drawState,
560 DrawingContext& ctx,
561 const RenderTarget& rt,
562 Ui::Point origin,
563 AdvancedColour colour,
564 StringId stringId,
565 FormatArgumentsView args)
566 {
567 char buffer[512];
568 StringManager::formatString(buffer, std::size(buffer), stringId, args);
569
570 uint16_t width = getStringWidth(drawState.font, buffer);
571 auto point = origin;
572 point.x -= width;
573
574 drawString(drawState, ctx, rt, point, colour, buffer);
575
576 // Draw underline
577 ctx.drawRect(point.x, point.y + 11, width, 1, drawState.textColours[PaletteIndex::textRemap0], RectFlags::none);
578 if (drawState.textColours[PaletteIndex::textRemap1] != 0)
579 {
580 ctx.drawRect(point.x, point.y + 12, width, 1, drawState.textColours[PaletteIndex::textRemap1], RectFlags::none);
581 }
582
583 return point;
584 }
585
586 // 0x00494D78
587 // al: colour

Callers 1

Calls 4

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

Tested by

no test coverage detected