MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / PaintDrawMoneyStructs

Function PaintDrawMoneyStructs

src/openrct2/paint/Paint.cpp:1078–1097  ·  view source on GitHub ↗

* * rct2: 0x006860C3 */

Source from the content-addressed store, hash-verified

1076 * rct2: 0x006860C3
1077 */
1078void PaintDrawMoneyStructs(RenderTarget& rt, PaintStringStruct* ps)
1079{
1080 do
1081 {
1082 char buffer[256]{};
1083 FormatStringLegacy(buffer, sizeof(buffer), ps->string_id, &ps->args);
1084
1085 // Use sprite font unless the currency contains characters unsupported by the sprite font
1086 auto forceSpriteFont = false;
1087 const auto& currencyDesc = CurrencyDescriptors[EnumValue(Config::Get().general.currencyFormat)];
1088 if (LocalisationService_UseTrueTypeFont() && FontSupportsStringSprite(currencyDesc.symbol_unicode))
1089 {
1090 forceSpriteFont = true;
1091 }
1092
1093 drawStringWithYOffsets(
1094 rt, buffer, { Drawing::Colour::black }, ps->ScreenPos, reinterpret_cast<int8_t*>(ps->y_offsets), forceSpriteFont,
1095 FontStyle::medium);
1096 } while ((ps = ps->NextEntry) != nullptr);
1097}

Callers 1

ViewportPaintColumnFunction · 0.85

Calls 5

FormatStringLegacyFunction · 0.85
EnumValueFunction · 0.85
FontSupportsStringSpriteFunction · 0.85
drawStringWithYOffsetsFunction · 0.85

Tested by

no test coverage detected