include/field/map_grid.h
The map grid: its layers and metatiles, the metatile behaviors and attributes the field reads, its tile animations and blend script, and the world map's collision and battle environments.
#include "field/field_coordinate.h"#include "fixed_math.h"#include "types.h"#include "static_assert.h"#include "system.h"
Included by field_actors.c, field_engine_internal.h, field_psynergy_internal.h, map_grid_data.c, script_commands_internal.h, world_map_encounter_rules.c, caverns.c, gaia_rock.c, magma_rock.c, mikasalla.c, naribwe.c, cracked_tile_mask.c, map_metatile_fill.c, map_metatile_fill_byte.c, map_metatile_get.c, map_metatile_set.c, world_map_objects.c, window_selection.c, map.h, ground_effects.h, mars_lighthouse_shared.h and scene.h.
Structures
| Name | Description | |
|---|---|---|
struct | BLEND_SCRIPT_STATE | The map's running blend script, which sets the blend registers over time (fdBlendScriptRun, each tick from fdBlendScriptStart). |
struct | MAP_ANIMATION | One of a map's 16 tile animations (fdTilesetAnimationStartAll): the start of its script, where it is, the ticks left before its next step, and whether it is paused. |
struct | MAP_METATILE | One metatile of a map layer: its metatile tiles and flags, its collision code and a second attribute byte. |
struct | MAP_RESOURCES | A row of MapsWork: a layout's resources, each counted from ResourceIdEmptyMap. |
struct | MAP_LAYER | One background layer of the field map: its scroll position, origin, parallax against the view, drift and wrap, and its window of metatiles. |
struct | MAP_STATE | The map grid's state (heap slot HEAP_SLOT_MAP_GRID): the point the view follows, the screen shake, the tile animations and blend script, and the view. |
struct | MAP_VIEW_STATE | A view of the map state as the screen transitions read it: the display control bits, the window edges and interrupt lines of a transition, and the map's resources. |
struct | WORLD_POS | A position on the world map, as its walkability check reads it. |
struct | SHAPE_METATILE | A metatile of the map's shape grid: one byte, the tag of the metatile's collision shape. |
Macros
| Name | Description | |
|---|---|---|
#define | MAPGRID_SIZE 128 | The map grid: 128 by 128 metatiles, each MAPGRID_METATILE_PIXELS square, wrapping at its edges. |
#define | MAPGRID_ROW_MASK ((MAPGRID_SIZE - 1) * MAPGRID_SIZE) | A layer window's row mask (MapLayer.maskY) over the whole grid, which wraps there rather than at a window of its own. |
#define | MAPGRID_LAYER_SCREEN_BYTES 2048 | The bytes between one layer's BG map and the next, from screen block 5. |
#define | MAPGRID_SHAPE_KIND_MASK 0xf | The low four bits of a shape's first byte: its kind (TERRAIN_KIND), which height function reads its samples (MapGridTerrainHeightFunctions). |
#define | METATILE_HEIGHT_STEPS (height) ((height) >> 19) | A 16.16 height in the 8-pixel steps fdMapGridSetMetatileHeight and the collision tags take. |
#define | METATILE_CODE (attributes) ((attributes) >> 8) | The collision code in scMapMetatileGetAttributes's halfword, above its attribute byte. |
#define | METATILE_CODE_BITS 0xff00 | scMapMetatileGetAttributes's halfword: the collision code over the second attribute byte (MAP_METATILE.attributeB), and the halfword built from the two. |
#define | METATILE_ATTRIBUTE_BITS 0xff | |
#define | METATILE_ATTRIBUTES (code, bits) (((code) << 8) | (bits)) | |
#define | MAPGRID_BLEND_SCRIPT (RamMapCollision + 7680) | Where a layout's blend script is decoded, in the map collision buffer after the collision and the tileset animations; a scene may copy its own there. |
#define | BLEND_SCRIPT_LOOP 65535 | A blend script's commands besides its BLDCNT values: the end, which starts it over, and a jump, its low byte the halfword pair to go on from. |
#define | BLEND_SCRIPT_JUMP 0xfe00 | |
#define | MAP_METATILE_WORD (behavior, attributes, pictureFlags) | A MAP_METATILE read as one word, as code that ORs bits into a metatile writes it: its collision code (the metatile behavior), the attribute bits above it and the flags of its metatile tiles. |
#define | METATILE_DRAWS_ACTOR (priority, layer) | The flags of a metatile's tiles for an actor standing on the metatile: the sprite priority it is drawn at and the map layer it takes, which the actors' placement reads (MAP_METATILE's actorPriority and actorLayer). |
#define | MAPGRID_FIELD_STATE_SIZE offsetof(MAP_STATE, layers[3]) | The bytes of MAP_STATE a field map uses: up to its third layer, the last the field scrolls. |
#define | GROUND_EFFECTS_WADING_MASK (3 << 2) | MAP_STATE.groundEffects' kind of wading, its bits 3..2; none where nothing wades. |
#define | GROUND_EFFECTS_WADING (effects) ((Uint32)((effects) << 28) >> 30) | |
#define | MAP_EDIT_STEPS_END 65535 | A map edit step's source column that ends the steps. |
Enumerations
| Name | Description | |
|---|---|---|
enum | MAP_GRID_LAYER_INDEX { MAPGRID_LAYER_GROUND, MAPGRID_LAYER_MIDDLE, MAPGRID_LAYER_OV … } | A layout's three layers, by what they hold. |
enum | METATILE_BEHAVIOR { METATILE_BEHAVIOR_NORMAL, METATILE_BEHAVIOR_CUE_FIRST, METAT … } | A metatile's collision code: the codes the field code reads by name. |
enum | MAP_METATILE_ATTR { MAP_METATILE_SCOOP, MAP_METATILE_PUSH, MAP_METATILE_SECOND_Z … } | MAP_METATILE.attributeB's bits. |
enum | WORLD_MAP_COLLISION { WORLD_MAP_COLLISION_SEA_FIRST, WORLD_MAP_COLLISION_WATER_FIR … } | The world map's collision values (fdWorldMapGetCollision), 1 to 15, the sea the ship sails among them. |
enum | BATTLE_ENVIRONMENT { BATTLE_ENVIRONMENT_NONE, BATTLE_ENVIRONMENT_GRASSLAND, BATTL … } | A world map battle environment (WorldMapTerrainBehaviorTable, fdWorldMapGetBattleEnvironment): what its ground means for battles, named by the battle background fdBattleBackgroundSelectForEnvironment gives it. |
enum | CYCLONE_METATILE_KIND { CYCLONE_METATILE_NONE, CYCLONE_METATILE_BURST, CYCLONE_METAT … } | What Cyclone does at a metatile (fdMapGridGetCycloneMetatileKind). |
Functions
| Name | Description | |
|---|---|---|
static inline FIXED * | fdMapStateView (MAP_STATE *map) | The map's view position (MAP_STATE.view): its left and its top, x then z, in 16.16 fixed-point pixels. |
static inline MAP_LAYER * | fdMapGridGetLayer (Sint32 layer) | The map grid's background layer layer (MAP_STATE.layers), in the map state of heap slot HEAP_SLOT_MAP_GRID. |
void | scMapGridFillCollisionRectangle (Sint32 layer, Sint32 x, Sint32 y, Uint32 width, Uint32 height, Sint32 value) | Sets the collision code of a rectangle of one layer's map metatiles. |
Sint32 | fdMapGetTerrainHeight (Sint32 terrain, Sint32 x, Sint32 z) | The ground height of a layer at (x, z), 16.16 pixels (fdMapGridGetTerrainHeight, through the overlay's own import row). |
Sint32 | fdMapGridIsWaterMetatile (Sint32 x, Sint32 z, Sint32 layer) | Whether the metatile at (x, z) is water: MAP_METATILE_WATER, or on the world map collision WORLD_MAP_COLLISION_WATER_FIRST to WORLD_MAP_COLLISION_SEA_LAST. |
Sint32 | fdMapGridGetCycloneMetatileKind (Sint32 x, Sint32 z, Sint32 layer) | The Cyclone's kind of the metatile at (x, z), from the overhead layer's collision code (CYCLONE_METATILE_KIND). |
Variables
| Name | Description | |
|---|---|---|
extern const MAP_RESOURCES | MapsWork [] | Every layout's resources, by map number (map/resources.s). |
Description
The map grid: its layers and metatiles, the metatile behaviors and attributes the field reads, its tile animations and blend script, and the world map's collision and battle environments.
Macros in detail
MAPGRID_SIZE
#define MAPGRID_SIZE 128
The map grid: 128 by 128 metatiles, each MAPGRID_METATILE_PIXELS square,
wrapping at its edges.
Referenced by fdActorGetCueMetatileAheadOfCurrent(), fdActorGetMetatileIndex(), fdActorMoveByKeys(), fdActorResetForLeader(), fdActorSetMetatileShape(), fdActorUpdatePlayerControl(), fdBlankOverlayDrawMarks(), fdClimbDown(), fdClimbUp(), fdGetCollisionAheadOfLeader(), fdGetCollisionUnderLeader(), fdHangingVineHang(), fdMapCopyMetatileAttributeRect(), fdMapCopyRawMetatilesRect(), fdMapGridCopyDrawnPicturesRect(), fdMapGridCopyMetatileTilesIndicesRect(), fdMapGridGetMetatileAt(), fdMapGridGetMetatileBehaviorAt(), fdMapGridIsWallAt(), fdMapGridLoadMap(), fdMapGridRenderMetatileTilesColumn(), fdMapGridRenderMetatileTilesRow(), fdMapGridSetCameraCenter(), fdMapGridSetMetatileBehaviorAt(), fdMapGridSetMetatileHeight(), fdPlaceTreasureSpots(), fdTryJumpForward(), fdUpdateWalking(), scActorRollAndCrumble(), scAquaRockGetMetatileAttribute(), scAquaRockInsideAdvanceStreams(), scAquaRockInsideBlockMetatileUnder(), scAquaRockInsideSetPillarHeight(), scCrackedTileFall(), scCrackedTileFind(), scGaiaRockCueWallMetatile(), scGeyserUpdate(), scHeldActorRaiseMetatile(), scInit(), scIsletsSetMetatileCollision(), scMagmaRockInsideSetMetatileShape(), scMapGridFillCollisionRectangle(), scMapMetatileSetAttributes(), scMarsLighthouseEntranceCheckCrackedFloor(), scMarsLighthouseEntranceFallIntoHole(), scMarsLighthouseTowersFreezePuddle(), scMarsLighthouseTowersMeltPuddle(), scMarsLighthouseTowersPushPipeOrJump(), scPillarLowerHeldMetatiles(), scPillarRaise() and 6 more.
Definition at line 37 of file map_grid.h.
MAPGRID_ROW_MASK
#define MAPGRID_ROW_MASK ((MAPGRID_SIZE - 1) * MAPGRID_SIZE)
A layer window's row mask (MapLayer.maskY) over the whole grid, which wraps there rather than at a window of its own.
Referenced by fdMapGridRenderMetatileTilesColumn(), fdMapGridRenderMetatileTilesRow(), fdMapGridSetCameraCenter(), scPrepareMap() and scTaopoSwampFocusMapOn().
Definition at line 40 of file map_grid.h.
MAPGRID_LAYER_SCREEN_BYTES
#define MAPGRID_LAYER_SCREEN_BYTES 2048
The bytes between one layer's BG map and the next, from screen block 5.
Referenced by fdMapGridCopyDrawnPicturesRect(), fdMapGridCopyMetatileTilesIndicesRect(), fdMapGridRenderMetatileTilesColumn(), fdMapGridRenderMetatileTilesRow() and fdMapGridSetCameraCenter().
Definition at line 42 of file map_grid.h.
MAPGRID_SHAPE_KIND_MASK
#define MAPGRID_SHAPE_KIND_MASK 0xf
The low four bits of a shape's first byte: its kind (TERRAIN_KIND), which
height function reads its samples (MapGridTerrainHeightFunctions).
Referenced by fdMapGridGetTerrainKind() and fdMapGridGetTerrainKindAt().
Definition at line 45 of file map_grid.h.
METATILE_HEIGHT_STEPS
#define METATILE_HEIGHT_STEPS(height) ((height) >> 19)
A 16.16 height in the 8-pixel steps fdMapGridSetMetatileHeight and the
collision tags take.
Referenced by fdActorSetMetatileShape(), fdFlagBlockApplyFlags(), scActorRaiseFromMetatile(), scAirsRockInsideSetStakeMetatiles(), scAirsRockMoveSecondPillar(), scAnkohlRuinsRaiseFirstSand(), scAnkohlRuinsRaiseSecondSand(), scCavernsFinishMovingAngaraBlock(), scCavernsPlaceAngaraBlocks(), scCavernsStartMovingAngaraBlock(), scCrumblingPillarPlace(), scCrumblingPillarPlaceWithStandIn(), scHeldActorRaiseMetatile(), scIzumoRuinsShowStakeState(), scMagmaRockInsideRaiseActorMetatiles(), scMagmaRockInsideRestoreCrumblingPillars(), scMagmaRockInsideRestorePillars(), scMagmaRockPushPillarEast(), scMagmaRockPushPillarWest(), scMagmaRockRaiseFlameTop(), scMagmaRockRestoreCrumblingPillars(), scMagmaRockSettleBlocks(), scMarsLighthouseEntranceSetIceConeMetatiles(), scPillarLowerHeldMetatiles(), scPillarRaise(), scTundariaTowerSetColumnMetatile(), scYampiDesertStepOffStakeTops() and scYampiDesertStepOntoStakeTops().
Definition at line 48 of file map_grid.h.
METATILE_CODE
#define METATILE_CODE(attributes) ((attributes) >> 8)
The collision code in scMapMetatileGetAttributes's halfword, above its
attribute byte.
Referenced by scAirsRockBlowGust(), scAirsRockInsideMovePooledWhirlwind(), scAirsRockInsideMoveWhirlwind(), scAirsRockInsideOpenTabletRoomDoor(), scAirsRockInsideRestoreMetatileBehindLeader(), scAirsRockInsideRideWhirlwind(), scAirsRockInsideStepOffVanishingStone(), scAirsRockMoveWhirlwind(), scAirsRockRideWhirlwind(), scIzumoRuinsShowStakeState() and scIzumoRuinsSinkIntoSand().
Definition at line 51 of file map_grid.h.
METATILE_CODE_BITS
#define METATILE_CODE_BITS 0xff00
scMapMetatileGetAttributes's halfword: the collision code over the second
attribute byte (MAP_METATILE.attributeB), and the halfword built from the
two.
Referenced by scAirsRockInsideSetStakeMetatiles() and scMarsLighthouseEntranceSetIceConeMetatiles().
Definition at line 55 of file map_grid.h.
METATILE_ATTRIBUTE_BITS
#define METATILE_ATTRIBUTE_BITS 0xff
Referenced by scAirsRockMoveSecondPillar(), scIzumoRuinsFinishMovingPillar(), scIzumoRuinsShowStakeState(), scIzumoRuinsStartMovingPillar(), scMagmaRockSettleBlocks(), scMarsLighthouseEntranceSetIceConeMetatiles() and scTundariaTowerSetColumnMetatile().
Definition at line 56 of file map_grid.h.
METATILE_ATTRIBUTES
#define METATILE_ATTRIBUTES(code, bits) (((code) << 8) | (bits))
Referenced by scAirsRockInsideSetStakeMetatiles(), scAirsRockInsideVanishStone(), scAirsRockMoveSecondPillar(), scInit(), scIzumoRuinsShowStakeState(), scIzumoRuinsStartMovingPillar(), scMarsLighthouseEntranceSetIceConeMetatiles(), scTundariaTowerRefluxAppears(), scTundariaTowerRevealHiddenWay(), scTundariaTowerSetColumnMetatile() and scTundariaTowerUpdateBrownWallMetatile().
Definition at line 57 of file map_grid.h.
MAPGRID_BLEND_SCRIPT
#define MAPGRID_BLEND_SCRIPT (RamMapCollision + 7680)
Where a layout's blend script is decoded, in the map collision buffer after the collision and the tileset animations; a scene may copy its own there.
Referenced by fdMapGridLoadMap() and scPrepareMap().
Definition at line 61 of file map_grid.h.
BLEND_SCRIPT_LOOP
#define BLEND_SCRIPT_LOOP 65535
A blend script's commands besides its BLDCNT values: the end, which starts it over, and a jump, its low byte the halfword pair to go on from.
Referenced by fdBlendScriptRun() and fdBlendScriptStart().
Definition at line 64 of file map_grid.h.
BLEND_SCRIPT_JUMP
#define BLEND_SCRIPT_JUMP 0xfe00
Referenced by fdBlendScriptRun().
Definition at line 65 of file map_grid.h.
MAP_METATILE_WORD
#define MAP_METATILE_WORD(behavior, attributes, pictureFlags)
A MAP_METATILE read as one word, as code that ORs bits into a metatile writes
it: its collision code (the metatile behavior), the attribute bits above it
and the flags of its metatile tiles.
Definition at line 158 of file map_grid.h.
METATILE_DRAWS_ACTOR
#define METATILE_DRAWS_ACTOR(priority, layer)
The flags of a metatile's tiles for an actor standing on the metatile: the
sprite priority it is drawn at and the map layer it takes, which the actors'
placement reads (MAP_METATILE's actorPriority and actorLayer).
Referenced by scGabombaStatueDrawCogMetatiles().
Definition at line 163 of file map_grid.h.
MAPGRID_FIELD_STATE_SIZE
#define MAPGRID_FIELD_STATE_SIZE offsetof(MAP_STATE, layers[3])
The bytes of MAP_STATE a field map uses: up to its third layer, the last the
field scrolls.
Referenced by fdMapGridLoadMap().
Definition at line 273 of file map_grid.h.
GROUND_EFFECTS_WADING_MASK
#define GROUND_EFFECTS_WADING_MASK (3 << 2)
MAP_STATE.groundEffects' kind of wading, its bits 3..2; none where nothing
wades.
Referenced by fdActorUpdatePlayerControl() and fdTryJumpForward().
Definition at line 277 of file map_grid.h.
GROUND_EFFECTS_WADING
#define GROUND_EFFECTS_WADING(effects) ((Uint32)((effects) << 28) >> 30)
Referenced by fdActorUpdatePlayerControl() and fdTryJumpForward().
Definition at line 278 of file map_grid.h.
MAP_EDIT_STEPS_END
#define MAP_EDIT_STEPS_END 65535
A map edit step's source column that ends the steps.
Referenced by AlhafraDoorOpening, AlhafraNoDoor, AlhafraSecondDoorOpening, ChampaNoDoor, ChampaSanctumDoorOpening, EasternAlhafraShipDoorOpening, fdMapGridPlayMapEdit(), GarohHouseDoorOpening, GarohSanctumDoorOpening, GarohShopDoorOpening, IsletsNoOpening, IsletsSnowHutDoorOpening, LemuriaDockCabinDoorOpening, LemuriaDoorOpening, LemuriaPalaceDoorOpening, LemuriaWideDoorOpening, LemuriaWindowOpening, LohoDoorOpening, MadraCavernHomeDoorOpening, MadraDoorOpening, MikasallaDoorOpening, MikasallaThirdDoorOpening, MikasallaWideDoorOpening, NaribweDoorOpening, YallamDoorOpening, YallamSanctumDoorOpening, YallamSecondDoorOpening and YallamThirdDoorOpening.
Definition at line 408 of file map_grid.h.
Enumerations in detail
MAP_GRID_LAYER_INDEX
enum MAP_GRID_LAYER_INDEX
A layout's three layers, by what they hold. Most layouts give them priorities 3, 2 and 1.
| Enumerator | Value | Description |
|---|---|---|
MAPGRID_LAYER_GROUND | 0 | BG3: the ground, at the back |
MAPGRID_LAYER_MIDDLE | 1 | BG2: walls and edges, under the actors |
MAPGRID_LAYER_OVERHEAD | 2 | BG1: roofs and tree tops, over the actors |
Definition at line 69 of file map_grid.h.
METATILE_BEHAVIOR
enum METATILE_BEHAVIOR
A metatile's collision code: the codes the field code reads by name. Cloak,
Sand, the Cyclone and Hover read theirs on the overhead layer
(script_commands_field_psynergy.c).
| Enumerator | Value | Description |
|---|---|---|
METATILE_BEHAVIOR_NORMAL | 0 | Open ground, where nothing happens. |
METATILE_BEHAVIOR_CUE_FIRST | 1 | 1 to 230: the scene's own, each |
METATILE_BEHAVIOR_CUE_LAST | 230 | the step cue it raises as the leader walks onto it (fdUpdateWalking), or as he climbs a wall drawn over it on the overhead layer (scGaiaRockCueWallMetatile); those above are the field's own. |
METATILE_BEHAVIOR_CLOAK | 231 | Cloak hides the leader there. |
METATILE_BEHAVIOR_SAND | 232 | Sand lets the leader move there as sand. |
METATILE_BEHAVIOR_CYCLONE | 233 | A metatile the Cyclone acts on (fdMapGridGetCycloneMetatileKind's kind 1). |
METATILE_BEHAVIOR_CYCLONE_CARRY | 234 | A metatile the Cyclone carries the leader to, its centre kept in FIELD_STATE.cycloneCarryX and Z (kind 2). |
METATILE_BEHAVIOR_CYCLONE_LIFT | 235 | A metatile the Cyclone lifts the leader onto, its centre kept in FIELD_STATE.cycloneLiftX and Z (kind 3). |
METATILE_BEHAVIOR_HOVER | 236 | Hover holds the leader up over it. |
METATILE_BEHAVIOR_JAR | 242 | 242 to 247: examine cues with lines of their own, the same on every map (fdExamineMetatile, FieldExamineCueMessageOffsets). |
METATILE_BEHAVIOR_BARREL | 243 | |
METATILE_BEHAVIOR_WOODEN_BOX | 244 | |
METATILE_BEHAVIOR_GRAVE | 245 | |
METATILE_BEHAVIOR_BOOKS | 246 | |
METATILE_BEHAVIOR_WELL | 247 | |
METATILE_BEHAVIOR_JUMP_FORWARD | 254 | Jumped across. |
METATILE_BEHAVIOR_WALL | 255 | Blocks whatever the heights. |
Definition at line 79 of file map_grid.h.
MAP_METATILE_ATTR
enum MAP_METATILE_ATTR
MAP_METATILE.attributeB's bits.
| Enumerator | Value | Description |
|---|---|---|
MAP_METATILE_SCOOP | 0x01 | Scoop digs here, or everywhere else where the scene's attributes turn it round (FIELD_STATE.sceneAttributeLow, fdMapGridCanScoop). |
MAP_METATILE_PUSH | 0x02 | Pushing against the metatile pushes the actor ahead (fdRunPushMetatile). |
MAP_METATILE_SECOND_ZONE | 0x04 | Random battles here roll on the scene's second encounter zone (fdUpdateWalking). |
MAP_METATILE_HAZARD | 0x08 | Hazardous ground; with HAZARD_COUNT_ON_METATILES the hazard count rises by the pixels walked on it. |
MAP_METATILE_WATER | 0x10 | Water (fdMapGridIsWaterMetatile). |
MAP_METATILE_LEDGE | 0x20 | A ledge, jumped down by pushing KEY_DOWN. |
MAP_METATILE_CLIMBABLE | 0x40 | A wall the leader can climb (fdMapGridIsClimbableMetatile, fdActorMoveByKeys). |
MAP_METATILE_JUMP | 0x80 | A gap the leader jumps across, pushing forward. |
Definition at line 121 of file map_grid.h.
WORLD_MAP_COLLISION
enum WORLD_MAP_COLLISION
The world map's collision values (fdWorldMapGetCollision), 1 to 15, the sea
the ship sails among them.
| Enumerator | Value | Description |
|---|---|---|
WORLD_MAP_COLLISION_SEA_FIRST | 1 | The ship sails on WORLD_MAP_COLLISION_SEA_FIRST to WORLD_MAP_COLLISION_SEA_LAST and on shallow water (fdWorldMapIsSailable). |
WORLD_MAP_COLLISION_WATER_FIRST | 2 | The first collision that is water |
WORLD_MAP_COLLISION_SEA_LAST | 4 | to Scoop and Parch: the sea from here to WORLD_MAP_COLLISION_SEA_LAST, all but WORLD_MAP_COLLISION_SEA_FIRST. |
WORLD_MAP_COLLISION_WALKABLE_FIRST | 5 | The party walks only on WORLD_MAP_COLLISION_WALKABLE_FIRST to WORLD_MAP_COLLISION_WALKABLE_LAST (fdWorldMapIsWalkable). |
WORLD_MAP_COLLISION_SHALLOW_WATER | 6 | Shallow water: a ripple follows the leader as it walks, and the ship sails there too. |
WORLD_MAP_COLLISION_DEFAULT | 7 | Where neither collision layer has a value. |
WORLD_MAP_COLLISION_FOREST | 9 | Forest: the leader's sprite shows |
WORLD_MAP_COLLISION_WALKABLE_LAST | 12 | its second layer and no shadow. |
Definition at line 316 of file map_grid.h.
BATTLE_ENVIRONMENT
enum BATTLE_ENVIRONMENT
A world map battle environment (WorldMapTerrainBehaviorTable,
fdWorldMapGetBattleEnvironment): what its ground means for battles, named by
the battle background fdBattleBackgroundSelectForEnvironment gives it.
| Enumerator | Value | Description |
|---|---|---|
BATTLE_ENVIRONMENT_NONE | 0 | |
BATTLE_ENVIRONMENT_GRASSLAND | 1 | ResourceIdGrasslandBBackdrop. |
BATTLE_ENVIRONMENT_FOREST | 2 | ResourceIdDenseForestBackdrop; encounters take a region's forest zone. |
BATTLE_ENVIRONMENT_DESERT | 3 | ResourceIdDesertBackdrop. |
BATTLE_ENVIRONMENT_BEACH | 4 | ResourceIdRockyBeachBackdrop. |
BATTLE_ENVIRONMENT_SNOWFIELD | 5 | ResourceIdSnowfieldBBackdrop. |
BATTLE_ENVIRONMENT_SNOW_FOREST | 6 | ResourceIdSnowfieldBBackdrop, for the snowfield's forest. |
BATTLE_ENVIRONMENT_SHALLOWS | 7 | ResourceIdRockyBeachBackdrop, for shallow water (WORLD_MAP_COLLISION_SHALLOW_WATER). |
BATTLE_ENVIRONMENT_SEA | 8 | The sea the ship sails, collisions 1 to 3 outside the snowfields, where its encounters are (WorldMapShipEncounterRules); ResourceIdShipDeckBackdrop. |
BATTLE_ENVIRONMENT_SNOWFIELD_SEA | 9 | All the sea of the snowfield regions, where no rule gives encounters. |
BATTLE_ENVIRONMENT_SEA_LAST | 10 | WORLD_MAP_COLLISION_SEA_LAST outside the snowfields: the dark blue water of the rivers and lakes inland, between grass, sand and cliff banks, not the bright open sea. No rule gives encounters there; a battle there would take the ship deck's backdrop. |
BATTLE_ENVIRONMENT_BLIZZARD | 11 | ResourceIdBlizzardBackdrop. |
BATTLE_ENVIRONMENT_BLIZZARD_FOREST | 12 | ResourceIdBlizzardBackdrop, for the blizzard's forest. |
Definition at line 349 of file map_grid.h.
CYCLONE_METATILE_KIND
enum CYCLONE_METATILE_KIND
What Cyclone does at a metatile (fdMapGridGetCycloneMetatileKind).
| Enumerator | Value | Description |
|---|---|---|
CYCLONE_METATILE_NONE | 0 | |
CYCLONE_METATILE_BURST | 1 | blown away, with the particle burst |
CYCLONE_METATILE_CARRY | 2 | the whirlwind carries the leader to it |
CYCLONE_METATILE_LIFT | 3 | the whirlwind lifts the leader to it |
Definition at line 424 of file map_grid.h.
Functions in detail
fdMapStateView
static inline FIXED *fdMapStateView(MAP_STATE *map)
The map's view position (MAP_STATE.view): its left and its top, x then z, in
16.16 fixed-point pixels.
Referenced by btGeyserDraw(), fdActorGetScreenPos(), fdActorGetSpriteDepth(), fdActorSystemPlaceSprites(), fdBlankOverlayDrawMarks(), fdEffectSpawnRevealMarkers(), fdFadeOverlayDrawMarks(), fdGroundParticlesDraw(), fdGroundParticlesUpdate(), fdHangingVineDraw(), fdMapGridGetScreenRelativePos(), fdMotesUpdate(), fdRopeDraw(), fdScreenTransitionUpdateScanlineTable(), fdTightropeDraw(), fdWeatherUpdateRain(), scAnkohlRuinsDrawSand(), scApojiiIslandsDrawMetatileMarkers(), scAquaRockDrawFallingBubbles(), scAquaRockDrawRisingBubbles(), scAquaRockInsideDrawPillars(), scAquaRockInsideDrawSplashes(), scCrackedTileUpdate(), scFlameThrowersPuff(), scGabombaStatueDrawRaisedBlocks(), scLightSpritesDraw(), scMarsLighthouseEntranceDrawHoleMask() and scTrialRoadDrawFountains().
Definition at line 259 of file map_grid.h.
fdMapGridGetLayer
static inline MAP_LAYER *fdMapGridGetLayer(Sint32 layer)
The map grid's background layer layer (MAP_STATE.layers), in the map state
of heap slot HEAP_SLOT_MAP_GRID.
References Sint32.
Referenced by scAirsRockDriftFog(), scAirsRockLiftFog(), scAirsRockWhirlwindClearsFog(), scApojiiIslandsAddMetatileMarkers(), scDriftScenePrepare(), scEasternAlhafraFillWaveLines(), scGarohWavePathLayer(), scIdejimaUpdateWaveLines(), scInit(), scIsletsFillWaveLines(), scLayerTrackScroll(), scLemuriaFillRippleLines(), scLemurianShipDeckBobDeck(), scLemurianShipDeckScrollWaves(), scPrepareMap(), scSeaOfTimeAnimateSea() and scShamanVillageDriftSandLayer().
Definition at line 266 of file map_grid.h.
fdMapGetTerrainHeight
Sint32 fdMapGetTerrainHeight(Sint32 terrain, Sint32 x, Sint32 z)
The ground height of a layer at (x, z), 16.16 pixels
(fdMapGridGetTerrainHeight, through the overlay's own import row).
Referenced by fdActorSetMetatileShape(), fdGroundParticlesDraw(), fdGroundParticlesStart(), fdLeaderSlideOnIce(), fdLeaderSlideOnIceAhead(), fdWhirlwindCarryLeader(), scActorPopUp(), scActorPopUpSlow(), scActorRaiseFromMetatile(), scAirsRockInsideBlowGust(), scAirsRockInsideFinishPushingPillar(), scAirsRockInsideRideWhirlwind(), scAirsRockInsideRiseOnLift(), scAirsRockInsideSetStakeMetatiles(), scAirsRockPlacePillar(), scAirsRockRideWhirlwind(), scAnemosInnerSanctumDullahanShadowByHeight(), scAquaRockDrawFallingBubbles(), scAquaRockDrawRisingBubbles(), scAquaRockFlowSparkleUpStream(), scCavernsFinishMovingAngaraBlock(), scCavernsGetLayer2Height(), scCavernsPlaceAngaraBlocks(), scCavernsStartMovingAngaraBlock(), scCrackedTileUpdate(), scCrumblingPillarPlace(), scCrumblingPillarPlaceWithStandIn(), scGondowanCliffsScoopUpGeyser(), scHeldActorRaiseMetatile(), scInit(), scIzumoRuinsShowStakeState(), scJupiterLighthouseDropEnergyBlock(), scJupiterLighthousePlacePathBlock(), scLeaderSlideOnIceFromEdge(), scMagmaRockInsideFinishPushingPillar(), scMagmaRockInsideRaiseActorMetatiles(), scMagmaRockInsideRestoreCrumblingPillars(), scMagmaRockInsideRestorePillars(), scMagmaRockLandLeader(), scMagmaRockRestoreCrumblingPillars(), scMagmaRockSettleBlocks(), scMarsLighthouseEntranceDrawHoleMask(), scMarsLighthouseEntranceSetIceConeMetatiles(), scMarsLighthouseTowersDropBlock(), scPillarLowerHeldMetatiles(), scPillarRaise(), scPrepareMap(), scTrialRoadSettleOnGround(), scTrialRoadUncoverVent(), scTundariaTowerSetColumnMetatile() and 6 more.
Definition at line 419 of file map_grid.h.
Variables in detail
MapsWork
extern const MAP_RESOURCES MapsWork[]
Every layout's resources, by map number (map/resources.s).
Referenced by fdMapCopyPalette(), fdMapGetCameraBounds(), fdMapGridLoadMap() and fdMapLoadMetatilesAndShapes().
Definition at line 177 of file map_grid.h.