MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / IsSpriteInteractedWith

Function IsSpriteInteractedWith

src/openrct2/interface/Viewport.cpp:1611–1639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1609 */
1610
1611 static bool IsSpriteInteractedWith(RenderTarget& rt, ImageId imageId, const ScreenCoordsXY& coords)
1612 {
1613 PROFILED_FUNCTION();
1614
1615 auto paletteMap = PaletteMap::GetDefault();
1616 uint8_t imageType;
1617 if (imageId.HasPrimary() || imageId.IsRemap())
1618 {
1619 imageType = IMAGE_TYPE_REMAP;
1620 FilterPaletteID filterPaletteId;
1621 if (imageId.HasSecondary())
1622 {
1623 filterPaletteId = static_cast<FilterPaletteID>(imageId.GetPrimary());
1624 }
1625 else
1626 {
1627 filterPaletteId = static_cast<FilterPaletteID>(imageId.GetRemap());
1628 }
1629 if (auto pm = GetPaletteMapForColour(filterPaletteId); pm.has_value())
1630 {
1631 paletteMap = pm.value();
1632 }
1633 }
1634 else
1635 {
1636 imageType = IMAGE_TYPE_DEFAULT;
1637 }
1638 return IsSpriteInteractedWithPaletteSet(rt, imageId, coords, paletteMap, imageType);
1639 }
1640
1641 const std::list<Viewport>& GetAllViewports()
1642 {

Callers 1

Calls 8

GetPaletteMapForColourFunction · 0.85
HasPrimaryMethod · 0.80
IsRemapMethod · 0.80
HasSecondaryMethod · 0.80
GetPrimaryMethod · 0.80
GetRemapMethod · 0.80
valueMethod · 0.80

Tested by

no test coverage detected