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

Method drawStructs

src/OpenLoco/src/Paint/Paint.cpp:1032–1071  ·  view source on GitHub ↗

0x0045EA23

Source from the content-addressed store, hash-verified

1030
1031 // 0x0045EA23
1032 void PaintSession::drawStructs(Gfx::DrawingContext& drawingCtx)
1033 {
1034 const Gfx::RenderTarget& rt = drawingCtx.currentRenderTarget();
1035
1036 for (const auto* ps = _paintHead; ps != nullptr; ps = ps->nextQuadrantPS)
1037 {
1038 const bool shouldCull = shouldTryCullPaintStruct(*ps, _viewFlags);
1039
1040 if (shouldCull)
1041 {
1042 if (cullPaintStructImage(ps->imageId, _viewFlags))
1043 {
1044 continue;
1045 }
1046 }
1047
1048 drawStruct(rt, drawingCtx, *ps, shouldCull);
1049
1050 // Draw any children this might have
1051 for (const auto* childPs = ps->children; childPs != nullptr; childPs = childPs->children)
1052 {
1053 const bool shouldCullChild = shouldTryCullPaintStruct(*childPs, _viewFlags);
1054
1055 if (shouldCullChild)
1056 {
1057 if (cullPaintStructImage(childPs->imageId, _viewFlags))
1058 {
1059 continue;
1060 }
1061 }
1062
1063 drawStruct(rt, drawingCtx, *childPs, shouldCullChild);
1064
1065 drawAllAttachedStructs(rt, drawingCtx, *childPs, _viewFlags);
1066 }
1067
1068 // Draw any attachments to the struct
1069 drawAllAttachedStructs(rt, drawingCtx, *ps, _viewFlags);
1070 }
1071 }
1072
1073 // 0x0045A60E
1074 void PaintSession::drawStringStructs(Gfx::DrawingContext& drawingCtx)

Callers 3

paintMethod · 0.80
drawTrackFunction · 0.80
drawRoadFunction · 0.80

Calls 4

shouldTryCullPaintStructFunction · 0.85
cullPaintStructImageFunction · 0.85
drawStructFunction · 0.85
drawAllAttachedStructsFunction · 0.85

Tested by

no test coverage detected