Skip to Content
The Alchemy Project

include/scene/pushed_actor.h

The pushed actors' movement probes and rectangles.

Included by bilibin.c, bilibin_cave.c, colosseum_azart_match.c, colosseum_navampa_match.c, colosseum_satrage_match.c, kalay.c, ship_rooms.c, sol_sanctum_entrance.c and actor_step.h.

Structures

NameDescription
structPUSHED_ACTOR_PROBEWhere a pushed actor ahead of the leader would roll to: its rectangle, its actor, that position, and a function run during the leader's follow-through.
structPUSHED_ACTOR_RECTANGLEA large thing's edges, a row of PushedActorRectangles.

Macros

NameDescription
#defineDIRECTION_STEP (dx, dz) (((Uint32)(dx) << 16) | ((Uint32)(dz) & 0xffff))A pixel step packed as one word: X in the upper halfword, Z in the lower.
#defineDIRECTION_STEP_X (step) ((Sint32)(step) >> 16)A DIRECTION_STEP's X, in pixels.
#defineDIRECTION_STEP_Z (step) ((Sint16)(step))A DIRECTION_STEP's Z, in pixels.
#defineDIRECTION_STEP_X_FIXED (step) ((step) & 0xffff0000)A DIRECTION_STEP's X as a 16.16 offset: its upper halfword, kept in place.
#defineDIRECTION_STEP_Z_FIXED (step) INTtoFIXED(step)A DIRECTION_STEP's Z as a 16.16 offset: its lower halfword, shifted up.
#definePUSHED_ACTOR_NO_RECTANGLE 7PUSHED_ACTOR_PROBE.rectangleIndex of an actor whose sprite is none of the six large things, past their rows.

Variables

NameDescription
STATIC_ASSERT(offsetof (PUSHED_ACTOR_PROBE, pos.x)
extern Sint32PushedActorDirectionSteps []The pixel step of each direction, X in the upper halfword and Z in the lower (DIRECTION_STEP); each scene that pushes a large thing includes it (shared/pushed_actor_direction_steps.c).

Description

The pushed actors' movement probes and rectangles.

Macros in detail

DIRECTION_STEP

#define DIRECTION_STEP(dx, dz) (((Uint32)(dx) << 16) | ((Uint32)(dz) & 0xffff))

A pixel step packed as one word: X in the upper halfword, Z in the lower. Packed through Uint32, so a negative step is its two's-complement bits.

Referenced by PushedActorDirectionSteps.

Definition at line 13 of file pushed_actor.h.

DIRECTION_STEP_X

#define DIRECTION_STEP_X(step) ((Sint32)(step) >> 16)

A DIRECTION_STEP's X, in pixels.

Referenced by scKalayPushTunnelStatue(), scPushedActorRoll(), scShipRoomsIsSpotFree() and scShipRoomsStepBesideLeader().

Definition at line 15 of file pushed_actor.h.

DIRECTION_STEP_Z

#define DIRECTION_STEP_Z(step) ((Sint16)(step))

A DIRECTION_STEP's Z, in pixels.

Referenced by scKalayPushTunnelStatue(), scPushedActorRoll(), scShipRoomsIsSpotFree() and scShipRoomsStepBesideLeader().

Definition at line 17 of file pushed_actor.h.

DIRECTION_STEP_X_FIXED

#define DIRECTION_STEP_X_FIXED(step) ((step) & 0xffff0000)

A DIRECTION_STEP's X as a 16.16 offset: its upper halfword, kept in place.

Referenced by fdActorStepFrom(), scBabiLighthouseFindMetatileAhead(), scColossoPushActorAhead() and scPushedActorFindClearPos().

Definition at line 19 of file pushed_actor.h.

DIRECTION_STEP_Z_FIXED

#define DIRECTION_STEP_Z_FIXED(step) INTtoFIXED(step)

A DIRECTION_STEP's Z as a 16.16 offset: its lower halfword, shifted up.

Referenced by fdActorStepFrom(), scBabiLighthouseFindMetatileAhead(), scColossoPushActorAhead() and scPushedActorFindClearPos().

Definition at line 21 of file pushed_actor.h.

PUSHED_ACTOR_NO_RECTANGLE

#define PUSHED_ACTOR_NO_RECTANGLE 7

PUSHED_ACTOR_PROBE.rectangleIndex of an actor whose sprite is none of the six large things, past their rows.

Referenced by scCrossboneIsleSteppingStonesQueryCoveredMetatiles() and scPushedActorBlockFootprint().

Definition at line 25 of file pushed_actor.h.

Variables in detail

offsetof

STATIC_ASSERT(offsetof(PUSHED_ACTOR_PROBE, pos.x)

STATIC_ASSERT(offsetof(PUSHED_ACTOR_PROBE, pos.z)

Definition at lines 51 and 52 of file pushed_actor.h.