Skip to Content
The Alchemy Project

include/field/weather.h

The ground particles and the rain that the weather state holds.

Included by script_commands_internal.h, script_commands_weather.c and dust.h.

Structures

NameDescription
structWEATHER_PARTICLEA ground particle: an OAM entry linked by depth, its place (16.16 pixels), its delay and its tick count.
structWEATHER_STATEThe heap slot weather while the ground particles run: their tiles' VRAM cache entry and first tile, and the particles.

Macros

NameDescription
#defineGROUND_PARTICLE_FREED 65535WEATHER_PARTICLE.timer after the decrement that counts a live particle down, when it was already free (0): the Uint16 wraps.
#defineRAIN_SPLASH_FRAMES 16The frames of a ground particle's splash (WeatherRainSplashFrames, or a scene's own GroundParticleFrames, five halfwords each), played from the last down to the first.
#defineWEATHER_PARTICLE_COUNT 64WEATHER_STATE.particles.
#defineRAIN_DROP_TICKS 12A raindrop's frames (fdWeatherUpdateRain).

Functions

NameDescription
voidfdGroundParticlesUpdate (void)The weather and the ground's particles, each tick.
voidfdMotesUpdate (void)Event of fdMotesStart: moves and draws the 64 motes in HEAP_SLOT_WEATHER.
voidfdWeatherUpdateRain (void)This game's rain each tick (fdWeatherStartRain), outside Mars Lighthouse and on its ledges: each of the 64 streaks falls down and to the right onto a spot on the ground, a pair of WeatherRainStreakOffsets a tick, and then starts again 12 ticks up from a random spot (x within -64 to +192, z within -128 to +128 pixels of the map's focus).

Description

The ground particles and the rain that the weather state holds.

Macros in detail

GROUND_PARTICLE_FREED

#define GROUND_PARTICLE_FREED 65535

WEATHER_PARTICLE.timer after the decrement that counts a live particle down, when it was already free (0): the Uint16 wraps.

Referenced by fdGroundParticlesDraw(), fdGroundParticlesUpdate(), fdMotesUpdate() and fdWeatherUpdateRain().

Definition at line 39 of file weather.h.

RAIN_SPLASH_FRAMES

#define RAIN_SPLASH_FRAMES 16

The frames of a ground particle's splash (WeatherRainSplashFrames, or a scene's own GroundParticleFrames, five halfwords each), played from the last down to the first.

Referenced by fdGroundParticlesStart() and fdGroundParticlesUpdate().

Definition at line 43 of file weather.h.

WEATHER_PARTICLE_COUNT

#define WEATHER_PARTICLE_COUNT 64

WEATHER_STATE.particles.

Referenced by fdEffectInitSparkles(), fdEffectUpdateSparkles(), fdGroundParticlesStart(), fdGroundParticlesUpdate(), fdMotesStart(), fdMotesUpdate(), fdWeatherStartRain() and fdWeatherUpdateRain().

Definition at line 46 of file weather.h.

RAIN_DROP_TICKS

#define RAIN_DROP_TICKS 12

A raindrop's frames (fdWeatherUpdateRain).

Definition at line 48 of file weather.h.