Skip to Content
The Alchemy Project

include/field/facing.h

The constant tables of facing.c: which picture of an animation an actor shows for each way it faces, the fixed camera's matrix, the actor scripts for footprints, splashes, ripples, wakes and sand grains, the World Map camera's lean for the direction pad, and the World Map's graphics sets.

Included by facing.c, field_internal.h, field_psynergy_internal.h and field_sprite_draw.c.

Macros

NameDescription
#defineFACING_MIRRORED_BIT 0x80A facing table entry: the picture to draw, counted from the sprite animation's base picture (bits 0-2), mirrored when bit 7 is set.
#defineMIRRORED (picture) (FACING_MIRRORED_BIT | (picture))
#defineWORLD_MAP_KEY_HEADING_NONE 65535WorldMapKeyHeadings' entry when no direction is held, or only an opposite pair: no heading, since every real one is a multiple of an eighth turn.

Variables

NameDescription
extern const Uint8AnimationFacingOnePicture [16]The facing tables: the picture each heading draws, by how many pictures a sprite animation has for its facings.
extern const Uint8AnimationFacingFrontBackSwapped [8]ANIM_FACING_FRONT_BACK_SWAPPED's table: a front and a back picture, the front mirrored the other way.
extern const Uint8AnimationFacingFrontBack [8]ANIM_FACING_FRONT_BACK's table: a front and a back picture.
extern const Uint8AnimationFacingThreePictures [16]ANIM_FACING_THREE_PICTURES's table: front, side and back.
extern const Uint8AnimationFacingFivePictures [64]ANIM_FACING_FIVE_PICTURES's table: five pictures over 64 sectors, where The Broken Seal's has 16.
extern const Uint8AnimationFacingEightPictures [8]ANIM_FACING_EIGHT_PICTURES's table: a picture for each compass direction.
extern const FIXEDActorSpriteFullScale [2]An actor sprite's scale at full size, across and down.
extern const FIXEDCameraFixedViewMatrix [12]The fixed camera's view matrix (16.16): identity with a -0.8 shear of y by x.
extern const Sint32ActorFootprintScript []A footprint's script: it lasts 120 ticks and is released.
extern const Sint32ActorSplashScript []A splash's script: it lasts 20 ticks and is released.
extern const Sint32ActorRippleScript []A ripple's script: it lasts 32 ticks and is released.
extern const Sint32WorldMapKeyYaws [16]The yaw the World Map camera leans to for each state of the direction pad: a 128th of a turn for Right or Left, three quarters of that with Up or Down but not both; none otherwise.
extern const Sint32ActorSandPuffScript []A puff of sand the leader leaves behind as he moves as Sand (SPRITE_SAND_PUFF): its sceneByte counts down from 15 by one every 5 ticks, thirteen times, then the puff shrinks to nothing and goes.
extern const Sint32SandGrainScript []A grain of sand the leader drops as he moves as Sand: it lasts 60 ticks and is released.
extern const Uint32WorldMapGraphicsResources [4][9]The World Map's graphics in four sets, by resource id: each a palette, its tile animation, its metatiles' tiles and attributes, and six tile sets; fdWorldMapPreloadCurrentTileBlock chooses one by the region the party is in.

Description

The constant tables of facing.c: which picture of an animation an actor shows for each way it faces, the fixed camera's matrix, the actor scripts for footprints, splashes, ripples, wakes and sand grains, the World Map camera's lean for the direction pad, and the World Map's graphics sets.

Macros in detail

FACING_MIRRORED_BIT

#define FACING_MIRRORED_BIT 0x80

A facing table entry: the picture to draw, counted from the sprite animation's base picture (bits 0-2), mirrored when bit 7 is set.

Definition at line 14 of file facing.h.

MIRRORED

#define MIRRORED(picture) (FACING_MIRRORED_BIT | (picture))

Referenced by AnimationFacingFivePictures, AnimationFacingFivePicturesUnused, AnimationFacingFrontBack, AnimationFacingFrontBackSwapped, AnimationFacingOnePicture and AnimationFacingThreePictures.

Definition at line 15 of file facing.h.

WORLD_MAP_KEY_HEADING_NONE

#define WORLD_MAP_KEY_HEADING_NONE 65535

WorldMapKeyHeadings' entry when no direction is held, or only an opposite pair: no heading, since every real one is a multiple of an eighth turn.

Referenced by fdActorCrossRope(), fdActorCrossTightrope(), fdActorFlyOnWorldMap(), fdActorMoveAsSand(), fdActorMoveAsSandOnWorldMap(), fdActorMoveByKeys(), fdActorMoveOnWorldMap(), fdActorSailOnMap(), fdActorSailOnWorldMap(), fdActorUpdateHoverControl(), fdActorUpdatePlayerControl(), fdActorUpdateWalkingControl(), fdMapScreenUpdateMarkers() and WorldMapKeyHeadings.

Definition at line 18 of file facing.h.