coastline 0.0.4
Loading...
Searching...
No Matches
weather.h
Go to the documentation of this file.
1#ifndef COASTLINE_WEATHER_H
2#define COASTLINE_WEATHER_H
3
8
9#include "common/types.h"
10#include "common/vecmath.h"
11
12#if TGR_BOSS_RALLY
13#include "common/hudassets.h"
14#endif
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
21enum {
27};
28
40
52
63extern u32 g_dwNightMode;
64
75extern u32 g_dwSnowMode;
76
87extern u32 g_dwRainMode;
88
99extern u8 g_bFogR;
100
111extern u8 g_bFogG;
112
123extern u8 g_bFogB;
124
135extern u8 g_bFogIntensity;
136
149
151#define WEATHER_VIEWS 2
152
154#define RAIN_PARTICLES 512
155
157#define RAIN_PARTICLE_SLOTS 522
158
160#define RAIN_STREAK_TEXTURE_SIDE 64
161
163#define PARTICLE_SCALE 6.10370189e-05f
165#define PARTICLE_NEAR 0.1f
166
167#if TGR_BRD3D
169#define RAIN_STREAK_TEXTURE_BYTES_PER_TEXEL 4
170#else
172#define RAIN_STREAK_TEXTURE_BYTES_PER_TEXEL 1
173#endif
174
176#define LIGHTNING_BOLT_POINTS 459
177
189
200extern f32 g_fWindAngle;
201
212extern f32 g_fWindStrength;
213
214#if !TGR_BOSS_RALLY
226#endif /* !TGR_BOSS_RALLY */
227
228#if !TGR_BOSS_RALLY
240#endif /* !TGR_BOSS_RALLY */
241
251
252#if !TGR_BOSS_RALLY
264#endif /* !TGR_BOSS_RALLY */
265
266#if !TGR_BOSS_RALLY
278#endif /* !TGR_BOSS_RALLY */
279
290#if TGR_BOSS_RALLY
291/* The PC release keeps the texture in the storage of the shadow of the HUD, under both names. */
292#define g_aParticleTexture g_abHudOverlayTextureData
293#else
294extern u8 g_aParticleTexture[];
295#endif
296
298#define PARTICLE_TEXTURE_LAST_T (63 << 5)
300#define PARTICLE_TEXTURE_STEPS (63 << 12)
301
302/* The load of the particle texture. */
303#define PARTICLE_LOAD_TEXELS 2047
304#define PARTICLE_LOAD_DXT 0x100
305
317
329
341
353
365
379
391
403
416
428
438
450
462
463#ifdef __cplusplus
464}
465#endif
466
467#endif /* COASTLINE_WEATHER_H */
A point or direction in space.
Definition vecmath.h:17
The integer and floating-point types of the console, for headers shared with Windows.
unsigned int u32
Definition ultratypes.h:20
short s16
Definition ultratypes.h:24
float f32
Definition ultratypes.h:38
int s32
Definition ultratypes.h:25
unsigned char u8
Definition ultratypes.h:18
The vector and matrix arithmetic of the game, its arctangent and power, the triangle and segment test...
void RenderPrecipitationEffect(void)
Draw the rain or snow of the current view, unless a placed model shelters the camera.
u8 g_bFogIntensity
How far the fog colour covers the sky.
f32 g_fLightningFlashTimer
The time since the last strike, in 343 units a second.
Vec3f g_vWindVelocity
How far the wind moves things in a frame.
void UpdateLightningFlash(void)
Count down the flash of a strike, and strike at random when the last strike is long enough ago.
u8 g_abPrecipitationTextures[WEATHER_VIEWS][RAIN_STREAK_TEXTURE_SIDE *RAIN_STREAK_TEXTURE_SIDE *RAIN_STREAK_TEXTURE_BYTES_PER_TEXEL]
The texture of the rain streaks of each view, drawn along the fall of the rain.
#define RAIN_STREAK_TEXTURE_SIDE
The side of the texture of the rain streaks, in texels.
Definition weather.h:160
Vec3f g_avRainPrevCameraPos[WEATHER_VIEWS]
The point ahead of the camera of each view last frame.
Vec3f g_avLightningBolt[LIGHTNING_BOLT_POINTS]
The points of the lightning bolt.
s32 g_dwLightningFlashCounter
The frames of lightning left, during which the sky flashes on the odd ones.
s32 g_nLightningBoltDepth
Four times the depth of the lightning bolt being divided.
void StubWeatherUpdate(void)
Called each frame of rain before the rain is drawn.
u32 g_dwSnowMode
Whether the race uses snow effects.
u8 g_bFogG
The green component of the fog colour.
@ WEATHER_SUNNY
Definition weather.h:22
@ WEATHER_SNOW
Definition weather.h:25
@ WEATHER_FOG
Definition weather.h:23
@ WEATHER_RAIN
Definition weather.h:24
@ WEATHER_NIGHT
Definition weather.h:26
void UpdatePrecipitationParticles(void)
Move the wind and the lightning, and move the rain or snow of each view against its camera.
#define RAIN_PARTICLE_SLOTS
The particle slots each view keeps, more than the particles it draws.
Definition weather.h:157
u32 g_dwCurrentWeather
The weather the player chose.
void SubdivideLightningBolt(s32 index, s32 span)
Put a point of the lightning bolt at random near the middle of the points a span before and after it,...
#define WEATHER_VIEWS
The views that keep their own rain.
Definition weather.h:151
u32 g_dwNightMode
Whether the race uses night lighting.
u32 g_dwRainMode
Whether the race uses rain effects.
f32 g_fWindStrength
The strength of the wind, from 0.5 to 1.
f32 g_fRainCameraSpeedScale
The share of its movement the camera of the last view passes on to the rain.
f32 g_fWindAngle
The direction the wind blows towards, in radians.
f32 g_fRainCameraSpeed
The speed of the camera of the last view through the rain, limited.
Vec3f g_avRainVelocity[WEATHER_VIEWS]
How far the rain of each view falls in a frame, against its camera.
#define LIGHTNING_BOLT_POINTS
The points of the lightning bolt.
Definition weather.h:176
#define RAIN_STREAK_TEXTURE_BYTES_PER_TEXEL
The byte width of a rain-streak texel outside the Direct3D renderer.
Definition weather.h:172
s32 g_dwRainParticleCount
The particles each view draws.
u8 g_bFogB
The blue component of the fog colour.
u8 g_bFogR
The colour of the fog.
u8 g_aParticleTexture[]
The texture of the snowflakes and other particles, 64 texels square.
void InitRandomRainParticles(void)
Scatter the rain particles of every view.
s32 g_bRainParticlesInitialized
Whether the rain particles have their first positions.
s16 g_awRainParticlePos[WEATHER_VIEWS][RAIN_PARTICLE_SLOTS][3]
The positions of the rain particles of each view, in a cube around the camera that wraps.
void UpdateWindDirection(void)
Turn the wind and change its strength at random, and set its velocity for the frame.
u32 g_dwWeatherActive
Whether the weather is anything but sunny.