-
Notifications
You must be signed in to change notification settings - Fork 59
/
CWeather.h
90 lines (62 loc) · 1.33 KB
/
CWeather.h
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/////////////////////////////////////////
//
// OpenLieroX
//
// code under LGPL, based on JasonBs work,
// enhanced by Dark Charlie and Albert Zeyer
//
//
/////////////////////////////////////////
// Weather class
// Created 14/3/03
// Jason Boettcher
#ifndef __CWEATHER_H__
#define __CWEATHER_H__
#include <SDL.h>
#include "CVec.h"
#include "SmartPointer.h"
class CMap;
class CViewport;
// Weather types
enum {
wth_snow,
wth_rain,
wth_hail
};
// Particle types
enum {
wpt_snowpart,
wpt_raindrop,
wpt_hailbit
};
// Weather particle
class wthpart_t { public:
bool bUsed;
int nType;
int nType2;
CVec cPos;
CVec cVel;
};
#define MAX_WEATHERPARTS 1024
class CWeather {
private:
// Attributes
// Particles
int m_nType;
wthpart_t *m_psParticles;
// Snow details
AbsTime m_fNextSnow;
float m_fWind;
// Graphics
SmartPointer<SDL_Surface> m_psSnowPart;
public:
// Methods
CWeather();
bool Initialize(int nType);
void Shutdown();
void Simulate(float dt);
void SimulateSnow(float dt);
void SpawnParticle(int nType, int nType2, CVec cVel, CVec cPos);
void Draw(SDL_Surface * psDest, CViewport *view);
};
#endif // __CWEATHER_H__