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

Function paintWindowCurrencyEntity

src/OpenLoco/src/Paint/PaintEffectEntity.cpp:91–109  ·  view source on GitHub ↗

0x00440400

Source from the content-addressed store, hash-verified

89
90 // 0x00440400
91 static void paintWindowCurrencyEntity(PaintSession& session, MoneyEffect* moneyEffect)
92 {
93 if (!Config::get().cashPopupRendering)
94 {
95 return;
96 }
97
98 const Gfx::RenderTarget* rt = session.getRenderTarget();
99 if (rt->zoomLevel > 1)
100 {
101 return;
102 }
103 const StringId stringId = moneyEffect->amount >= 0 ? StringIds::format_currency_income_in_company_colour : StringIds::format_currency_expense_in_company_colour_negative;
104 uint32_t currencyAmount = abs(moneyEffect->amount);
105 const int8_t* yOffsets = &kWiggleYOffsets[moneyEffect->wiggle];
106 auto companyColour = CompanyManager::getCompanyColour(moneyEffect->var_2E);
107
108 session.addToStringPlotList(currencyAmount, stringId, moneyEffect->position.z, moneyEffect->offsetX, yOffsets, enumValue(companyColour));
109 }
110
111 // 0x0044044E
112 static void paintVehicleCrashParticleEntity(PaintSession& session, VehicleCrashParticle* particle)

Callers 1

paintEffectEntityFunction · 0.85

Calls 5

getCompanyColourFunction · 0.85
enumValueFunction · 0.85
getRenderTargetMethod · 0.80
addToStringPlotListMethod · 0.80
getFunction · 0.50

Tested by

no test coverage detected