summaryrefslogtreecommitdiffstats
path: root/src/graphics/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics/common')
-rw-r--r--src/graphics/common/blitz.h4
-rw-r--r--src/graphics/common/cloud.cpp2
-rw-r--r--src/graphics/common/cloud.h7
-rw-r--r--src/graphics/common/light.h12
-rw-r--r--src/graphics/common/model.cpp6
-rw-r--r--src/graphics/common/particule.cpp4
-rw-r--r--src/graphics/common/particule.h38
-rw-r--r--src/graphics/common/planet.h7
-rw-r--r--src/graphics/common/pyro.h10
-rw-r--r--src/graphics/common/terrain.cpp2
-rw-r--r--src/graphics/common/terrain.h29
-rw-r--r--src/graphics/common/text.h14
-rw-r--r--src/graphics/common/water.h14
13 files changed, 69 insertions, 80 deletions
diff --git a/src/graphics/common/blitz.h b/src/graphics/common/blitz.h
index 59268b5..d492654 100644
--- a/src/graphics/common/blitz.h
+++ b/src/graphics/common/blitz.h
@@ -31,8 +31,8 @@ class CSound;
-#define BLITZPARA 200.0f // radius of lightning protection
-#define BLITZMAX 50
+const float BLITZPARA = 200.0f; // radius of lightning protection
+const int BLITZMAX = 50;
enum BlitzPhase
{
diff --git a/src/graphics/common/cloud.cpp b/src/graphics/common/cloud.cpp
index 75e44d6..1d4f6d9 100644
--- a/src/graphics/common/cloud.cpp
+++ b/src/graphics/common/cloud.cpp
@@ -35,7 +35,7 @@
-#define DIMEXPAND 4 // extension of the dimensions
+const int DIMEXPAND = 4; // extension of the dimensions
diff --git a/src/graphics/common/cloud.h b/src/graphics/common/cloud.h
index 2be63c7..cf97bc7 100644
--- a/src/graphics/common/cloud.h
+++ b/src/graphics/common/cloud.h
@@ -28,15 +28,14 @@ class CTerrain;
-#define MAXCLOUDLINE 100
+const int MAXCLOUDLINE = 100;
-typedef struct
+struct CloudLine
{
short x, y; // beginning
short len; // in length x
float px1, px2, pz;
-}
-CloudLine;
+};
class CCloud
diff --git a/src/graphics/common/light.h b/src/graphics/common/light.h
index 2ae8d2a..2b20094 100644
--- a/src/graphics/common/light.h
+++ b/src/graphics/common/light.h
@@ -26,21 +26,20 @@ class CInstanceManager;
class CD3DEngine;
-#define D3DMAXLIGHT 100
+const int D3DMAXLIGHT = 100;
-typedef struct
+struct LightProg
{
float starting;
float ending;
float current;
float progress;
float speed;
-}
-LightProg;
+};
-typedef struct
+struct Light
{
char bUsed; // true -> light exists
char bEnable; // true -> light turned on
@@ -54,8 +53,7 @@ typedef struct
LightProg colorRed;
LightProg colorGreen;
LightProg colorBlue;
-}
-Light;
+};
diff --git a/src/graphics/common/model.cpp b/src/graphics/common/model.cpp
index 324f219..fa1fe1c 100644
--- a/src/graphics/common/model.cpp
+++ b/src/graphics/common/model.cpp
@@ -41,7 +41,7 @@
-#define MAX_COLORS 9
+const int MAX_COLORS = 9;
static float table_color[MAX_COLORS*3] =
{
@@ -57,7 +57,7 @@ static float table_color[MAX_COLORS*3] =
};
-#define MAX_STATES 10
+const int MAX_STATES = 10;
static int table_state[MAX_STATES] =
{
@@ -74,7 +74,7 @@ static int table_state[MAX_STATES] =
};
-#define MAX_NAMES 23
+const int MAX_NAMES = 23;
diff --git a/src/graphics/common/particule.cpp b/src/graphics/common/particule.cpp
index d84ca22..edf9c3d 100644
--- a/src/graphics/common/particule.cpp
+++ b/src/graphics/common/particule.cpp
@@ -43,8 +43,8 @@
-#define FOG_HSUP 10.0f
-#define FOG_HINF 100.0f
+const float FOG_HSUP = 10.0f;
+const float FOG_HINF = 100.0f;
diff --git a/src/graphics/common/particule.h b/src/graphics/common/particule.h
index 06fca92..4014060 100644
--- a/src/graphics/common/particule.h
+++ b/src/graphics/common/particule.h
@@ -30,17 +30,20 @@ class CWater;
class CObject;
-#define MAXPARTICULE 500
-#define MAXPARTITYPE 5
-#define MAXTRACK 100
-#define MAXTRACKLEN 10
-#define MAXPARTIFOG 100
-#define MAXWHEELTRACE 1000
+const int MAXPARTICULE = 500;
+const int MAXPARTITYPE = 5;
+const int MAXTRACK = 100;
+const int MAXTRACKLEN = 10;
+const int MAXPARTIFOG = 100;
+const int MAXWHEELTRACE = 1000;
-#define SH_WORLD 0 // particle in the world in the interface
-#define SH_FRONT 1 // particle in the world on the interface
-#define SH_INTERFACE 2 // particle in the interface
-#define SH_MAX 3
+enum ParticulePlace
+{
+ SH_WORLD = 0, // particle in the world in the interface
+ SH_FRONT = 1, // particle in the world on the interface
+ SH_INTERFACE = 2, // particle in the interface
+ SH_MAX = 3
+};
// type == 0 -> triangles
// type == 1 -> effect00 (black background)
@@ -198,7 +201,7 @@ enum ParticulePhase
PARPHEND = 1,
};
-typedef struct
+struct Particule
{
char bUsed; // true -> particle used
char bRay; // true -> ray with goal
@@ -227,10 +230,9 @@ typedef struct
CObject* objFather; // father object (for example reactor)
short objRank; // rank of the object, or -1
short trackRank; // rank of the drag
-}
-Particule;
+};
-typedef struct
+struct Track
{
char bUsed; // true -> drag used
char bDrawParticule;
@@ -242,16 +244,14 @@ typedef struct
int head; // head to write index
D3DVECTOR pos[MAXTRACKLEN];
float len[MAXTRACKLEN];
-}
-Track;
+};
-typedef struct
+struct WheelTrace
{
ParticuleType type; // type PARTI*
D3DVECTOR pos[4]; // rectangle positions
float startTime; // beginning of life
-}
-WheelTrace;
+};
diff --git a/src/graphics/common/planet.h b/src/graphics/common/planet.h
index 75af350..fd2f0f2 100644
--- a/src/graphics/common/planet.h
+++ b/src/graphics/common/planet.h
@@ -27,9 +27,9 @@ class CD3DEngine;
-#define MAXPLANET 10
+const int MAXPLANET = 10;
-typedef struct
+struct Planet
{
char bUsed; // true -> planet exists
FPOINT start; // initial position in degrees
@@ -40,8 +40,7 @@ typedef struct
char name[20]; // name of the texture
FPOINT uv1, uv2; // texture mapping
char bTGA; // texture .TGA
-}
-Planet;
+};
diff --git a/src/graphics/common/pyro.h b/src/graphics/common/pyro.h
index b34842a..d898a94 100644
--- a/src/graphics/common/pyro.h
+++ b/src/graphics/common/pyro.h
@@ -67,23 +67,21 @@ enum PyroType
};
-typedef struct
+struct PyroBurnPart
{
int part;
D3DVECTOR initialPos;
D3DVECTOR finalPos;
D3DVECTOR initialAngle;
D3DVECTOR finalAngle;
-}
-PyroBurnPart;
+};
-typedef struct
+struct PyroLightOper
{
float progress;
float intensity;
D3DCOLORVALUE color;
-}
-PyroLightOper;
+};
diff --git a/src/graphics/common/terrain.cpp b/src/graphics/common/terrain.cpp
index 06bf90f..af0bb6e 100644
--- a/src/graphics/common/terrain.cpp
+++ b/src/graphics/common/terrain.cpp
@@ -37,7 +37,7 @@
#include "graphics/common/terrain.h"
-#define BMPHEAD 1078
+const int BMPHEAD = 1078;
diff --git a/src/graphics/common/terrain.h b/src/graphics/common/terrain.h
index 50f5612..1ea5a6a 100644
--- a/src/graphics/common/terrain.h
+++ b/src/graphics/common/terrain.h
@@ -19,6 +19,7 @@
#pragma once
+#include "math/old/math3d.h"
#include "graphics/d3d/d3dengine.h"
@@ -28,7 +29,7 @@ class CWater;
-#define FLATLIMIT (5.0f*PI/180.0f)
+const float FLATLIMIT = (5.0f*PI/180.0f);
enum TerrainRes
@@ -44,9 +45,9 @@ enum TerrainRes
};
-#define MAXBUILDINGLEVEL 100
+const int MAXBUILDINGLEVEL = 100;
-typedef struct
+struct BuildingLevel
{
D3DVECTOR center;
float factor;
@@ -58,40 +59,36 @@ typedef struct
float bboxMaxX;
float bboxMinZ;
float bboxMaxZ;
-}
-BuildingLevel;
+};
-#define MAXMATTERRAIN 100
+const int MAXMATTERRAIN = 100;
-typedef struct
+struct TerrainMaterial
{
short id;
char texName[20];
float u,v;
float hardness;
char mat[4]; // up, right, down, left
-}
-TerrainMaterial;
+};
-typedef struct
+struct DotLevel
{
short id;
char mat[4]; // up, right, down, left
-}
-DotLevel;
+};
-#define MAXFLYINGLIMIT 10
+const int MAXFLYINGLIMIT = 10;
-typedef struct
+struct FlyingLimit
{
D3DVECTOR center;
float extRadius;
float intRadius;
float maxHeight;
-}
-FlyingLimit;
+};
diff --git a/src/graphics/common/text.h b/src/graphics/common/text.h
index 5d41c5c..defa218 100644
--- a/src/graphics/common/text.h
+++ b/src/graphics/common/text.h
@@ -26,10 +26,10 @@ class CInstanceManager;
-#define SMALLFONT 10.0f
-#define BIGFONT 15.0f
+const float SMALLFONT = 10.0f;
+const float BIGFONT = 15.0f;
-#define NORMSTRETCH 0.8f
+const float NORMSTRETCH = 0.8f;
@@ -58,10 +58,10 @@ enum FontColor
COLOR_TABLE = 0x70,
};
-#define FONT_MASK 0x03
-#define TITLE_MASK 0x0c
-#define COLOR_MASK 0x70
-#define IMAGE_MASK 0x80
+const int FONT_MASK = 0x03;
+const int TITLE_MASK = 0x0c;
+const int COLOR_MASK = 0x70;
+const int IMAGE_MASK = 0x80;
diff --git a/src/graphics/common/water.h b/src/graphics/common/water.h
index c0593a0..7a7ffef 100644
--- a/src/graphics/common/water.h
+++ b/src/graphics/common/water.h
@@ -29,20 +29,19 @@ class CSound;
-#define MAXWATERLINE 500
+const int MAXWATERLINE = 500;
-typedef struct
+struct WaterLine
{
short x, y; // beginning
short len; // length by x
float px1, px2, pz;
-}
-WaterLine;
+};
-#define MAXWATVAPOR 10
+const int MAXWATVAPOR = 10;
-typedef struct
+struct WaterVapor
{
bool bUsed;
ParticuleType type;
@@ -50,8 +49,7 @@ typedef struct
float delay;
float time;
float last;
-}
-WaterVapor;
+};
enum WaterType