summaryrefslogtreecommitdiffstats
path: root/src/cloud.h
diff options
context:
space:
mode:
authoradiblol <adiblol@1tbps.org>2012-03-08 19:32:05 +0100
committeradiblol <adiblol@1tbps.org>2012-03-08 19:32:05 +0100
commita4c804b49ec872b71bd5a0167c3ad45704a3cc30 (patch)
tree8c931235247d662ca46a99695beb328fdfc8e8a8 /src/cloud.h
downloadcolobot-a4c804b49ec872b71bd5a0167c3ad45704a3cc30.tar.gz
colobot-a4c804b49ec872b71bd5a0167c3ad45704a3cc30.tar.bz2
colobot-a4c804b49ec872b71bd5a0167c3ad45704a3cc30.zip
Initial commit, Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
Diffstat (limited to 'src/cloud.h')
-rw-r--r--src/cloud.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/cloud.h b/src/cloud.h
new file mode 100644
index 0000000..049b17d
--- /dev/null
+++ b/src/cloud.h
@@ -0,0 +1,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_