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

@ -36,7 +36,6 @@ struct RenderSortItem {
bool translucent = false;
bool animated = false;
bool land = false;
bool sprite = false;
bool inventoryItem = false;
};

View file

@ -224,6 +224,10 @@ private:
bool markNewProcesses_ = false;
};
bool runFreshGameTeleporterStartup(ProcessKernel& kernel, LiveFixedMapItems& items,
u16 mapNumber, u16 teleportId, const std::vector<ShapeTypeInfo>& shapes,
u16 (&groupCounts)[32]);
class EntityDispatchEntry {
public:
static constexpr u16 initBaseSegment = 0x11e0;

View file

@ -81,6 +81,9 @@ std::optional<FixedMap> loadFixedMap(const FixedMapArchive& archive, u32 mapInde
std::optional<std::vector<StagedFixedMapItem>> stageFixedMapItems(const FixedMap& map);
std::optional<StagedFixedMapItem> findTeleportEgg(
const std::vector<StagedFixedMapItem>& items, const std::vector<ShapeTypeInfo>& shapes, u8 eggId);
std::optional<StagedFixedMapItem> findNearbyActiveTeleportEgg(const StagedFixedMapItem& origin,
const std::vector<StagedFixedMapItem>& items, const std::vector<ShapeTypeInfo>& shapes,
u8 currentMapNumber);
std::optional<std::vector<StagedContainedFixedMapItem>> stageContainedFixedMapItems(
const FixedMap& map, const std::vector<ShapeTypeInfo>& shapes);
std::optional<StagedFixedMapItem> nearestStagedFixedMapItem(

View file

@ -31,6 +31,15 @@ struct WorldPoint {
s32 z = 0;
};
struct MapRenderSprite {
WorldPoint position;
u16 shape = 0;
u8 frame = 0;
bool flipped = false;
const DecodedShapeFrame* decoded = nullptr;
const Palette256* palette = nullptr;
};
struct ScreenPoint {
s32 x = 0;
s32 y = 0;
@ -59,6 +68,7 @@ struct RenderedMapImage {
s32 fullWidth = 0;
s32 fullHeight = 0;
std::vector<RgbColor> pixels;
std::vector<u8> coverage;
};
struct MapSceneRenderer {
@ -70,7 +80,7 @@ struct MapSceneRenderer {
std::map<std::pair<u32, u32>, DecodedShapeFrame> decodedFrames;
std::optional<RenderedMapImage> render(const MapRenderOptions& options,
const LiveFixedMapItems* liveItems = nullptr);
const LiveFixedMapItems* liveItems = nullptr, const MapRenderSprite* sprite = nullptr);
};
std::optional<MapSceneRenderer> loadMapSceneRenderer(const GameDataRoot& root, u32 mapIndex);