summaryrefslogtreecommitdiffstats
path: root/src/cloud.h
blob: 049b17d492917daf51907018ae9471cc370baf60 (plain)
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
// cloud.h

#ifndef _CLOUD_H_
#define	_CLOUD_H_


class CInstanceManager;
class CD3DEngine;
class CTerrain;



#define MAXCLOUDLINE	100

typedef struct
{
	short		x, y;		// d�but
	short		len;		// longueur en x
	float		px1, px2, pz;
}
CloudLine;


class CCloud
{
public:
	CCloud(CInstanceManager* iMan, CD3DEngine* engine);
	~CCloud();

	BOOL		EventProcess(const Event &event);
	void		Flush();
	BOOL		Create(const char *filename, D3DCOLORVALUE diffuse, D3DCOLORVALUE ambient, float level);
	void		Draw();

	BOOL		SetLevel(float level);
	float		RetLevel();

	void		SetEnable(BOOL bEnable);
	BOOL		RetEnable();

protected:
	BOOL		EventFrame(const Event &event);
	void		AdjustLevel(D3DVECTOR &pos, D3DVECTOR &eye, float deep, FPOINT &uv1, FPOINT &uv2);
	BOOL		CreateLine(int x, int y, int len);

protected:
	CInstanceManager*	m_iMan;
	CD3DEngine*			m_engine;
	CTerrain*			m_terrain;

	char			m_filename[100];
	float			m_level;		// niveau global
	FPOINT			m_speed;		// vitesse d'avance (vent)
	D3DCOLORVALUE	m_diffuse;		// couleur diffuse
	D3DCOLORVALUE	m_ambient;		// couleur ambiante
	float			m_time;
	float			m_lastTest;
	int				m_subdiv;

	D3DVECTOR		m_wind;			// vitesse du vent
	int				m_brick;		// nb de briques*mosa�que
	float			m_size;			// taille d'un �l�ment dans une brique

	int				m_lineUsed;
	CloudLine		m_line[MAXCLOUDLINE];

	BOOL			m_bEnable;
};


#endif //_CLOUD_H_