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

Function drawAttachStruct

src/OpenLoco/src/Paint/Paint.cpp:990–1013  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

988 }
989
990 static void drawAttachStruct(const Gfx::RenderTarget& rt, Gfx::DrawingContext& drawingCtx, const PaintStruct& ps, const AttachedPaintStruct& attachPs, const bool shouldCull)
991 {
992 auto imageId = attachPs.imageId;
993
994 if (shouldCull)
995 {
996 imageId = ImageId(imageId.getIndex()).withTranslucency(ExtColour::unk30);
997 }
998 Ui::Point imagePos = ps.vpPos + attachPs.vpPos;
999 if (rt.zoomLevel != 0)
1000 {
1001 imagePos.x = Numerics::floor2(imagePos.x, 2);
1002 imagePos.y = Numerics::floor2(imagePos.y, 2);
1003 }
1004
1005 if ((attachPs.flags & PaintStructFlags::hasMaskedImage) != PaintStructFlags::none)
1006 {
1007 drawingCtx.drawImageMasked(imagePos, imageId, attachPs.maskedImageId);
1008 }
1009 else
1010 {
1011 drawingCtx.drawImage(imagePos, imageId);
1012 }
1013 }
1014
1015 static void drawAllAttachedStructs(const Gfx::RenderTarget& rt, Gfx::DrawingContext& drawingCtx, const PaintStruct& ps, const Ui::ViewportFlags viewFlags)
1016 {

Callers 1

drawAllAttachedStructsFunction · 0.85

Calls 6

ImageIdClass · 0.85
floor2Function · 0.85
withTranslucencyMethod · 0.80
drawImageMaskedMethod · 0.80
getIndexMethod · 0.45
drawImageMethod · 0.45

Tested by

no test coverage detected