mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r16580) -Codechange: rename Engine::image_index to original_image_index to not confuse it with image_index from *VehInfo.
This commit is contained in:
parent
2df1a2119c
commit
ee96d737b2
@ -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];
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
|
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user