summaryrefslogtreecommitdiffstats
path: root/src/render/Weather.cpp
blob: c1988ab42fa50380053a42f1e07893308ab4ddbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "common.h"
#include "patcher.h"
#include "Weather.h"

int32 &CWeather::SoundHandle = *(int32*)0x5FFBC4;

int32 &CWeather::WeatherTypeInList = *(int32*)0x8F626C;
int16 &CWeather::OldWeatherType = *(int16*)0x95CCEC;
int16 &CWeather::NewWeatherType = *(int16*)0x95CC70;
int16 &CWeather::ForcedWeatherType = *(int16*)0x95CC80;

bool &CWeather::LightningFlash = *(bool*)0x95CDA3;
bool &CWeather::LightningBurst = *(bool*)0x95CDAC;
uint32 &CWeather::LightningStart = *(uint32*)0x8F5F84;
uint32 &CWeather::LightningFlashLastChange = *(uint32*)0x8E2C0C;
uint32 &CWeather::WhenToPlayLightningSound = *(uint32*)0x8F57E4;
uint32 &CWeather::LightningDuration = *(uint32*)0x940578;

float &CWeather::Foggyness = *(float*)0x885AF4;
float &CWeather::CloudCoverage = *(float*)0x8E2818;
float &CWeather::Wind = *(float*)0x8E2BF8;
float &CWeather::Rain = *(float*)0x8E2BFC;
float &CWeather::InterpolationValue = *(float*)0x8F2520;
float &CWeather::WetRoads = *(float*)0x8F5FF8;
float &CWeather::Rainbow = *(float*)0x940598;

bool &CWeather::bScriptsForceRain = *(bool*)0x95CD7D;
bool &CWeather::Stored_StateStored = *(bool*)0x95CDC1;

float &CWeather::Stored_InterpolationValue = *(float*)0x942F54;
int16 &CWeather::Stored_OldWeatherType = *(int16*)0x95CC68;
int16 &CWeather::Stored_NewWeatherType = *(int16*)0x95CCAE;
float &CWeather::Stored_Rain = *(float*)0x885B4C;

WRAPPER void CWeather::RenderRainStreaks(void) { EAXJMP(0x524550); }
WRAPPER void CWeather::Update(void) { EAXJMP(0x522C10); }
WRAPPER void CWeather::Init(void) { EAXJMP(0x522BA0); }

void CWeather::ReleaseWeather()
{
	ForcedWeatherType = -1;
}

void CWeather::ForceWeather(int16 weather)
{
	ForcedWeatherType = weather;
}

void CWeather::ForceWeatherNow(int16 weather)
{
	OldWeatherType = weather;
	NewWeatherType = weather;
	ForcedWeatherType = weather;
}

void CWeather::StoreWeatherState()
{
	Stored_StateStored = true;
	Stored_InterpolationValue = InterpolationValue;
	Stored_Rain = Rain;
	Stored_NewWeatherType = NewWeatherType;
	Stored_OldWeatherType = OldWeatherType;
}

void CWeather::RestoreWeatherState()
{
#ifdef FIX_BUGS // it's not used anyway though
	Stored_StateStored = false;
#endif
	InterpolationValue = Stored_InterpolationValue;
	Rain = Stored_Rain;
	NewWeatherType = Stored_NewWeatherType;
	OldWeatherType = Stored_OldWeatherType;
}