Skip to Content
The Alchemy Project

src/field/field_actor_camera.c

The actor camera: placing every actor's sprites on screen each tick under the scrolling or the fixed camera. More…

Included by field.c.

Macros

NameDescription
#defineMETATILE_PRIORITY (metatiles, x, z)The sprite priority an actor takes on the metatile under a point.
#defineMETATILE_LAYER (metatiles, x, z)The map layer an actor takes on the metatile under a point, plus one.

Functions

NameDescription
voidfdActorSystemPlaceSprites (void)Each tick, with the scrolling camera: places every actor's sprite on the screen.
Sint32fdActorCameraReturnTrue (void)Unused: returns 1.
voidfdActorPlaceSprites (ACTOR *actor, Sint32 angle)Places an actor's sprite (unless ACTOR_PRIORITY_NOT_DRAWN hides it) or each of its group's four sprites, turned by angle.
voidfdActorSystemProjectSprites (void)Each tick, with the fixed camera: places every actor in use, from the 64th down.

Description

The actor camera: placing every actor's sprites on screen each tick under the scrolling or the fixed camera. Part of field.c.

Macros in detail

METATILE_PRIORITY

#define METATILE_PRIORITY(metatiles, x, z)

The sprite priority an actor takes on the metatile under a point.

Referenced by fdActorSystemPlaceSprites().

Definition at line 5 of file field_actor_camera.c.

METATILE_LAYER

#define METATILE_LAYER(metatiles, x, z)

The map layer an actor takes on the metatile under a point, plus one.

Referenced by fdActorSystemPlaceSprites().

Definition at line 8 of file field_actor_camera.c.

Functions in detail

fdActorSystemPlaceSprites

void fdActorSystemPlaceSprites(void)

Each tick, with the scrolling camera: places every actor's sprite on the screen.

References fdMapGridGetTerrainHeight(), fdMapStateView(), fdRenderApplyProjectedPlacement(), fdRenderApplyProjectedPlacementAtDepth(), fdSpriteComposePicture(), Sint32, syHeapSlotRelease(), sySpritePlacementValues() and syVRAMCacheReleaseVRAM().

Referenced by fdActorSystemInit(), fdActorSystemResumeProjectionAndHideLayers() and fdActorSystemSuspendProjectionAndShowSprites().

Definition at line 13 of file field_actor_camera.c.

fdActorCameraReturnTrue

Sint32 fdActorCameraReturnTrue(void)

Unused: returns 1.

References Sint32.

Definition at line 286 of file field_actor_camera.c.

fdActorPlaceSprites

void fdActorPlaceSprites(ACTOR *actor, Sint32 angle)

Places an actor's sprite (unless ACTOR_PRIORITY_NOT_DRAWN hides it) or each of its group's four sprites, turned by angle. While battle commands are chosen (FLAG_CHOOSING_COMMANDS) the sprites are drawn at 1.0 scale.

References ActorSpriteFullScale, fdRenderPlaceProjectedSprite(), Sint32 and syGameFlagGet().

Referenced by fdActorSystemProjectSprites().

Definition at line 294 of file field_actor_camera.c.

fdActorSystemProjectSprites

void fdActorSystemProjectSprites(void)

Each tick, with the fixed camera: places every actor in use, from the 64th down. While battle commands are chosen (FLAG_CHOOSING_COMMANDS) it uses the fixed view matrix and turns the actors by an eighth of a turn less.

References CameraFixedViewMatrix, fdActorPlaceSprites(), Sint32, syAtan(), syGameFlagGet(), syHeapSlotRelease(), syInitMatrix(), syLookAt(), syLookAtLoad() and syMatrixRewindStack().

Referenced by fdActorSystemInit(), fdActorSystemResumeProjectionAndHideLayers() and fdActorSystemSuspendProjectionAndShowSprites().

Definition at line 333 of file field_actor_camera.c.