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

Function paintFlatSingleQuarterNoSupport

src/OpenLoco/src/Paint/PaintBridge.cpp:705–728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703 };
704
705 static void paintFlatSingleQuarterNoSupport(PaintSession& session, const BridgeObject& bridgeObj, const BridgeEntry& bridgeEntry, const std::array<uint32_t, 3>& imageIndexs, const World::Pos3& wallBoundingBoxOffset)
706 {
707 const auto baseHeightOffset = World::Pos3{ 0, 0, bridgeEntry.height };
708
709 if ((bridgeObj.flags & BridgeObjectFlags::hasRoof) != BridgeObjectFlags::none)
710 {
711 const auto roofImage = bridgeEntry.imageBase.withIndex(bridgeObj.image).withIndexOffset(imageIndexs[0]);
712 constexpr World::Pos3 bbOffset = { 0, 0, 30 };
713 constexpr World::Pos3 bbLength = { 32, 32, 0 };
714 session.addToPlotList4FD150(roofImage, baseHeightOffset, bbOffset + baseHeightOffset, bbLength);
715 }
716 const auto offset = baseHeightOffset - World::Pos3{ 0, 0, 16 };
717 const auto image = bridgeEntry.imageBase.withIndex(bridgeObj.image).withIndexOffset(imageIndexs[1]);
718 constexpr World::Pos3 bbOffset2 = { 0, 0, 14 };
719 constexpr World::Pos3 bbLength2 = { 32, 32, 1 };
720 session.addToPlotList4FD150(image, offset, bbOffset2 + offset, bbLength2);
721
722 if (bridgeEntry.subType == 0)
723 {
724 const auto wallImage = bridgeEntry.imageBase.withIndex(bridgeObj.image).withIndexOffset(imageIndexs[2]);
725 constexpr World::Pos3 bbLength3 = { 2, 2, 26 };
726 session.addToPlotList4FD150(wallImage, baseHeightOffset, wallBoundingBoxOffset + baseHeightOffset, bbLength3);
727 }
728 }
729
730 // 0x0042C36D
731 static void paintSupportDiagonal(PaintSession& session, const BridgeObject& bridgeObj, const BridgeEntry& bridgeEntry, int16_t lhsSupportLength, int16_t rhsSupportLength, const int16_t supportHeight)

Callers 1

paintBridgeFunction · 0.85

Calls 3

withIndexOffsetMethod · 0.80
withIndexMethod · 0.80
addToPlotList4FD150Method · 0.80

Tested by

no test coverage detected