summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-01-09 10:15:20 +0000
committerpeter1138 <peter1138@openttd.org>2008-01-09 10:15:20 +0000
commita01fc4c142c043b8be1da55bd997cfcfc96390e7 (patch)
tree349e9f622eaae22b6c77513f5c6eb837b64a8764
parentb4b3190b62538249dffe77b60e5b65b3d78005d8 (diff)
downloadopenttd-a01fc4c142c043b8be1da55bd997cfcfc96390e7.tar.xz
(svn r11789) -Codechange: coding style for global variable names
-rw-r--r--src/aircraft_cmd.cpp6
-rw-r--r--src/engine.cpp10
-rw-r--r--src/engine.h11
-rw-r--r--src/roadveh_cmd.cpp4
-rw-r--r--src/ship_cmd.cpp6
-rw-r--r--src/table/engines.h10
-rw-r--r--src/train_cmd.cpp6
7 files changed, 26 insertions, 27 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 6f81f27d5..2a2abe6cb 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -165,7 +165,7 @@ int Aircraft::GetImage(Direction direction) const
int sprite = GetCustomVehicleSprite(this, direction);
if (sprite != 0) return sprite;
- spritenum = orig_aircraft_vehicle_info[this->engine_type - AIRCRAFT_ENGINES_INDEX].image_index;
+ spritenum = _orig_aircraft_vehicle_info[this->engine_type - AIRCRAFT_ENGINES_INDEX].image_index;
}
return direction + _aircraft_sprite[spritenum];
}
@@ -193,7 +193,7 @@ void DrawAircraftEngine(int x, int y, EngineID engine, SpriteID pal)
if (is_custom_sprite(spritenum)) {
sprite = GetCustomVehicleIcon(engine, DIR_W);
if (sprite == 0) {
- spritenum = orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
+ spritenum = _orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
sprite = (6 + _aircraft_sprite[spritenum]);
}
}
@@ -221,7 +221,7 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height)
if (is_custom_sprite(spritenum)) {
sprite = GetCustomVehicleIcon(engine, DIR_W);
if (sprite == 0) {
- spritenum = orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
+ spritenum = _orig_aircraft_vehicle_info[engine - AIRCRAFT_ENGINES_INDEX].image_index;
sprite = (6 + _aircraft_sprite[spritenum]);
}
}
diff --git a/src/engine.cpp b/src/engine.cpp
index e034994ce..47d6ba047 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -41,11 +41,11 @@ enum {
void SetupEngines()
{
/* Copy original static engine data */
- memcpy(&_engine_info, &orig_engine_info, sizeof(orig_engine_info));
- memcpy(&_rail_vehicle_info, &orig_rail_vehicle_info, sizeof(orig_rail_vehicle_info));
- memcpy(&_ship_vehicle_info, &orig_ship_vehicle_info, sizeof(orig_ship_vehicle_info));
- memcpy(&_aircraft_vehicle_info, &orig_aircraft_vehicle_info, sizeof(orig_aircraft_vehicle_info));
- memcpy(&_road_vehicle_info, &orig_road_vehicle_info, sizeof(orig_road_vehicle_info));
+ memcpy(&_engine_info, &_orig_engine_info, sizeof(_orig_engine_info));
+ memcpy(&_rail_vehicle_info, &_orig_rail_vehicle_info, sizeof(_orig_rail_vehicle_info));
+ memcpy(&_ship_vehicle_info, &_orig_ship_vehicle_info, sizeof(_orig_ship_vehicle_info));
+ memcpy(&_aircraft_vehicle_info, &_orig_aircraft_vehicle_info, sizeof(_orig_aircraft_vehicle_info));
+ memcpy(&_road_vehicle_info, &_orig_road_vehicle_info, sizeof(_orig_road_vehicle_info));
/* Add type to engines */
Engine* e = _engines;
diff --git a/src/engine.h b/src/engine.h
index 58f90289a..2f82e7472 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -219,12 +219,11 @@ static inline bool IsEngineIndex(uint index)
}
/* Access Vehicle Data */
-//#include "table/engines.h"
-extern const EngineInfo orig_engine_info[TOTAL_NUM_ENGINES];
-extern const RailVehicleInfo orig_rail_vehicle_info[NUM_TRAIN_ENGINES];
-extern const ShipVehicleInfo orig_ship_vehicle_info[NUM_SHIP_ENGINES];
-extern const AircraftVehicleInfo orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES];
-extern const RoadVehicleInfo orig_road_vehicle_info[NUM_ROAD_ENGINES];
+extern const EngineInfo _orig_engine_info[TOTAL_NUM_ENGINES];
+extern const RailVehicleInfo _orig_rail_vehicle_info[NUM_TRAIN_ENGINES];
+extern const ShipVehicleInfo _orig_ship_vehicle_info[NUM_SHIP_ENGINES];
+extern const AircraftVehicleInfo _orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES];
+extern const RoadVehicleInfo _orig_road_vehicle_info[NUM_ROAD_ENGINES];
extern EngineInfo _engine_info[TOTAL_NUM_ENGINES];
extern RailVehicleInfo _rail_vehicle_info[NUM_TRAIN_ENGINES];
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 82ea00394..dc0333eb2 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -99,7 +99,7 @@ int RoadVehicle::GetImage(Direction direction) const
if (is_custom_sprite(img)) {
image = GetCustomVehicleSprite(this, (Direction)(direction + 4 * IS_CUSTOM_SECONDHEAD_SPRITE(img)));
if (image != 0) return image;
- img = orig_road_vehicle_info[this->engine_type - ROAD_ENGINES_INDEX].image_index;
+ img = _orig_road_vehicle_info[this->engine_type - ROAD_ENGINES_INDEX].image_index;
}
image = direction + _roadveh_images[img];
@@ -118,7 +118,7 @@ void DrawRoadVehEngine(int x, int y, EngineID engine, SpriteID pal)
DrawSprite(sprite, pal, x, y);
return;
}
- spritenum = orig_road_vehicle_info[engine - ROAD_ENGINES_INDEX].image_index;
+ spritenum = _orig_road_vehicle_info[engine - ROAD_ENGINES_INDEX].image_index;
}
DrawSprite(6 + _roadveh_images[spritenum], pal, x, y);
}
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 45d3fd8dc..b74d27752 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -65,7 +65,7 @@ void DrawShipEngine(int x, int y, EngineID engine, SpriteID pal)
DrawSprite(sprite, pal, x, y);
return;
}
- spritenum = orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index;
+ spritenum = _orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index;
}
DrawSprite(6 + _ship_sprites[spritenum], pal, x, y);
}
@@ -82,7 +82,7 @@ void GetShipSpriteSize(EngineID engine, uint &width, uint &height)
if (is_custom_sprite(spritenum)) {
custom_sprite = GetCustomVehicleIcon(engine, DIR_W);
- spritenum = orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index;
+ spritenum = _orig_ship_vehicle_info[engine - SHIP_ENGINES_INDEX].image_index;
}
if (custom_sprite == 0) {
spritenum = 6 + _ship_sprites[spritenum];
@@ -104,7 +104,7 @@ int Ship::GetImage(Direction direction) const
int sprite = GetCustomVehicleSprite(this, direction);
if (sprite != 0) return sprite;
- spritenum = orig_ship_vehicle_info[this->engine_type - SHIP_ENGINES_INDEX].image_index;
+ spritenum = _orig_ship_vehicle_info[this->engine_type - SHIP_ENGINES_INDEX].image_index;
}
return _ship_sprites[spritenum] + direction;
}
diff --git a/src/table/engines.h b/src/table/engines.h
index 6797de73b..761bfad24 100644
--- a/src/table/engines.h
+++ b/src/table/engines.h
@@ -61,7 +61,7 @@
#define A 2
#define S 4
#define Y 8
-const EngineInfo orig_engine_info[] = {
+const EngineInfo _orig_engine_info[] = {
MK( 1827, 20, 15, 30, T ), /* 0 Kirby Paul Tank (Steam) */
MK( 12784, 20, 22, 30, A|S ), /* 1 MJS 250 (Diesel) */
MK( 9497, 20, 20, 50, Y), /* 2 Ploddyphut Choo-Choo */
@@ -362,7 +362,7 @@ const EngineInfo orig_engine_info[] = {
#define O RAILTYPE_MONO
#define L RAILTYPE_MAGLEV
-const RailVehicleInfo orig_rail_vehicle_info[NUM_TRAIN_ENGINES] = {
+const RailVehicleInfo _orig_rail_vehicle_info[NUM_TRAIN_ENGINES] = {
// image_index max_speed (kph) running_cost_base ai_rank
// | flags | power (hp) | running_cost_class | railtype
// | | base_cost | weight | | capacity | |
@@ -511,7 +511,7 @@ const RailVehicleInfo orig_rail_vehicle_info[NUM_TRAIN_ENGINES] = {
* @param h refittable
*/
#define SVI(a, b, c, d, e, f, g, h) { a, b, c, d, e, f, {g}, h }
-const ShipVehicleInfo orig_ship_vehicle_info[NUM_SHIP_ENGINES] = {
+const ShipVehicleInfo _orig_ship_vehicle_info[NUM_SHIP_ENGINES] = {
// image_index cargo_type cargo_amount refittable
// | base_cost | | running_cost |
// | | max_speed | | sfx |
@@ -546,7 +546,7 @@ const ShipVehicleInfo orig_ship_vehicle_info[NUM_SHIP_ENGINES] = {
#define H AIR_HELI
#define P AIR_CTOL
#define J AIR_CTOL | AIR_FAST
-const AircraftVehicleInfo orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES] = {
+const AircraftVehicleInfo _orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES] = {
// image_index sfx acceleration
// | base_cost | | max_speed
// | | running_cost | | mail_capacity
@@ -610,7 +610,7 @@ const AircraftVehicleInfo orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES] = {
* @param g cargo_type
*/
#define ROV(a, b, c, d, e, f, g) { a, b, c, {d}, e, f, g }
-const RoadVehicleInfo orig_road_vehicle_info[NUM_ROAD_ENGINES] = {
+const RoadVehicleInfo _orig_road_vehicle_info[NUM_ROAD_ENGINES] = {
// image_index sfx max_speed
// | base_cost | | capacity
// | | running_cost | | cargo_type
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 1c0253485..cd19b307b 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -464,7 +464,7 @@ int Train::GetImage(Direction direction) const
if (is_custom_sprite(img)) {
base = GetCustomVehicleSprite(this, (Direction)(direction + 4 * IS_CUSTOM_SECONDHEAD_SPRITE(img)));
if (base != 0) return base;
- img = orig_rail_vehicle_info[this->engine_type].image_index;
+ img = _orig_rail_vehicle_info[this->engine_type].image_index;
}
base = _engine_sprite_base[img] + ((direction + _engine_sprite_add[img]) & _engine_sprite_and[img]);
@@ -483,7 +483,7 @@ void DrawTrainEngine(int x, int y, EngineID engine, SpriteID pal)
if (is_custom_sprite(img)) {
image = GetCustomVehicleIcon(engine, DIR_W);
if (image == 0) {
- img = orig_rail_vehicle_info[engine].image_index;
+ img = _orig_rail_vehicle_info[engine].image_index;
} else {
y += _traininfo_vehicle_pitch;
}
@@ -498,7 +498,7 @@ void DrawTrainEngine(int x, int y, EngineID engine, SpriteID pal)
image = 0;
if (is_custom_sprite(img)) {
image = GetCustomVehicleIcon(engine, DIR_E);
- if (image == 0) img = orig_rail_vehicle_info[engine].image_index;
+ if (image == 0) img = _orig_rail_vehicle_info[engine].image_index;
}
if (image == 0) {
image =