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

Function paintVoid

src/OpenLoco/src/Paint/PaintTile.cpp:40–63  ·  view source on GitHub ↗

0x004621FF

Source from the content-addressed store, hash-verified

38{
39 // 0x004621FF
40 static void paintVoid(PaintSession& session, const World::Pos2& loc)
41 {
42 constexpr World::Pos2 kUnkOffsets[4] = {
43 { 0, 0 },
44 { 32, 0 },
45 { 32, 32 },
46 { 0, 32 },
47 };
48
49 const auto loc2 = loc + kUnkOffsets[session.getRotation()];
50 const auto vpPos = World::gameToScreen(World::Pos3(loc2.x, loc2.y, 16), session.getRotation());
51 if (vpPos.y + 32 <= session.getRenderTarget()->y)
52 {
53 return;
54 }
55 if (vpPos.y - 20 >= session.getRenderTarget()->height + session.getRenderTarget()->y)
56 {
57 return;
58 }
59
60 session.setEntityPosition(loc2);
61 session.setItemType(InteractionItem::noInteraction);
62 session.addToPlotListAsParent(ImageId{ ImageIds::blank_tile }, { 0, 0, 16 }, { 32, 32, -1 });
63 }
64
65 // 0x00461EA7
66 static void paintConstructionArrow(PaintSession& session, const World::Pos2& loc)

Callers 1

paintTileElementsFunction · 0.85

Calls 6

gameToScreenFunction · 0.85
getRenderTargetMethod · 0.80
setEntityPositionMethod · 0.80
setItemTypeMethod · 0.80
addToPlotListAsParentMethod · 0.80
getRotationMethod · 0.45

Tested by

no test coverage detected