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

Function drawItem

src/OpenLoco/src/Vehicles/VehicleDraw.cpp:240–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238 };
239
240 static void drawItem(Gfx::DrawingContext& drawingCtx, Ui::Point offset, const DrawItem& item, int32_t midDist, uint8_t yaw)
241 {
242 const auto factor = midDist - item.dist;
243 const auto unk1 = Math::Trigonometry::computeXYVector(factor, yaw) / 4;
244
245 const auto p1 = World::gameToScreen(World::Pos3(unk1.x, unk1.y, 0), 0);
246
247 drawingCtx.drawImage(offset + Ui::Point(p1.x, p1.y), item.image);
248 }
249
250 struct DrawItems
251 {

Callers 1

drawVehicleOverviewFunction · 0.85

Calls 3

computeXYVectorFunction · 0.85
gameToScreenFunction · 0.85
drawImageMethod · 0.45

Tested by

no test coverage detected