summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/water.h
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-08-13 00:14:42 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-08-13 00:14:42 +0200
commit712154bc4fcfb50c05c57a875e3b2affdc5e2b1b (patch)
tree9b13ef9f64cf272a8c67effdb62c2459306bd167 /src/graphics/engine/water.h
parent146ad47e4afbf1fe82763c94c2cd2209285f869f (diff)
downloadcolobot-712154bc4fcfb50c05c57a875e3b2affdc5e2b1b.tar.gz
colobot-712154bc4fcfb50c05c57a875e3b2affdc5e2b1b.tar.bz2
colobot-712154bc4fcfb50c05c57a875e3b2affdc5e2b1b.zip
Rendering functions, documentation
- rewrote the render functions for CEngine, CCloud and CWater - added documentation
Diffstat (limited to 'src/graphics/engine/water.h')
-rw-r--r--src/graphics/engine/water.h33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/graphics/engine/water.h b/src/graphics/engine/water.h
index f20f992..371a91f 100644
--- a/src/graphics/engine/water.h
+++ b/src/graphics/engine/water.h
@@ -35,12 +35,19 @@ namespace Gfx {
class CEngine;
class CTerrain;
+/**
+ * \struct WaterLine
+ * \brief Water strip
+ */
struct WaterLine
{
- //! Beginning
+ //@{
+ //! Beginning of line (terrain coordinates)
short x, y;
- //! Length by x
+ //@}
+ //! Length in X direction (terrain coordinates)
short len;
+ //! X (1, 2) and Z coordinates (world coordinates)
float px1, px2, pz;
WaterLine()
@@ -51,6 +58,10 @@ struct WaterLine
}
};
+/**
+ * \struct WaterVapor
+ * \brief Water particle effect
+ */
struct WaterVapor
{
bool used;
@@ -68,6 +79,10 @@ struct WaterVapor
}
};
+/**
+ * \enum WaterType
+ * \brief Mode of water display
+ */
enum WaterType
{
//! No water
@@ -82,7 +97,19 @@ enum WaterType
WATER_CO = 4,
};
-
+/**
+ * \class CWater
+ * \brief Water manager/renderer
+ *
+ * Water is drawn where the terrain is below specified level. The mapping
+ * is based on terrain coordinates - for each "brick" coordinate, the level
+ * of terrain is tested. For every Y coordinate, many lines in X direction
+ * are created (WaterLines).
+ *
+ * There are two parts of drawing process: drawing the background image
+ * blocking the normal sky layer and drawing the surface of water.
+ * The surface is drawn with texture, so with proper texture it can be lava.
+ */
class CWater
{
public: