summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-06-16 13:31:06 +0000
committerrubidium <rubidium@openttd.org>2009-06-16 13:31:06 +0000
commit4b05617c42c89a323560a0bfd9225fcac9b69588 (patch)
tree9eb73e8732bc90c24aacbc2209a349557c7b68fb /src
parent20f73b2f506b87415e39f5e0edb53477635264f9 (diff)
downloadopenttd-4b05617c42c89a323560a0bfd9225fcac9b69588.tar.xz
(svn r16580) -Codechange: rename Engine::image_index to original_image_index to not confuse it with image_index from *VehInfo.
Diffstat (limited to 'src')
-rw-r--r--src/aircraft_cmd.cpp4
-rw-r--r--src/engine.cpp8
-rw-r--r--src/engine_base.h2
-rw-r--r--src/roadveh_cmd.cpp4
-rw-r--r--src/ship_cmd.cpp4
-rw-r--r--src/train_cmd.cpp4
6 files changed, 13 insertions, 13 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 6a7c9258e..511dbe02a 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -155,7 +155,7 @@ SpriteID Aircraft::GetImage(Direction direction) const
SpriteID sprite = GetCustomVehicleSprite(this, direction);
if (sprite != 0) return sprite;
- spritenum = Engine::Get(this->engine_type)->image_index;
+ spritenum = Engine::Get(this->engine_type)->original_image_index;
}
return direction + _aircraft_sprite[spritenum];
@@ -183,7 +183,7 @@ static SpriteID GetAircraftIcon(EngineID engine)
SpriteID sprite = GetCustomVehicleIcon(engine, DIR_W);
if (sprite != 0) return sprite;
- spritenum = Engine::Get(engine)->image_index;
+ spritenum = Engine::Get(engine)->original_image_index;
}
return DIR_W + _aircraft_sprite[spritenum];
diff --git a/src/engine.cpp b/src/engine.cpp
index 5e873f5a1..bc0fb8a52 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -84,7 +84,7 @@ Engine::Engine(VehicleType type, EngineID base)
case VEH_TRAIN:
this->u.rail = _orig_rail_vehicle_info[base];
- this->image_index = this->u.rail.image_index;
+ this->original_image_index = this->u.rail.image_index;
this->info.string_id = STR_VEHICLE_NAME_TRAIN_ENGINE_RAIL_KIRBY_PAUL_TANK_STEAM + base;
/* Set the default model life of original wagons to "infinite" */
@@ -94,19 +94,19 @@ Engine::Engine(VehicleType type, EngineID base)
case VEH_ROAD:
this->u.road = _orig_road_vehicle_info[base];
- this->image_index = this->u.road.image_index;
+ this->original_image_index = this->u.road.image_index;
this->info.string_id = STR_VEHICLE_NAME_ROAD_MPS_REGAL_BUS + base;
break;
case VEH_SHIP:
this->u.ship = _orig_ship_vehicle_info[base];
- this->image_index = this->u.ship.image_index;
+ this->original_image_index = this->u.ship.image_index;
this->info.string_id = STR_VEHICLE_NAME_SHIP_MPS_OIL_TANKER + base;
break;
case VEH_AIRCRAFT:
this->u.air = _orig_aircraft_vehicle_info[base];
- this->image_index = this->u.air.image_index;
+ this->original_image_index = this->u.air.image_index;
this->info.string_id = STR_VEHICLE_NAME_AIRCRAFT_SAMPSON_U52 + base;
break;
}
diff --git a/src/engine_base.h b/src/engine_base.h
index 2f071f343..bbf25b9fa 100644
--- a/src/engine_base.h
+++ b/src/engine_base.h
@@ -26,7 +26,7 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> {
uint8 preview_company_rank;
byte preview_wait;
CompanyMask company_avail;
- uint8 image_index; ///< Original vehicle image index
+ uint8 original_image_index; ///< Original vehicle image index, thus the image index of the overridden vehicle
VehicleType type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc.
EngineInfo info;
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 832237c06..f2704e1d0 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -90,7 +90,7 @@ static SpriteID GetRoadVehIcon(EngineID engine)
SpriteID sprite = GetCustomVehicleIcon(engine, DIR_W);
if (sprite != 0) return sprite;
- spritenum = Engine::Get(engine)->image_index;
+ spritenum = Engine::Get(engine)->original_image_index;
}
return DIR_W + _roadveh_images[spritenum];
@@ -105,7 +105,7 @@ SpriteID RoadVehicle::GetImage(Direction direction) const
sprite = GetCustomVehicleSprite(this, (Direction)(direction + 4 * IS_CUSTOM_SECONDHEAD_SPRITE(spritenum)));
if (sprite != 0) return sprite;
- spritenum = Engine::Get(this->engine_type)->image_index;
+ spritenum = Engine::Get(this->engine_type)->original_image_index;
}
sprite = direction + _roadveh_images[spritenum];
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 226460ce1..15c150be2 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -56,7 +56,7 @@ static SpriteID GetShipIcon(EngineID engine)
SpriteID sprite = GetCustomVehicleIcon(engine, DIR_W);
if (sprite != 0) return sprite;
- spritenum = Engine::Get(engine)->image_index;
+ spritenum = Engine::Get(engine)->original_image_index;
}
return DIR_W + _ship_sprites[spritenum];
@@ -88,7 +88,7 @@ SpriteID Ship::GetImage(Direction direction) const
SpriteID sprite = GetCustomVehicleSprite(this, direction);
if (sprite != 0) return sprite;
- spritenum = Engine::Get(this->engine_type)->image_index;
+ spritenum = Engine::Get(this->engine_type)->original_image_index;
}
return _ship_sprites[spritenum] + direction;
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index a8b620ec1..253981a46 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -603,7 +603,7 @@ SpriteID Train::GetImage(Direction direction) const
sprite = GetCustomVehicleSprite(this, (Direction)(direction + 4 * IS_CUSTOM_SECONDHEAD_SPRITE(spritenum)));
if (sprite != 0) return sprite;
- spritenum = Engine::Get(this->engine_type)->image_index;
+ spritenum = Engine::Get(this->engine_type)->original_image_index;
}
sprite = GetDefaultTrainSprite(spritenum, direction);
@@ -625,7 +625,7 @@ static SpriteID GetRailIcon(EngineID engine, bool rear_head, int &y)
return sprite;
}
- spritenum = Engine::Get(engine)->image_index;
+ spritenum = Engine::Get(engine)->original_image_index;
}
if (rear_head) spritenum++;