Enhance teleporter and map rendering tests

- Added initialization of startup processes in flex_archive_tests to ensure proper setup before teleporter operations.
- Updated assertions to verify the correct allocation and state of processes during teleporter execution.
- Introduced new tests in map_renderer_tests to validate shape rendering, including isolated shape rendering and player sprite integration.
- Enhanced map_sorter_tests with additional checks for occlusion handling and boundary conditions in render order resolution.
This commit is contained in:
Maddo 2026-10-06 21:07:35 +02:00
commit e00f9f3186
16 changed files with 954 additions and 398 deletions

View file

@ -171,6 +171,28 @@ std::optional<StagedFixedMapItem> findTeleportEgg(
return match;
}
std::optional<StagedFixedMapItem> findNearbyActiveTeleportEgg(const StagedFixedMapItem& origin,
const std::vector<StagedFixedMapItem>& items, const std::vector<ShapeTypeInfo>& shapes,
u8 currentMapNumber)
{
for (const auto& item : items) {
if (item.data.shape >= shapes.size() || shapes[item.data.shape].family != 8 ||
item.data.frame == 1 || item.data.mapNumber != currentMapNumber) {
continue;
}
const s32 xRange = static_cast<s32>((item.data.npcNumber >> 4) & 0x0f) * 64;
const s32 yRange = static_cast<s32>(item.data.npcNumber & 0x0f) * 64;
const s32 deltaX = static_cast<s32>(origin.data.x) - item.data.x;
const s32 deltaY = static_cast<s32>(origin.data.y) - item.data.y;
const s32 deltaZ = static_cast<s32>(origin.data.z) - item.data.z;
if (deltaX >= -xRange && deltaX <= xRange && deltaY >= -yRange && deltaY <= yRange &&
deltaZ >= -48 && deltaZ <= 48) {
return item;
}
}
return std::nullopt;
}
std::optional<std::vector<StagedContainedFixedMapItem>> stageContainedFixedMapItems(
const FixedMap& map, const std::vector<ShapeTypeInfo>& shapes)
{