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

Method getNormalInteractionInfo

src/OpenLoco/src/Paint/Paint.cpp:1290–1331  ·  view source on GitHub ↗

0x0045ED91

Source from the content-addressed store, hash-verified

1288
1289 // 0x0045ED91
1290 [[nodiscard]] InteractionArg PaintSession::getNormalInteractionInfo(const InteractionItemFlags flags) const
1291 {
1292 InteractionArg info{};
1293
1294 for (auto* ps = _paintHead; ps != nullptr; ps = ps->nextQuadrantPS)
1295 {
1296 // Check main paint struct
1297 if (isSpriteInteractedWith(getRenderTarget(), ps->imageId, ps->vpPos))
1298 {
1299 if (isPSSpriteTypeInFilter(ps->type, flags))
1300 {
1301 info = { *ps };
1302 }
1303 }
1304
1305 // Check children paint structs
1306 for (const auto* childPs = ps->children; childPs != nullptr; childPs = childPs->children)
1307 {
1308 if (isSpriteInteractedWith(getRenderTarget(), childPs->imageId, childPs->vpPos))
1309 {
1310 if (isPSSpriteTypeInFilter(childPs->type, flags))
1311 {
1312 info = { *childPs };
1313 }
1314 }
1315
1316 auto attachedInfo = getAttachedInteractionInfo(*getRenderTarget(), flags, *childPs);
1317 if (attachedInfo.has_value())
1318 {
1319 info = attachedInfo.value();
1320 }
1321 }
1322
1323 // Check attached to main paint struct
1324 auto attachedInfo = getAttachedInteractionInfo(*getRenderTarget(), flags, *ps);
1325 if (attachedInfo.has_value())
1326 {
1327 info = attachedInfo.value();
1328 }
1329 }
1330 return info;
1331 }
1332
1333 // 0x0048DDE4
1334 [[nodiscard]] InteractionArg PaintSession::getStationNameInteractionInfo(const InteractionItemFlags flags) const

Callers 1

getMapCoordinatesFromPosFunction · 0.80

Calls 4

isSpriteInteractedWithFunction · 0.85
isPSSpriteTypeInFilterFunction · 0.85
valueMethod · 0.80

Tested by

no test coverage detected