src/field/script_commands_ground_particles.c
The ground particles, the rising particles and the floating motes. More…
Included by script_commands.c.
Macros
| Name | Description | |
|---|---|---|
#define | MOTE_PICTURE_TILES SPRITE_TILES(16, 16) | mote.png's six pictures, four tiles each: two of each size, the motes shrinking as they rise and flickering between the two. |
#define | MOTE_LARGE 0 | |
#define | MOTE_MEDIUM 2 | |
#define | MOTE_SMALL 4 |
Functions
| Name | Description | |
|---|---|---|
void | fdGroundParticlesStart (void) | Unused: nothing calls it, nor its stub call in engine_stubs.s. |
void | fdRisingParticlesUpdate (void) | Event of fdRisingParticlesStart: updates the 64 rising particles; each starts on the ground at a random point of the strip for 120 ticks, drifts right by a random amount each tick, rises with its age, and is drawn at priority 3, its tile stepping back by 8 at 90 and 60 ticks left and flickering between two tiles every 8 ticks. |
void | fdRisingParticlesStart (void) | Starts the rising particles, as the Northern Reaches does: allocates and clears heap slot HEAP_SLOT_WEATHER, decodes the particle tiles into VRAM, sets each of the 64 particles' sprite words and places it on the ground at a random point of the strip (x 288 to 488 pixels, z 60 to 80), staggering their timers by 2 ticks, and schedules the update. |
void | fdMotesUpdate (void) | Event of fdMotesStart: moves and draws the 64 motes in HEAP_SLOT_WEATHER. |
Description
The ground particles, the rising particles and the floating motes. Part of
script_commands.c.
Macros in detail
MOTE_PICTURE_TILES
#define MOTE_PICTURE_TILES SPRITE_TILES(16, 16)
mote.png's six pictures, four tiles each: two of each size, the motes
shrinking as they rise and flickering between the two.
Referenced by fdMotesUpdate() and fdRisingParticlesUpdate().
Definition at line 6 of file script_commands_ground_particles.c.
MOTE_LARGE
#define MOTE_LARGE 0
Referenced by fdMotesUpdate() and fdRisingParticlesUpdate().
Definition at line 7 of file script_commands_ground_particles.c.
MOTE_MEDIUM
#define MOTE_MEDIUM 2
Referenced by fdMotesUpdate() and fdRisingParticlesUpdate().
Definition at line 8 of file script_commands_ground_particles.c.
MOTE_SMALL
#define MOTE_SMALL 4
Referenced by fdMotesUpdate() and fdRisingParticlesUpdate().
Definition at line 9 of file script_commands_ground_particles.c.
Functions in detail
fdGroundParticlesStart
void fdGroundParticlesStart(void)
Unused: nothing calls it, nor its stub call in engine_stubs.s. The Broken
Seal's rain, kept whole where this game has its own fdWeatherStartRain: 64
sprites placed at the leader's position on the terrain, their tiles decoded
into VRAM, the blend set, and fdGroundParticlesUpdate scheduled to move them.
References fdGroundParticlesUpdate(), fdMapGridGetTerrainHeightStub(), fdQueueMusic(), Sint32, syDecompressByteLZ(), syHeapSlotAllocateEWRAM(), syHeapSlotRelease(), sySetEvent(), syVRAMCacheFindFreeEntry(), syVRAMCacheLoad() and WeatherParticleTiles.
Referenced by scApojiiIslandsDouseAquaStone() and scInit().
Definition at line 15 of file script_commands_ground_particles.c.
fdRisingParticlesUpdate
void fdRisingParticlesUpdate(void)
Event of fdRisingParticlesStart: updates the 64 rising particles; each starts
on the ground at a random point of the strip for 120 ticks, drifts right by a
random amount each tick, rises with its age, and is drawn at priority 3, its
tile stepping back by 8 at 90 and 60 ticks left and flickering between two
tiles every 8 ticks.
References fdCameraWorldToScreen(), fdMapGridGetTerrainHeightStub(), Sint32, syOAMAddSpriteAtDepthClamped(), syRandom() and TickCount.
Referenced by fdRisingParticlesStart().
Definition at line 65 of file script_commands_ground_particles.c.
fdRisingParticlesStart
void fdRisingParticlesStart(void)
Starts the rising particles, as the Northern Reaches does: allocates and
clears heap slot HEAP_SLOT_WEATHER, decodes the particle tiles into VRAM,
sets each of the 64 particles' sprite words and places it on the ground at a
random point of the strip (x 288 to 488 pixels, z 60 to 80), staggering their
timers by 2 ticks, and schedules the update.
References fdMapGridGetTerrainHeightStub(), fdRisingParticlesUpdate(), FieldEffectMoteTiles, Sint32, syDecompressByteLZ(), syHeapSlotAllocateEWRAM(), syHeapSlotRelease(), syRandom(), sySetEvent(), syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().
Referenced by scInit().
Definition at line 125 of file script_commands_ground_particles.c.
fdMotesUpdate
void fdMotesUpdate(void)
Event of fdMotesStart: moves and draws the 64 motes in HEAP_SLOT_WEATHER. Up
to eight a tick start within 128 pixels of the point the view follows and
live 120 ticks, rising, shrinking at 90 and 60 ticks left and flickering
every 8 ticks; FLAG_WEATHER_HELD holds them where they are.
References fdMapGridGetTerrainHeightStub(), fdMapStateView(), Sint32, syGameFlagGet(), syOAMAddSpriteAtDepthClamped(), syRandom() and TickCount.
Referenced by fdMotesStart().
Definition at line 169 of file script_commands_ground_particles.c.