Skip to Content
The Alchemy Project

src/scene/shared/sol_sanctum_elemental_star_lights.c

Sol Sanctum's Elemental Star room and its eruption: the ten lights that float in the room, actors in a row from the first the map passes, each pulsing and drifting on its own path, read by its index from the tables of sol_sanctum_elemental_star_light_tables.c: SolSanctumLightDrift, SolSanctumLightSwing, SolSanctumLightDirection, SolSanctumLightMaxScales and SolSanctumLightScaleSteps.

Included by sol_sanctum_elemental_star_room.c and sol_sanctum_eruption.c.

Structures

NameDescription
structSOL_SANCTUM_LIGHT_ENTRYOne floating light: its actor, its drift and its pulsing scale, and where it is while hidden.
structSOL_SANCTUM_LIGHT_LISTThe floating lights' state in HEAP_SLOT_SOL_SANCTUM_LIGHTS, one entry per light.

Macros

NameDescription
#defineSOL_SANCTUM_LIGHT_STEP_TICKS 3A light moves every this many ticks.
#defineSOL_SANCTUM_LIGHT_HIDDEN_STEPS 24Shrunk to a tenth, a light is hidden for this many of its steps while it drifts on unseen, then shows again where it has drifted to.

Enumerations

NameDescription
enumanonymous enum { SOL_SANCTUM_LIGHT_MAX }The most lights the event keeps.

Functions

NameDescription
static voidscSolSanctumUpdateFloatingLights (void)An event: every SOL_SANCTUM_LIGHT_STEP_TICKS each light pulses between a tenth of its size and its largest scale and drifts, swinging about on a sine of its drift speed on each axis it drifts on.
voidscSolSanctumStartFloatingLights (Sint32 first, Uint32 count)Starts the floating lights: count actors (at most SOL_SANCTUM_LIGHT_MAX) from first, each drawn translucent and starting at its largest scale.

Description

Sol Sanctum's Elemental Star room and its eruption: the ten lights that float in the room, actors in a row from the first the map passes, each pulsing and drifting on its own path, read by its index from the tables of sol_sanctum_elemental_star_light_tables.c: SolSanctumLightDrift, SolSanctumLightSwing, SolSanctumLightDirection, SolSanctumLightMaxScales and SolSanctumLightScaleSteps.

Macros in detail

SOL_SANCTUM_LIGHT_STEP_TICKS

#define SOL_SANCTUM_LIGHT_STEP_TICKS 3

A light moves every this many ticks.

Referenced by scSolSanctumStartFloatingLights() and scSolSanctumUpdateFloatingLights().

Definition at line 17 of file sol_sanctum_elemental_star_lights.c.

SOL_SANCTUM_LIGHT_HIDDEN_STEPS

#define SOL_SANCTUM_LIGHT_HIDDEN_STEPS 24

Shrunk to a tenth, a light is hidden for this many of its steps while it drifts on unseen, then shows again where it has drifted to.

Referenced by scSolSanctumUpdateFloatingLights().

Definition at line 20 of file sol_sanctum_elemental_star_lights.c.

Enumerations in detail

anonymous enum

enum { SOL_SANCTUM_LIGHT_MAX }

The most lights the event keeps.

EnumeratorValueDescription
SOL_SANCTUM_LIGHT_MAX10

Definition at line 11 of file sol_sanctum_elemental_star_lights.c.

Functions in detail

scSolSanctumUpdateFloatingLights

static void scSolSanctumUpdateFloatingLights(void)

An event: every SOL_SANCTUM_LIGHT_STEP_TICKS each light pulses between a tenth of its size and its largest scale and drifts, swinging about on a sine of its drift speed on each axis it drifts on.

References Sint32, SolSanctumLightDirection, SolSanctumLightDrift, SolSanctumLightMaxScales, SolSanctumLightScaleSteps, SolSanctumLightSwing, syCos(), syHeapSlotAllocateEWRAM() and sySin().

Referenced by scSolSanctumStartFloatingLights().

Definition at line 53 of file sol_sanctum_elemental_star_lights.c.

scSolSanctumStartFloatingLights

void scSolSanctumStartFloatingLights(Sint32 first, Uint32 count)

Starts the floating lights: count actors (at most SOL_SANCTUM_LIGHT_MAX) from first, each drawn translucent and starting at its largest scale.

References fdActorGetById(), fdActorSetBlendMode(), scSolSanctumUpdateFloatingLights(), Sint32, SolSanctumLightMaxScales, SolSanctumLightScaleSteps, syHeapSlotAllocateEWRAM() and sySetTickEvent().

Referenced by scInit().

Definition at line 195 of file sol_sanctum_elemental_star_lights.c.