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

Method drawIndustry

src/OpenLoco/src/Objects/IndustryObject.cpp:104–118  ·  view source on GitHub ↗

0x00458C7F

Source from the content-addressed store, hash-verified

102
103 // 0x00458C7F
104 void IndustryObject::drawIndustry(Gfx::DrawingContext& drawingCtx, int16_t x, int16_t y) const
105 {
106 auto firstColour = Numerics::bitScanReverse(availableColours);
107 Colour c = firstColour != -1 ? static_cast<Colour>(firstColour)
108 : Colour::black;
109 ImageId baseImage(buildingImageIds, c);
110 Ui::Point pos{ x, y };
111 const auto partHeights = getBuildingPartHeights();
112 for (const auto part : getBuildingParts(0))
113 {
114 auto image = baseImage.withIndexOffset(part * 4 + 1);
115 drawingCtx.drawImage(pos, image);
116 pos.y -= partHeights[part];
117 }
118 }
119
120 // 0x0045926F
121 bool IndustryObject::validate() const

Callers 1

drawScrollFunction · 0.80

Calls 3

bitScanReverseFunction · 0.85
withIndexOffsetMethod · 0.80
drawImageMethod · 0.45

Tested by

no test coverage detected