summaryrefslogtreecommitdiffstats
path: root/src/object/auto
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-06-11 17:28:27 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-06-11 17:28:27 +0200
commita8665d204255b4b0ad9ae6982f77ecd5e053c1b6 (patch)
tree5f7e58785f5175e7f067ffaf8f96d16272c92d1e /src/object/auto
parent8ffdf2583e4ea77731490dcaad51dbc08d7f26fa (diff)
downloadcolobot-a8665d204255b4b0ad9ae6982f77ecd5e053c1b6.tar.gz
colobot-a8665d204255b4b0ad9ae6982f77ecd5e053c1b6.tar.bz2
colobot-a8665d204255b4b0ad9ae6982f77ecd5e053c1b6.zip
Changed #defined constants to consts; typedef struct -> struct
Diffstat (limited to 'src/object/auto')
-rw-r--r--src/object/auto/autobase.cpp16
-rw-r--r--src/object/auto/autobase.h19
-rw-r--r--src/object/auto/autoderrick.cpp4
-rw-r--r--src/object/auto/autoenergy.cpp4
-rw-r--r--src/object/auto/autohuston.h7
-rw-r--r--src/object/auto/autolabo.cpp2
-rw-r--r--src/object/auto/autonuclear.cpp2
-rw-r--r--src/object/auto/autoportico.cpp28
-rw-r--r--src/object/auto/autosafe.cpp2
-rw-r--r--src/object/auto/autotower.cpp4
10 files changed, 44 insertions, 44 deletions
diff --git a/src/object/auto/autobase.cpp b/src/object/auto/autobase.cpp
index 5c1bb2d..54bf96f 100644
--- a/src/object/auto/autobase.cpp
+++ b/src/object/auto/autobase.cpp
@@ -48,14 +48,14 @@
-#define BASE_LAND_TIME 7.5f // hard landing
-#define BASE_TAKO_TIME 10.0f // hard landing
-#define BASE_DOOR_TIME 6.0f // time opening / closing
-#define BASE_DOOR_TIME2 2.0f // time opening / closing suppl.
-#define BASE_PORTICO_TIME_MOVE 16.0f // gate advance time
-#define BASE_PORTICO_TIME_DOWN 4.0f // gate length down
-#define BASE_PORTICO_TIME_OPEN 4.0f // gate opening duration
-#define BASE_TRANSIT_TIME 15.0f // transit duration
+const float BASE_LAND_TIME = 7.5f; // hard landing
+const float BASE_TAKO_TIME = 10.0f; // hard landing
+const float BASE_DOOR_TIME = 6.0f; // time opening / closing
+const float BASE_DOOR_TIME2 = 2.0f; // time opening / closing suppl.
+const float BASE_PORTICO_TIME_MOVE = 16.0f; // gate advance time
+const float BASE_PORTICO_TIME_DOWN = 4.0f; // gate length down
+const float BASE_PORTICO_TIME_OPEN = 4.0f; // gate opening duration
+const float BASE_TRANSIT_TIME = 15.0f; // transit duration
diff --git a/src/object/auto/autobase.h b/src/object/auto/autobase.h
index 1a3623d..513f16e 100644
--- a/src/object/auto/autobase.h
+++ b/src/object/auto/autobase.h
@@ -31,15 +31,16 @@ class CCamera;
class CObject;
-
-#define PARAM_STOP 0 // run=0 -> stops and open
-#define PARAM_LANDING 1 // run=1 -> landing
-#define PARAM_PORTICO 2 // run=2 -> gate on the ground
-#define PARAM_FIXSCENE 3 // run=3 -> open and stops to win / lost
-#define PARAM_TRANSIT1 11 // run=11 -> transit in space
-#define PARAM_TRANSIT2 12 // run=12 -> transit in space
-#define PARAM_TRANSIT3 13 // run=13 -> transit in space
-
+enum AutoBaseParam
+{
+ PARAM_STOP = 0, // run=0 -> stops and open
+ PARAM_LANDING = 1, // run=1 -> landing
+ PARAM_PORTICO = 2, // run=2 -> gate on the ground
+ PARAM_FIXSCENE = 3, // run=3 -> open and stops to win / lost
+ PARAM_TRANSIT1 = 11, // run=11 -> transit in space
+ PARAM_TRANSIT2 = 12, // run=12 -> transit in space
+ PARAM_TRANSIT3 = 13 // run=13 -> transit in space
+};
enum AutoBasePhase
{
diff --git a/src/object/auto/autoderrick.cpp b/src/object/auto/autoderrick.cpp
index 8350da8..a7d0b5e 100644
--- a/src/object/auto/autoderrick.cpp
+++ b/src/object/auto/autoderrick.cpp
@@ -43,8 +43,8 @@
-#define DERRICK_DELAY 10.0f // duration of the extraction
-#define DERRICK_DELAYu 30.0f // same, but for uranium
+const float DERRICK_DELAY = 10.0f; // duration of the extraction
+const float DERRICK_DELAYu = 30.0f; // same, but for uranium
diff --git a/src/object/auto/autoenergy.cpp b/src/object/auto/autoenergy.cpp
index ba265e8..75ab92a 100644
--- a/src/object/auto/autoenergy.cpp
+++ b/src/object/auto/autoenergy.cpp
@@ -46,8 +46,8 @@
-#define ENERGY_POWER 0.4f // Necessary energy for a battery
-#define ENERGY_DELAY 12.0f // processing time
+const float ENERGY_POWER = 0.4f; // Necessary energy for a battery
+const float ENERGY_DELAY = 12.0f; // processing time
diff --git a/src/object/auto/autohuston.h b/src/object/auto/autohuston.h
index 32954f7..e17d04e 100644
--- a/src/object/auto/autohuston.h
+++ b/src/object/auto/autohuston.h
@@ -32,7 +32,7 @@ class CObject;
-typedef struct
+struct HustonLens
{
int parti;
ParticuleType type;
@@ -40,11 +40,10 @@ typedef struct
float dim;
float total;
float off;
-}
-HustonLens;
+};
-#define HUSTONMAXLENS 20
+const int HUSTONMAXLENS = 20;
class CAutoHuston : public CAuto
diff --git a/src/object/auto/autolabo.cpp b/src/object/auto/autolabo.cpp
index 41b6299..7d5c576 100644
--- a/src/object/auto/autolabo.cpp
+++ b/src/object/auto/autolabo.cpp
@@ -47,7 +47,7 @@
-#define LABO_DELAY 20.0f // duration of the analysis
+const float LABO_DELAY = 20.0f; // duration of the analysis
diff --git a/src/object/auto/autonuclear.cpp b/src/object/auto/autonuclear.cpp
index a6a9904..5139b9b 100644
--- a/src/object/auto/autonuclear.cpp
+++ b/src/object/auto/autonuclear.cpp
@@ -45,7 +45,7 @@
-#define NUCLEAR_DELAY 30.0f // duration of the generation
+const float NUCLEAR_DELAY = 30.0f; // duration of the generation
diff --git a/src/object/auto/autoportico.cpp b/src/object/auto/autoportico.cpp
index 97f11c5..5c4a09c 100644
--- a/src/object/auto/autoportico.cpp
+++ b/src/object/auto/autoportico.cpp
@@ -44,20 +44,20 @@
-#define PARAM_DEPOSE 2 // run=2 -> deposits the spaceship
-
-#define PORTICO_POSa 75.0f
-#define PORTICO_POSb 65.0f
-#define PORTICO_ANGLE1a ( 25.0f*PI/180.0f)
-#define PORTICO_ANGLE1b ( 70.0f*PI/180.0f)
-#define PORTICO_ANGLE2a (-37.5f*PI/180.0f)
-#define PORTICO_ANGLE2b (-62.5f*PI/180.0f)
-#define PORTICO_ANGLE3a (-77.5f*PI/180.0f)
-#define PORTICO_ANGLE3b (-30.0f*PI/180.0f)
-
-#define PORTICO_TIME_MOVE 16.0f
-#define PORTICO_TIME_DOWN 4.0f
-#define PORTICO_TIME_OPEN 12.0f
+const int PARAM_DEPOSE = 2; // run=2 -> deposits the spaceship
+
+const float PORTICO_POSa = 75.0f;
+const float PORTICO_POSb = 65.0f;
+const float PORTICO_ANGLE1a = ( 25.0f*PI/180.0f);
+const float PORTICO_ANGLE1b = ( 70.0f*PI/180.0f);
+const float PORTICO_ANGLE2a = (-37.5f*PI/180.0f);
+const float PORTICO_ANGLE2b = (-62.5f*PI/180.0f);
+const float PORTICO_ANGLE3a = (-77.5f*PI/180.0f);
+const float PORTICO_ANGLE3b = (-30.0f*PI/180.0f);
+
+const float PORTICO_TIME_MOVE = 16.0f;
+const float PORTICO_TIME_DOWN = 4.0f;
+const float PORTICO_TIME_OPEN = 12.0f;
diff --git a/src/object/auto/autosafe.cpp b/src/object/auto/autosafe.cpp
index 8104c5e..6565202 100644
--- a/src/object/auto/autosafe.cpp
+++ b/src/object/auto/autosafe.cpp
@@ -46,7 +46,7 @@
-#define OPEN_DELAY 8.0f // duration of opening
+const float OPEN_DELAY = 8.0f; // duration of opening
diff --git a/src/object/auto/autotower.cpp b/src/object/auto/autotower.cpp
index 63222b8..74cc984 100644
--- a/src/object/auto/autotower.cpp
+++ b/src/object/auto/autotower.cpp
@@ -47,8 +47,8 @@
-#define TOWER_SCOPE 200.0f // range of beam
-#define ENERGY_FIRE 0.125f // energy consumed by fire
+const float TOWER_SCOPE = 200.0f; // range of beam
+const float ENERGY_FIRE = 0.125f; // energy consumed by fire
// Object's constructor.