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, and beside them the sprite dissolve's pixel order, the fixed camera's matrix, a floating actor's bob, the actor scripts' end script and the World Map camera's lean for the direction pad.

Included by facing.c, field_internal.h, imil.c, imil_fuchin_falls.c, mercury_lighthouse.c and mercury_lighthouse_entrance.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))
#defineKEY_HEADING_NONE (-1)A scene's key-heading table entry when no direction is held, or only an opposite pair, where the others are facings.
#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]Facing tables: for each ANIMATION_FACING_KIND, the picture to draw for each sector of the facing angle.
extern const Uint8AnimationFacingFrontBackSwapped [8]
extern const Uint8AnimationFacingFrontBack [8]
extern const Uint8AnimationFacingThreePictures [16]
extern const Uint8AnimationFacingFivePictures [16]
extern const Uint8AnimationFacingEightPictures [8]
extern const Uint8AnimationFacingEightPicturesMirrored [8]
extern const Uint8AnimationFacingFourPictures [64]
extern const Uint8AnimationFacingSixPictures [64]
extern const Uint8SpriteDissolvePixelOrder [64]The order in which the 64 pixels of a sprite's tile in OBJ VRAM dissolve; read by fdSpriteDissolveStep (field_actors.c).
extern const Uint16SpriteDissolvePixelOrderTailTwo bytes after the dissolve order; no code in The Broken Seal names them.
extern const FIXEDCameraFixedViewMatrix [12]The fixed camera's view matrix (16.16): identity with a -0.8 shear of y by x.
extern const Sint32ActorScriptCycleTable [32]One period of a triangle wave, which bobs a floating actor up and down.
extern const Sint32ActorScriptEndScript [1]The idle script an actor returns to when its own one ends: a lone SC_END, which reloads it.
extern const Sint16ActorScriptEndScriptTail [8]Halfwords that follow the idle script; no code in The Broken Seal names them.
extern const Sint32WorldMapKeyYaws [16]The yaw the World Map camera leans to for each state of the direction pad, in 1/65536 turns: Right -512 and Left 512, or -384 and 384 with Up or Down but not both; 0 otherwise.

Description

The constant tables of facing.c: which picture of an animation an actor shows for each way it faces, and beside them the sprite dissolve's pixel order, the fixed camera's matrix, a floating actor's bob, the actor scripts' end script and the World Map camera's lean for the direction pad.

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.

Referenced by fdSpriteComposePicture().

Definition at line 33 of file facing.h.

MIRRORED

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

Referenced by AnimationFacingEightPicturesMirrored, AnimationFacingFivePictures, AnimationFacingFourPictures, AnimationFacingFrontBack, AnimationFacingFrontBackSwapped, AnimationFacingOnePicture, AnimationFacingSixPictures and AnimationFacingThreePictures.

Definition at line 34 of file facing.h.

KEY_HEADING_NONE

#define KEY_HEADING_NONE (-1)

A scene's key-heading table entry when no direction is held, or only an opposite pair, where the others are facings.

Referenced by IceKeyHeadings, ImilFuchinFallsSlideHeadings, ImilSlideHeadings, MercuryLighthouseMoveAngles, scActorSteerByPad() and scLeaderSlideOnIce().

Definition at line 38 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 fdActorMoveByKeys(), fdActorMoveOnWorldMap(), fdActorUpdatePlayerControl() and WorldMapKeyHeadings.

Definition at line 42 of file facing.h.