Skip to Content
The Alchemy Project

src/field/field_terrain.c

The ground heights and the collision of metatiles and the World Map. More…

Included by field.c.

Macros

NameDescription
#defineGROUND_LEVEL 0How the ground at a point stands to a height (fdMapGridCheckCollisionAt): level enough to walk on, rising more than 8 pixels above it, falling more than 12 below it, or a wall.
#defineGROUND_RISES 1
#defineGROUND_DROPS -1
#defineGROUND_WALL 2
#definefdMapGridGetShapeHeight (code, x, z)

Typedefs

NameDescription
typedef Sint32 (*TERRAIN_HEIGHT_FN )(Uint8 *heights, Sint32 x, Sint32 z);Each height function reads only the arguments it needs, so the type leaves them unspecified.

Functions

NameDescription
FIXEDfdTerrainGetFlatHeight (const Sint8 *samples)The ground height functions (MapGridTerrainHeightFunctions): each takes a metatile's height samples after its kind byte and a pixel (x, y) within the 16x16 metatile, and returns the ground height there in 16.16 pixels.
FIXEDfdTerrainGetSlopeXHeight (const Sint8 *samples, Sint32 pos)The height of a slope across x at position (0 to 15 of the metatile): a straight line from samples[0] to samples[1].
FIXEDfdTerrainGetSlopeYHeight (const Sint8 *samples, Sint32 unused, Sint32 pos)A slope along y: from sample 0 at the top to sample 1 at the bottom.
FIXEDfdTerrainGetStepSumDiagonalHeight (const Sint8 *samples, Sint32 x, Sint32 y)A step across the diagonal x + y = 15: sample 0 before it, sample 1 after it and the higher of the two on it.
FIXEDfdTerrainGetStepDifferenceDiagonalHeight (const Sint8 *samples, Sint32 x, Sint32 y)A step across the diagonal x = y: sample 0 where y < x, sample 1 where y > x and the higher of the two on it.
FIXEDfdTerrainGetBendSumDiagonalHeight (const Sint8 *samples, Sint32 x, Sint32 y)A slope that bends on the diagonal x + y = 15: from sample 0 at the top left corner to sample 1 on the diagonal to sample 2 at the bottom right.
FIXEDfdTerrainGetBendDifferenceDiagonalHeight (const Sint8 *samples, Sint32 x, Sint32 y)A slope that bends on the diagonal x = y: from sample 0 at the top right corner to sample 1 on the diagonal to sample 2 at the bottom left.
FIXEDfdTerrainGetRoundedSquareHeight (const Sint8 *samples, Sint32 pos, Sint32 row)A raised or sunken rounded square: sample 1 where TerrainRoundedSquareMask is 1, sample 0 in the corners.
FIXEDfdTerrainGetStepXHeight (const Sint8 *samples, Uint32 pos)The height of a step across x at position (0 to 15 of the metatile): samples[0] on the metatile's first half, samples[1] on its second.
FIXEDfdTerrainGetStepYHeight (const Sint8 *samples, Uint32 unused, Uint32 pos)A step along y: sample 0 above the middle, sample 1 below it.
FIXEDfdTerrainGetSampleTableTransposedHeight (const Sint8 *samples, Uint32 pixelX, Uint32 pixelY)As fdTerrainGetSampleTableHeight with x and y swapped.
FIXEDfdTerrainGetSampleTableTransposedMirroredHeight (const Sint8 *samples, Uint32 row, Uint32 pos)As fdTerrainGetSampleTableMirroredHeight with x and y swapped.
FIXEDfdTerrainGetSampleTableHeight (const Sint8 *samples, Uint32 pos, Uint32 row)The sample TerrainSampleIndexTable picks for (x, y): a byte per pixel of the metatile, row by row.
FIXEDfdTerrainGetSampleTableMirroredHeight (const Sint8 *samples, Uint32 pos, Uint32 row)The same, with the table mirrored left to right.
FIXEDfdTerrainGetSplitTopStepHeight (const Sint8 *samples, Uint32 column, Uint32 row)Above y 8 a step along x from the first sample to the second; below, the third.
FIXEDfdTerrainGetSplitBottomStepHeight (const Sint8 *samples, Uint32 column, Uint32 row)Above y 8 the first sample; below, a step along x from the second to the third.
FIXEDfdMapGridGetTerrainHeight (Sint32 layer, FIXED x, FIXED z)Returns the ground height of a layer at (x, z) in 16.16 pixels, as The Broken Seal's: the height function of the metatile's terrain kind applied to its samples.
Sint32fdMapGridGetTerrainKindAt (Sint32 layer, FIXED x, FIXED z)Returns the terrain kind of a layer's metatile at (x, z) in 16.16 pixels, as The Broken Seal's.
Sint32fdMapGridGetTerrainKindOrBumpAt (Sint32 layer, Sint32 x, Sint32 z)As fdMapGridGetTerrainKindAt, but a rounded square whose two samples differ reads as TERRAIN_BUMP.
FIXEDfdMapGridGetHighestTerrainHeightAround (Sint32 layer, FIXED x, FIXED z, FIXED reach)The highest ground at (x, z) and at the four points reach away from it along x and z, all in 16.16 pixels.
voidfdMapGridSetMetatileHeight (Sint32 x, Sint32 z, Sint32 layer, Sint32 height)Gives the metatile at (x, z) of layer the ground height height, in 8-pixel steps, by tagging its shape with terrain kind 0 at that height.
Sint32fdMapGridGetMetatileHeight (FIXED x, FIXED z, Sint32 layer)The ground height at (x, z) of layer, in 8-pixel steps.
Sint32fdMapGridGetTerrainKind (Sint32 layer, Sint32 x, Sint32 z)As fdMapGridGetTerrainKindAt, under the name the scenes' overlays import.
Uint8fdMapGridGetMetatileBehaviorAt (Sint32 layer, FIXED x, FIXED y)Returns the metatile behavior of a layer's metatile at (x, y) in 16.16 pixels.
voidfdMapGridSetMetatileBehaviorAt (Uint32 layer, FIXED x, FIXED y, Uint32 collisionCode)Sets the metatile behavior of a layer's metatile at (x, y) in 16.16 pixels.
FIXEDfdMapGridGetTerrainHeightAbove (FIXED px, FIXED pz, Sint32 layer, FIXED base)The height of the ground at (px, pz) (16.16 pixels) on the given layer, less base; a layer past 2 reads the shape grid.
Sint32fdMapGridCheckCollisionAt (FIXED px, FIXED pz, Sint32 layer, Sint32 height)How the ground at (px, pz) (16.16 pixels) on the given layer stands to height: GROUND_WALL, GROUND_RISES, GROUND_DROPS or GROUND_LEVEL.
Sint32fdMapGridCheckCollision (ACTOR *actor, POS *pos)As fdMapGridCheckCollisionAt for the point position (16.16 pixels, read as its whole-pixel halves) on the actor's layer, against its ground height.
Sint32fdMapGridCheckCollisionAbove (ACTOR *actor, POS *pos)As fdMapGridCheckCollision, against the actor's height and never GROUND_DROPS: the ground the hovering leader (SC_HOVER) cannot float over.
Sint32fdMapGridIsWallAt (Sint32 *pos)Returns -1 when the metatile under position (its x, and z less its height) in the overhead layer is a wall, else 0; also 0 before the map state exists.
Sint32fdWorldMapGetBlockMetatileBehavior (WORLD_POS *pos)The metatile behavior of the world map block under position (blocks 32 pixels square on a 32 by 32 grid), which the World Map's step cues answer (world_map.c: STEP_CUE_AREA(AREA_DAILA) enters Daila, METATILE_BEHAVIOR_WORLD_MAP_IRON meets Iron), or METATILE_BEHAVIOR_WALL where the map has no block.
Sint32fdWorldMapGetCollision (WORLD_POS *pos)Returns the world map's collision value (1-15) at position: from the upper collision layer where it has one, else the lower, else WORLD_MAP_COLLISION_DEFAULT.
Sint32fdWorldMapIsWalkable (void *mover, WORLD_POS *pos)Returns 0 when the world map at position can be walked on (a place there, and collision WORLD_MAP_COLLISION_WALKABLE_FIRST to WORLD_MAP_COLLISION_WALKABLE_LAST), else -1.
Sint32fdWorldMapIsSailable (void *mover, WORLD_POS *pos)Returns 0 where the ship can sail (the sea or shallow water), else -1.
Sint32fdWorldMapIsFlyable (ACTOR *mover, WORLD_POS *pos)Returns 0 where the flying ship can go, else -1: low down, where it can sail; higher, more of the ground by the kind it last flew over.

Variables

NameDescription
extern TERRAIN_HEIGHT_FNMapGridTerrainHeightFunctions [16]Ground height functions, by TERRAIN_KIND, called with (the remaining samples, x within the metatile, y within the metatile).

Description

The ground heights and the collision of metatiles and the World Map. Part of field.c.

Macros in detail

GROUND_LEVEL

#define GROUND_LEVEL 0

How the ground at a point stands to a height (fdMapGridCheckCollisionAt): level enough to walk on, rising more than 8 pixels above it, falling more than 12 below it, or a wall.

Referenced by fdMapGridCheckCollision(), fdMapGridCheckCollisionAbove() and fdMapGridCheckCollisionAt().

Definition at line 9 of file field_terrain.c.

GROUND_RISES

#define GROUND_RISES 1

Referenced by fdMapGridCheckCollision(), fdMapGridCheckCollisionAbove() and fdMapGridCheckCollisionAt().

Definition at line 10 of file field_terrain.c.

GROUND_DROPS

#define GROUND_DROPS -1

Referenced by fdMapGridCheckCollision() and fdMapGridCheckCollisionAt().

Definition at line 11 of file field_terrain.c.

GROUND_WALL

#define GROUND_WALL 2

Referenced by fdMapGridCheckCollision(), fdMapGridCheckCollisionAbove() and fdMapGridCheckCollisionAt().

Definition at line 12 of file field_terrain.c.

fdMapGridGetShapeHeight

#define fdMapGridGetShapeHeight(code, x, z)

Referenced by fdMapGridCheckCollision(), fdMapGridCheckCollisionAbove(), fdMapGridCheckCollisionAt(), fdMapGridGetTerrainHeight() and fdMapGridGetTerrainHeightAbove().

Definition at lines 306 and 312 of file field_terrain.c.

Typedefs in detail

TERRAIN_HEIGHT_FN

typedef Sint32 (*TERRAIN_HEIGHT_FN)(Uint8 *heights, Sint32 x, Sint32 z);

Referenced by MapGridTerrainHeightFunctions.

Definition at line 298 of file field_terrain.c.

Functions in detail

fdTerrainGetFlatHeight

FIXED fdTerrainGetFlatHeight(const Sint8 *samples)

The ground height functions (MapGridTerrainHeightFunctions): each takes a metatile's height samples after its kind byte and a pixel (x, y) within the 16x16 metatile, and returns the ground height there in 16.16 pixels.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 17 of file field_terrain.c.

fdTerrainGetSlopeXHeight

FIXED fdTerrainGetSlopeXHeight(const Sint8 *samples, Sint32 pos)

The height of a slope across x at position (0 to 15 of the metatile): a straight line from samples[0] to samples[1].

References Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 24 of file field_terrain.c.

fdTerrainGetSlopeYHeight

FIXED fdTerrainGetSlopeYHeight(const Sint8 *samples, Sint32 unused, Sint32 pos)

A slope along y: from sample 0 at the top to sample 1 at the bottom.

References Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 35 of file field_terrain.c.

fdTerrainGetStepSumDiagonalHeight

FIXED fdTerrainGetStepSumDiagonalHeight(const Sint8 *samples, Sint32 x, Sint32 y)

A step across the diagonal x + y = 15: sample 0 before it, sample 1 after it and the higher of the two on it.

References Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 47 of file field_terrain.c.

fdTerrainGetStepDifferenceDiagonalHeight

FIXED fdTerrainGetStepDifferenceDiagonalHeight(const Sint8 *samples, Sint32 x, Sint32 y)

A step across the diagonal x = y: sample 0 where y < x, sample 1 where y > x and the higher of the two on it.

References Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 77 of file field_terrain.c.

fdTerrainGetBendSumDiagonalHeight

FIXED fdTerrainGetBendSumDiagonalHeight(const Sint8 *samples, Sint32 x, Sint32 y)

A slope that bends on the diagonal x + y = 15: from sample 0 at the top left corner to sample 1 on the diagonal to sample 2 at the bottom right.

References result and Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 109 of file field_terrain.c.

fdTerrainGetBendDifferenceDiagonalHeight

FIXED fdTerrainGetBendDifferenceDiagonalHeight(const Sint8 *samples, Sint32 x, Sint32 y)

A slope that bends on the diagonal x = y: from sample 0 at the top right corner to sample 1 on the diagonal to sample 2 at the bottom left.

References Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 141 of file field_terrain.c.

fdTerrainGetRoundedSquareHeight

FIXED fdTerrainGetRoundedSquareHeight(const Sint8 *samples, Sint32 pos, Sint32 row)

A raised or sunken rounded square: sample 1 where TerrainRoundedSquareMask is 1, sample 0 in the corners.

References Sint32 and TerrainRoundedSquareMask.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 177 of file field_terrain.c.

fdTerrainGetStepXHeight

FIXED fdTerrainGetStepXHeight(const Sint8 *samples, Uint32 pos)

The height of a step across x at position (0 to 15 of the metatile): samples[0] on the metatile's first half, samples[1] on its second.

References Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 193 of file field_terrain.c.

fdTerrainGetStepYHeight

FIXED fdTerrainGetStepYHeight(const Sint8 *samples, Uint32 unused, Uint32 pos)

A step along y: sample 0 above the middle, sample 1 below it.

References Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 204 of file field_terrain.c.

fdTerrainGetSampleTableTransposedHeight

FIXED fdTerrainGetSampleTableTransposedHeight(const Sint8 *samples, Uint32 pixelX, Uint32 pixelY)

As fdTerrainGetSampleTableHeight with x and y swapped.

References TerrainSampleIndexTable.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 215 of file field_terrain.c.

fdTerrainGetSampleTableTransposedMirroredHeight

FIXED fdTerrainGetSampleTableTransposedMirroredHeight(const Sint8 *samples, Uint32 row, Uint32 pos)

As fdTerrainGetSampleTableMirroredHeight with x and y swapped.

References TerrainSampleIndexTable.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 224 of file field_terrain.c.

fdTerrainGetSampleTableHeight

FIXED fdTerrainGetSampleTableHeight(const Sint8 *samples, Uint32 pos, Uint32 row)

The sample TerrainSampleIndexTable picks for (x, y): a byte per pixel of the metatile, row by row.

References TerrainSampleIndexTable.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 238 of file field_terrain.c.

fdTerrainGetSampleTableMirroredHeight

FIXED fdTerrainGetSampleTableMirroredHeight(const Sint8 *samples, Uint32 pos, Uint32 row)

The same, with the table mirrored left to right.

References TerrainSampleIndexTable.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 247 of file field_terrain.c.

fdTerrainGetSplitTopStepHeight

FIXED fdTerrainGetSplitTopStepHeight(const Sint8 *samples, Uint32 column, Uint32 row)

Above y 8 a step along x from the first sample to the second; below, the third.

References Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 261 of file field_terrain.c.

fdTerrainGetSplitBottomStepHeight

FIXED fdTerrainGetSplitBottomStepHeight(const Sint8 *samples, Uint32 column, Uint32 row)

Above y 8 the first sample; below, a step along x from the second to the third.

References Sint32.

Referenced by MapGridTerrainHeightFunctions.

Definition at line 283 of file field_terrain.c.

fdMapGridGetTerrainHeight

FIXED fdMapGridGetTerrainHeight(Sint32 layer, FIXED x, FIXED z)

Returns the ground height of a layer at (x, z) in 16.16 pixels, as The Broken Seal's: the height function of the metatile's terrain kind applied to its samples.

References MapShapeGrid and Sint32.

Referenced by fdActorMoveAsSand(), fdActorMoveByKeys(), fdActorScriptResetToOrigin(), fdActorScriptSetPosAndResetMotion(), fdActorSystemPlaceSprites(), fdActorUpdateAllOnField(), fdActorUpdateHoverControl(), fdMapGridGetHighestTerrainHeightAround() and fdMapGridGetMetatileHeight().

Definition at line 322 of file field_terrain.c.

fdMapGridGetTerrainKindAt

Sint32 fdMapGridGetTerrainKindAt(Sint32 layer, FIXED x, FIXED z)

Returns the terrain kind of a layer's metatile at (x, z) in 16.16 pixels, as The Broken Seal's.

References MapShapeGrid and Sint32.

Definition at line 342 of file field_terrain.c.

fdMapGridGetTerrainKindOrBumpAt

Sint32 fdMapGridGetTerrainKindOrBumpAt(Sint32 layer, Sint32 x, Sint32 z)

As fdMapGridGetTerrainKindAt, but a rounded square whose two samples differ reads as TERRAIN_BUMP.

References MapShapeGrid and Sint32.

Referenced by scActorRollAndCrumble(), scFireballCarryLeader() and scMarsLighthouseEntranceRideFireball().

Definition at line 361 of file field_terrain.c.

fdMapGridGetHighestTerrainHeightAround

FIXED fdMapGridGetHighestTerrainHeightAround(Sint32 layer, FIXED x, FIXED z, FIXED reach)

The highest ground at (x, z) and at the four points reach away from it along x and z, all in 16.16 pixels.

References fdMapGridGetTerrainHeight() and Sint32.

Definition at line 385 of file field_terrain.c.

fdMapGridSetMetatileHeight

void fdMapGridSetMetatileHeight(Sint32 x, Sint32 z, Sint32 layer, Sint32 height)

Gives the metatile at (x, z) of layer the ground height height, in 8-pixel steps, by tagging its shape with terrain kind 0 at that height.

References fdMapShapeFindOrAddStub(), MapShapeGrid and Sint32.

Referenced by scActorRaiseFromMetatile(), scAirsRockInsideBlowGust(), scAirsRockInsideSetStakeMetatiles(), scAirsRockInsideStartPushingPillar(), scAlhafranCaveLowerBridgeMetatiles(), scAlhafranCaveRaiseBridgeMetatiles(), scAlhafranCaveSetUpCave(), scAnemosInnerSanctumFinishMovingBlock(), scAnemosInnerSanctumLightSymbol(), scAnemosInnerSanctumOpenMimicStoneDoor(), scCavernsFinishMovingAngaraBlock(), scCavernsPlaceAngaraBlocks(), scCavernsStartMovingAngaraBlock(), scFieldMapGridSetMetatileHeight(), scInit(), scIzumoRuinsShowStakeState(), scJupiterLighthouseDrawBlocksInGaps(), scJupiterLighthouseFinishMovingPillar(), scJupiterLighthouseLiftPathBlock(), scJupiterLighthouseLightWestPath(), scJupiterLighthousePlacePathBlock(), scJupiterLighthouseSetMetatileHeight(), scJupiterLighthouseStartMovingBlock(), scMarsLighthouseEntranceSetIceConeMetatiles(), scPrepareMap(), scTundariaTowerJumpDownSlide() and scTundariaTowerSetColumnMetatile().

Definition at line 411 of file field_terrain.c.

fdMapGridGetMetatileHeight

Sint32 fdMapGridGetMetatileHeight(FIXED x, FIXED z, Sint32 layer)

The ground height at (x, z) of layer, in 8-pixel steps.

References fdMapGridGetTerrainHeight() and Sint32.

Referenced by scPrepareMap().

Definition at line 424 of file field_terrain.c.

fdMapGridGetTerrainKind

Sint32 fdMapGridGetTerrainKind(Sint32 layer, Sint32 x, Sint32 z)

As fdMapGridGetTerrainKindAt, under the name the scenes' overlays import.

References MapShapeGrid and Sint32.

Referenced by fdActorSetMetatileShape(), scCrumblingPillarPlace(), scCrumblingPillarPlaceWithStandIn(), scHeldActorRaiseMetatile(), scMagmaRockInsideRestoreCrumblingPillars(), scMagmaRockInsideRestorePillars(), scMagmaRockInsideSetMetatileShape(), scMagmaRockRestoreCrumblingPillars(), scPillarLowerHeldMetatiles(), scPillarRaise(), scYampiDesertStepOffStakeTops() and scYampiDesertStepOntoStakeTops().

Definition at line 430 of file field_terrain.c.

fdMapGridGetMetatileBehaviorAt

Uint8 fdMapGridGetMetatileBehaviorAt(Sint32 layer, FIXED x, FIXED y)

Returns the metatile behavior of a layer's metatile at (x, y) in 16.16 pixels.

References MapGridMetatileBuffer and Sint32.

Referenced by scAnemosInnerSanctumDullahanOpenTheWay(), scCavernsFinishMovingAngaraBlock(), scFieldMapGridGetMetatileBehaviorAt(), scGaiaRockInsideCycloneClearsCobweb() and scLeaderSlideOnIceFromEdge().

Definition at line 449 of file field_terrain.c.

fdMapGridSetMetatileBehaviorAt

void fdMapGridSetMetatileBehaviorAt(Uint32 layer, FIXED x, FIXED y, Uint32 collisionCode)

Sets the metatile behavior of a layer's metatile at (x, y) in 16.16 pixels. Writes the metatile in the map's grid; does nothing before the map is set up.

Referenced by fdSetMetatileBehaviorAt().

Definition at line 468 of file field_terrain.c.

fdMapGridGetTerrainHeightAbove

FIXED fdMapGridGetTerrainHeightAbove(FIXED px, FIXED pz, Sint32 layer, FIXED base)

The height of the ground at (px, pz) (16.16 pixels) on the given layer, less base; a layer past 2 reads the shape grid. With no map, or on the World Map, it is 0.

References MapShapeGrid and Sint32.

Definition at line 489 of file field_terrain.c.

fdMapGridCheckCollisionAt

Sint32 fdMapGridCheckCollisionAt(FIXED px, FIXED pz, Sint32 layer, Sint32 height)

How the ground at (px, pz) (16.16 pixels) on the given layer stands to height: GROUND_WALL, GROUND_RISES, GROUND_DROPS or GROUND_LEVEL. A layer past 2 reads the metatile buffer and shape grid. With no map, or on the World Map, every point is level.

References MapGridMetatileBuffer, MapShapeGrid and Sint32.

Referenced by fdActorMoveAsSand().

Definition at line 520 of file field_terrain.c.

fdMapGridCheckCollision

Sint32 fdMapGridCheckCollision(ACTOR *actor, POS *pos)

As fdMapGridCheckCollisionAt for the point position (16.16 pixels, read as its whole-pixel halves) on the actor's layer, against its ground height.

References MapGridMetatileBuffer, MapShapeGrid and Sint32.

Referenced by fdActorMoveAsSand(), fdActorSailOnMap(), fdActorScriptWanderNearHome(), fdActorUpdatePlayerControl(), fdActorUpdateWalkingControl(), fdActorWander(), scActorStopAtPushTarget(), scAnkohlRuinsFlowWithSand(), scApojiiIslandsFlowWithStream(), scAquaRockInsideStepIntoVentGust(), scAquaRockRideStreamUp(), scCavernsJumpAcross(), scFieldActorCheckMovementCollision(), scGabombaCatacombsDriftWithStream(), scGabombaStatueRideBlueCog(), scKandoreanTemplePushSouth(), scLeaderFlowWithStream(), scMagmaRockInsidePushBlockOnto(), scPushedActorAdvancePair(), scPushTargetCheckCollision(), scTaopoSwampStepIntoGust() and scYampiDesertCaveStopLeaderAtLog().

Definition at line 563 of file field_terrain.c.

fdMapGridCheckCollisionAbove

Sint32 fdMapGridCheckCollisionAbove(ACTOR *actor, POS *pos)

As fdMapGridCheckCollision, against the actor's height and never GROUND_DROPS: the ground the hovering leader (SC_HOVER) cannot float over.

References MapGridMetatileBuffer, MapShapeGrid and Sint32.

Referenced by fdActorUpdateHoverControl().

Definition at line 605 of file field_terrain.c.

fdMapGridIsWallAt

Sint32 fdMapGridIsWallAt(Sint32 *pos)

Returns -1 when the metatile under position (its x, and z less its height) in the overhead layer is a wall, else 0; also 0 before the map state exists.

References Sint32.

Referenced by fdActorMoveByKeys().

Definition at line 643 of file field_terrain.c.

fdWorldMapGetBlockMetatileBehavior

Sint32 fdWorldMapGetBlockMetatileBehavior(WORLD_POS *pos)

The metatile behavior of the world map block under position (blocks 32 pixels square on a 32 by 32 grid), which the World Map's step cues answer (world_map.c: STEP_CUE_AREA(AREA_DAILA) enters Daila, METATILE_BEHAVIOR_WORLD_MAP_IRON meets Iron), or METATILE_BEHAVIOR_WALL where the map has no block.

References MetatileTiles and Sint32.

Referenced by fdWorldMapIsFlyable(), fdWorldMapIsSailable(), fdWorldMapIsWalkable() and scShipTakeFlight().

Definition at line 663 of file field_terrain.c.

fdWorldMapGetCollision

Sint32 fdWorldMapGetCollision(WORLD_POS *pos)

Returns the world map's collision value (1-15) at position: from the upper collision layer where it has one, else the lower, else WORLD_MAP_COLLISION_DEFAULT.

References result and Sint32.

Referenced by fdActorFlyOnWorldMap(), fdActorMoveAsSandOnWorldMap(), fdActorMoveOnWorldMap(), fdActorSailOnMap(), fdActorSailOnWorldMap(), fdWorldMapGetBattleEnvironment(), fdWorldMapIsFlyable(), fdWorldMapIsSailable(), fdWorldMapIsWalkable() and scWorldMapLeaveShip().

Definition at line 680 of file field_terrain.c.

fdWorldMapIsWalkable

Sint32 fdWorldMapIsWalkable(void *mover, WORLD_POS *pos)

Returns 0 when the world map at position can be walked on (a place there, and collision WORLD_MAP_COLLISION_WALKABLE_FIRST to WORLD_MAP_COLLISION_WALKABLE_LAST), else -1.

References fdWorldMapGetBlockMetatileBehavior(), fdWorldMapGetCollision() and Sint32.

Referenced by fdActorMoveAsSandOnWorldMap(), fdActorMoveOnWorldMap() and scWorldMapLeaveShip().

Definition at line 734 of file field_terrain.c.

fdWorldMapIsSailable

Sint32 fdWorldMapIsSailable(void *mover, WORLD_POS *pos)

Returns 0 where the ship can sail (the sea or shallow water), else -1.

References fdWorldMapGetBlockMetatileBehavior(), fdWorldMapGetCollision() and Sint32.

Referenced by fdActorSailOnWorldMap().

Definition at line 748 of file field_terrain.c.

fdWorldMapIsFlyable

Sint32 fdWorldMapIsFlyable(ACTOR *mover, WORLD_POS *pos)

Returns 0 where the flying ship can go, else -1: low down, where it can sail; higher, more of the ground by the kind it last flew over.

References fdWorldMapGetBlockMetatileBehavior(), fdWorldMapGetCollision() and Sint32.

Referenced by fdActorFlyOnWorldMap().

Definition at line 789 of file field_terrain.c.