src/field/field_engine_ground_mask.c
The ground mask: raised ground in front of an actor hides the part of it behind, as a ledge in the Kalay Tunnel's treasure room hides Isaac's legs. More…
Included by field_engine.c.
Macros
| Name | Description | |
|---|---|---|
#define | METATILE_GRID_ROW_MASK 0xf0 | A screen row's map metatile, in pixels, in an OAM entry's 8-bit y, as MAPGRID_METATILE_PIXEL_MASK takes a whole pixel coordinate's. |
Functions
| Name | Description | |
|---|---|---|
void | fdGroundMaskDrawMarks (void) | Each tick of the ground mask: on each of the two metatiles beside the actor (left and right of it), where the ground one or two metatiles south rises above the actor's floor, draws a semi-transparent 16-pixel-wide sprite of colour 1 at the height of that ground, which hides what of the actor is below that ground's edge. |
void | fdEffectStartGroundMask (void *object) | Starts the ground mask on object (the party leader when NULL): loads its solid tiles, sets the blending and draws it each tick. |
void | fdGroundMaskSuspend (void) | Stops drawing the ground mask, keeping its state. |
void | fdGroundMaskResume (void) | Draws the ground mask again after fdGroundMaskSuspend. |
Description
The ground mask: raised ground in front of an actor hides the part of it
behind, as a ledge in the Kalay Tunnel's treasure room hides Isaac's legs.
Part of field_engine.c.
Macros in detail
METATILE_GRID_ROW_MASK
#define METATILE_GRID_ROW_MASK 0xf0
A screen row's map metatile, in pixels, in an OAM entry's 8-bit y, as
MAPGRID_METATILE_PIXEL_MASK takes a whole pixel coordinate's.
Referenced by fdGroundMaskDrawMarks().
Definition at line 9 of file field_engine_ground_mask.c.
Functions in detail
fdGroundMaskDrawMarks
void fdGroundMaskDrawMarks(void)
Each tick of the ground mask: on each of the two metatiles beside the actor (left and right of it), where the ground one or two metatiles south rises above the actor's floor, draws a semi-transparent 16-pixel-wide sprite of colour 1 at the height of that ground, which hides what of the actor is below that ground's edge.
References fdMapGridGetTerrainHeightStub(), fdMapGridScrollStateView(), Sint32, state, syOAMAddSpriteAtDepth() and VramCacheEntries.
Referenced by fdEffectStartGroundMask(), fdGroundMaskResume() and fdGroundMaskSuspend().
Definition at line 16 of file field_engine_ground_mask.c.
fdEffectStartGroundMask
void fdEffectStartGroundMask(void *object)
Starts the ground mask on object (the party leader when NULL): loads its
solid tiles, sets the blending and draws it each tick. Kalay's tunnel,
Mercury and Venus Lighthouse, the Fuchin Falls cave, the Tunnel Ruins and
Crossbone Isle start it.
References fdActorLookup(), fdGroundMaskDrawMarks(), MainRoutineStateWork, state, syHeapSlotAllocate(), syHeapSlotAllocateEWRAM(), syHeapSlotRelease(), sySetEvent() and syVRAMCacheLoad().
Referenced by scImilFuchinFallsPrepareRoom(), scInit() and scKalayPrepareTunnelTreasureRoom().
Definition at line 100 of file field_engine_ground_mask.c.
fdGroundMaskSuspend
void fdGroundMaskSuspend(void)
Stops drawing the ground mask, keeping its state.
References fdGroundMaskDrawMarks() and sySuspendEvent().
Definition at line 126 of file field_engine_ground_mask.c.
fdGroundMaskResume
void fdGroundMaskResume(void)
Draws the ground mask again after fdGroundMaskSuspend.
References fdGroundMaskDrawMarks() and syResumeEvent().
Definition at line 132 of file field_engine_ground_mask.c.