Skip to Content
The Alchemy Project

include/field/field_coordinate.h

FIELD_COORDINATE, a position on the field.

Included by script_commands_internal.h, actor.h, map_grid.h, metatile_target.h and scene.h.

Structures

NameDescription
structFIELD_COORDINATEA field coordinate, read whole or as its fraction and its whole pixels.

Macros

NameDescription
#defineMAPGRID_METATILE_PIXELS 16A map grid metatile's side: each metatile is this many pixels square.
#defineMAPGRID_METATILE_PIXEL_MASK 0xfff0A whole pixel coordinate's map metatile, in pixels: the pixel coordinate of the metatile's first pixel.
#defineFIELD_METATILE_MASK 0xfff00000A 16.16 coordinate's whole metatile.
#defineFIELD_METATILE_SHIFT 20A 16.16 coordinate's shift to its map grid metatile: 16 bits of fraction and 4 of the metatile's MAPGRID_METATILE_PIXELS.
#defineFIELD_METATILE (coordinate) ((coordinate) >> FIELD_METATILE_SHIFT)The map grid metatile a 16.16 coordinate lies in, counted from 0 along its axis.
#defineFIELD_HALF_METATILE (coordinate)The half metatile, 8 pixels, a 16.16 coordinate lies in, counted from 0 along its axis.
#defineFIELD_HALF_METATILE_ORIGIN (halfMetatile)The 16.16 coordinate of a half metatile's first pixel, FIELD_HALF_METATILE undone.
#defineFIELD_PIXEL_MASK 0xffff0000A 16.16 coordinate's whole pixels, its fraction cleared.
#defineFIELD_METATILE_ORIGIN (metatile) ((metatile) << FIELD_METATILE_SHIFT)The 16.16 coordinate of a map grid metatile's first pixel, FIELD_METATILE undone.
#defineFIELD_METATILE_CENTER (metatile)The 16.16 coordinate of the middle of a map grid metatile.

Variables

NameDescription
STATIC_ASSERT(offsetof (FIELD_COORDINATE, part[0].integer)

Description

FIELD_COORDINATE, a position on the field.

Macros in detail

MAPGRID_METATILE_PIXELS

#define MAPGRID_METATILE_PIXELS 16

A map grid metatile's side: each metatile is this many pixels square.

Referenced by fdActorGetCueMetatileAheadOfCurrent(), fdActorGetMetatileIndex(), fdActorResetForLeader(), fdActorSetMetatileShape(), fdActorSystemPlaceSprites(), fdBlankOverlayDrawMarks(), fdClimbUp(), fdFlagBlockPlaceAllMarkingEdges(), fdGetCollisionAheadOfLeader(), fdGetCollisionUnderLeader(), fdMapGridCheckCollision(), fdMapGridCheckCollisionAbove(), fdMapGridCheckCollisionAt(), fdMapGridGetMetatileAt(), fdMapGridGetTerrainHeight(), fdMapGridGetTerrainHeightAbove(), fdMapGridGetTerrainKind(), fdMapGridGetTerrainKindAt(), fdMapGridGetTerrainKindOrBumpAt(), fdMapGridIsWallAt(), fdMapGridLoadMap(), fdMapGridRenderMetatileTilesColumn(), fdMapGridSetCameraCenter(), fdPlaceAtEntrance(), fdPsynergyGatherNearbyMetatiles(), fdUpdateWalking(), scAnkohlRuinsPourSand(), scGabombaStatueMoveCharge(), scIsletsEnterDoor(), scIsletsOpenDoorAndEnter(), scLeaderCenterInMetatile(), scMadraCatacombsEnterDoor(), scMadraCatacombsOpenDoorAndEnter(), scProxClimbStairs(), scProxEnterDoor(), scPushTargetFindStop(), scShamanVillageEnterDoor(), scWorldMapGetMetatileIndex(), scYampiDesertCaveFindLogRoll(), scYampiDesertCaveScoopDjinni(), scYampiDesertCaveStopLeaderAtLog() and scYampiDesertMetatileCenter().

Definition at line 28 of file field_coordinate.h.

MAPGRID_METATILE_PIXEL_MASK

#define MAPGRID_METATILE_PIXEL_MASK 0xfff0

A whole pixel coordinate's map metatile, in pixels: the pixel coordinate of the metatile's first pixel.

Referenced by fdFadeOverlayDrawMarks().

Definition at line 31 of file field_coordinate.h.

FIELD_METATILE_MASK

#define FIELD_METATILE_MASK 0xfff00000

A 16.16 coordinate's whole metatile.

Referenced by fdActorJumpDownLedge(), fdActorMoveAsSand(), fdClimbDown(), fdClimbUp(), fdEntranceEndArrivalAnimation(), fdExitPrepareActorAnimation(), fdExitPrepareAnimation(), fdHangingVineHang(), fdItemDisplayShowItemInFront(), fdLeaderSlideOnIce(), fdLeaderSlideOnIceAhead(), fdLeaderStepOffRope(), fdLeaderStepOffTightrope(), fdMapGridIsWallAt(), fdPsynergyScoop(), fdPsynergySteerPushedTarget(), fdPsynergyWatchSandGround(), fdTryJumpForward(), KNOCK_BACK(), scAnemosInnerSanctumDropMimicStone(), scAnemosInnerSanctumDullahanOpenTheWay(), scAnemosInnerSanctumMimicLeader(), scAnemosInnerSanctumOpenMimicStoneDoor(), scFireballCarryLeader(), scIsletCaveRideLog(), scLeaderSlideOnIceFromEdge(), scMagmaRockInsideDrainLava(), scMagmaRockInsideLeapOverLava(), scMarsLighthouseEntranceRideFireball(), scMarsLighthouseTowersPushPipeOrJump(), scStoneHeadPlace() and scTaopoSwampStepIntoGust().

Definition at line 33 of file field_coordinate.h.

FIELD_METATILE_SHIFT

#define FIELD_METATILE_SHIFT 20

A 16.16 coordinate's shift to its map grid metatile: 16 bits of fraction and 4 of the metatile's MAPGRID_METATILE_PIXELS.

Definition at line 36 of file field_coordinate.h.

FIELD_METATILE

#define FIELD_METATILE(coordinate) ((coordinate) >> FIELD_METATILE_SHIFT)

The map grid metatile a 16.16 coordinate lies in, counted from 0 along its axis.

Referenced by fdActorFindAtMetatile(), fdActorUpdateAllOnField(), fdBlazeUpdateSpray(), fdCycloneCopyTouchedMetatiles(), fdHangingVineHang(), fdItemDisplayShowItemInFront(), fdMapGridCopyDrawnPicturesRect(), fdMapGridCopyMetatileTilesIndicesRect(), fdMapGridGetMetatileBehaviorAt(), fdMapGridSetMetatileBehaviorAt(), fdMapGridSetMetatileHeight(), fdMetatileTargetMetatileOf(), fdPlaceTreasureSpots(), fdRopeIsLeaderAtEnd(), fdTileCopiesCopyTouchedMetatiles(), fdTryJumpForward(), scActorFindInMetatile(), scActorRollAndCrumble(), scAirsRockBlowGust(), scAirsRockInsideBlowGust(), scAirsRockInsideFinishPushingPillar(), scAirsRockInsideMovePooledWhirlwind(), scAirsRockInsideMoveWhirlwind(), scAirsRockInsideOpenTabletRoomDoor(), scAirsRockInsideRestoreMetatileBehindLeader(), scAirsRockInsideRideWhirlwind(), scAirsRockInsideSetStakeMetatiles(), scAirsRockInsideStampMetatileUnderLeader(), scAirsRockInsideStampOtherMetatileUnderLeader(), scAirsRockInsideStampWideMetatileUnderLeader(), scAirsRockInsideStepOffVanishingStone(), scAirsRockInsideStepOntoStake(), scAirsRockMoveFirstPillar(), scAirsRockMoveSecondPillar(), scAirsRockMoveWhirlwind(), scAirsRockPlacePillar(), scAirsRockRideWhirlwind(), scAncientLemuriaFinishMovingStatue(), scAnemosInnerSanctumDullahanMoveBlock(), scAnemosInnerSanctumDullahanOpenTheWay(), scAnemosInnerSanctumLightPlate(), scAnemosInnerSanctumLightSymbol(), scAnemosInnerSanctumPressRoundSwitch(), scAnemosInnerSanctumRideLiftUp(), scAnkohlRuinsFinishMovingPillar(), scAnkohlRuinsFlowWithSand(), scAnkohlRuinsPlaceFaceHalves(), scAnkohlRuinsPlaceGreatFaceHalf(), scAnkohlRuinsPlaceSecondFloorFaceHalf(), scAnkohlRuinsPushFaceHalfIntoGap() and 233 more.

Definition at line 39 of file field_coordinate.h.

FIELD_HALF_METATILE

#define FIELD_HALF_METATILE(coordinate)

The half metatile, 8 pixels, a 16.16 coordinate lies in, counted from 0 along its axis.

Referenced by fdMapScreenDraw(), fdMapScreenUpdateScroll(), fdWhirlwindCarryLeader(), scAirsRockInsideBlowGust(), scAirsRockInsideFinishPushingPillar(), scAirsRockInsideMoveTurningBridgePillar(), scAirsRockInsidePuffVents(), scAirsRockInsideRideWhirlwind(), scAirsRockMoveThirdPillar(), scAirsRockRideWhirlwind(), scAirsRockSwirlDust(), scAnemosInnerSanctumFinishMovingBlock(), scGaiaRockFinishMovingPillar(), scGaiaRockInsideCycloneClearsCobweb(), scGaiaRockInsideReadSandTablet(), scGaiaRockInsideRecordStumpSpots(), scGaiaRockInsideTossCask(), scInit(), scIsletCaveTremorRevealsSerac(), scShamanVillageCaveEddyFlees(), scTreasureIsleSettleMovedPillar(), scTundariaTowerOpenDoor(), scTundariaTowerSetDownPillar(), scTundariaTowerSlidePillar(), scTundariaTowerUpdateBrownWallMetatile() and scWhirlwindCarryLeaderLower().

Definition at line 42 of file field_coordinate.h.

FIELD_HALF_METATILE_ORIGIN

#define FIELD_HALF_METATILE_ORIGIN(halfMetatile)

The 16.16 coordinate of a half metatile's first pixel, FIELD_HALF_METATILE undone.

Referenced by fdWhirlwindCarryLeader(), scAirsRockInsideBlowGust(), scAirsRockInsideRideWhirlwind(), scAirsRockRideWhirlwind(), scGaiaRockInsideStartPlatforms(), scInit(), scSeaOfTimePlaceRock(), scSeaOfTimeRaiseRock(), scTaopoSwampFocusMapOn(), scTundariaTowerSlidePillar(), scWhirlwindCarryLeaderLower(), scYampiDesertCaveMoveSandRipple() and scYampiDesertCaveScoopDjinni().

Definition at line 46 of file field_coordinate.h.

FIELD_PIXEL_MASK

#define FIELD_PIXEL_MASK 0xffff0000

A 16.16 coordinate's whole pixels, its fraction cleared.

Referenced by btGeyserDraw(), fdActorGetScreenPos(), fdActorGetSpriteDepth(), fdActorSystemPlaceSprites(), fdCameraWorldToScreen(), fdEffectSpawnRevealMarkers(), fdHangingVineDraw(), fdMapGridGetScreenRelativePos(), fdMapScreenUpdateMarkers(), fdRopeDraw(), fdScreenTransitionUpdateScanlineTable(), fdTightropeDraw(), scAnkohlRuinsDrawSand(), scApojiiIslandsDrawMetatileMarkers(), scAquaRockDrawFallingBubbles(), scAquaRockDrawRisingBubbles(), scAquaRockInsideDrawPillars(), scAquaRockInsideDrawSplashes(), scCrackedTileUpdate(), scFlameThrowersPuff(), scGabombaStatueDrawRaisedBlocks(), scLightSpritesDraw(), scMagmaRockInsidePushBlockOnto(), scMarsLighthouseEntranceDrawHoleMask(), scPushedActorAdvancePair(), scPushTargetFindStop(), scTrialRoadDrawFountains(), scTrialRoadMoveRival() and scYampiDesertCaveFindLogRoll().

Definition at line 49 of file field_coordinate.h.

FIELD_METATILE_ORIGIN

#define FIELD_METATILE_ORIGIN(metatile) ((metatile) << FIELD_METATILE_SHIFT)

The 16.16 coordinate of a map grid metatile's first pixel, FIELD_METATILE undone.

Referenced by fdCycloneCopyTouchedMetatiles(), fdParticleBurstStart(), fdPlaceAtEntrance(), fdPsynergyGatherNearbyMetatiles(), fdPsynergyRunTouchedScripts(), fdTileCopiesCopyTouchedMetatiles(), fdTileCopiesRestore(), scAirsRockInsideBlowGust(), scAirsRockInsideSetStakeMetatiles(), scAnemosInnerSanctumOpenMimicStoneDoor(), scAnemosInnerSanctumPressRoundSwitch(), scApojiiIslandsAddMetatileMarkers(), scAquaRockInsideAddSpouts(), scAquaRockInsideStartStream(), scCavernsFinishMovingAngaraBlock(), scCrackedTileUpdate(), scGabombaStatueSawEnergyFlow(), scGaiaRockInsideCycloneClearsCobweb(), scIzumoRuinsShowStakeState(), scMarsLighthouseEntranceDrawHoleMask(), scMarsLighthouseEntranceSetIceConeMetatiles(), scNorthernReachesShatterIceWall(), scSeaOfTimeFollowChannel(), scStoneHeadPlace(), scTreasureIsleRaiseSpikyRock(), scTundariaTowerJumpDownSlide() and scTundariaTowerSetColumnMetatile().

Definition at line 52 of file field_coordinate.h.

FIELD_METATILE_CENTER

#define FIELD_METATILE_CENTER(metatile)

The 16.16 coordinate of the middle of a map grid metatile.

Referenced by scActorRollAndCrumble(), scAquaRockInsideStartStream(), scCrackedTilePlaceLanding(), scGabombaStatueMoveCharge(), scGabombaStatueSawEnergyFlow(), scGabombaStatueSetBlocksRaised(), scInit(), scJupiterLighthouseThrowOutBlock(), scLeaderCenterInMetatile(), scShamanVillageSetUpNorthEnd(), scTreasureIsleRaiseSpikyRock() and scTrialRoadPushLog().

Definition at line 54 of file field_coordinate.h.

Variables in detail

offsetof

STATIC_ASSERT(offsetof(FIELD_COORDINATE, part[0].integer)

Definition at line 25 of file field_coordinate.h.