Skip to Content
The Alchemy Project

include/field/particle.h

A particle's position and the screen points the effects draw at.

Included by battle_internal.h, battle_effect_internal.h, battle_effect_state.h, battle_effect.h, field.h, lucky_wheels.h and falling_rocks.h.

Structures

NameDescription
structPARTICLEA moving point of an effect: its position, its velocity and a value each effect uses its own way.
structSCREEN_POINTA point projected onto the screen, with its depth.

Functions

NameDescription
static inline const Sint32 *btParticleCoordinates (const PARTICLE *step)Returns the step's three coordinates as an array.
static inline Sint32 *fdScreenPointCoordinates (SCREEN_POINT *pos)Returns the position's three coordinates as an array.
voidbtEffectPosAdvanceWithGravity3D (PARTICLE *step, Sint32 damping, Sint32 gravity)Unused: moves a particle one tick in three dimensions, as btParticleAdvanceWithGravity3D does, which the effects call; nothing calls this copy.
Sint32btEffectPosProjectPoint (const void *point, SCREEN_POINT *pos)Projects a 16.16 point onto the screen through the current transform, 16 pixels higher; returns syConvert3Dto2D's result.
voidbtEffectPosProjectScaledBattler (Sint32 id, SCREEN_POINT *pos)Projects a unit's place onto the screen at its scale, 16 pixels higher.

Description

A particle's position and the screen points the effects draw at.

Functions in detail

btParticleCoordinates

static inline const Sint32 *btParticleCoordinates(const PARTICLE *step)

Returns the step's three coordinates as an array. UB: indexing from &x crosses the step's separate scalar members. UBFIX supplies a real coordinate array without including motion state.

References Sint32.

Referenced by btEffectRunAstralBlast().

Definition at line 41 of file particle.h.

fdScreenPointCoordinates

static inline Sint32 *fdScreenPointCoordinates(SCREEN_POINT *pos)

Returns the position's three coordinates as an array. UB: indexing from &x crosses separate scalar members in the legacy record. UBFIX provides a real array while keeping the effects' named coordinates. An always-on union changes native alias analysis in the effect/window code.

References Sint32.

Referenced by btEffectPosProjectBattler(), btEffectPosProjectPoint(), btEffectPosProjectScaledBattler(), btEffectPosProjectSprite(), btEffectRunCoatlicue(), btEffectRunStarfieldFall() and btEffectRunWaterSheet().

Definition at line 77 of file particle.h.