diff options
author | rubidium <rubidium@openttd.org> | 2007-07-01 19:11:47 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-01 19:11:47 +0000 |
commit | c0e341ee05792cc692d19a8ed80aeebc05d3af0e (patch) | |
tree | 2e6180dd4e262fcc66cf94a5d26c4c6fb7df642f /src/ship_cmd.cpp | |
parent | 162617eeb398d7a67afccc57afb21e27f41988b3 (diff) | |
download | openttd-c0e341ee05792cc692d19a8ed80aeebc05d3af0e.tar.xz |
(svn r10408) -Codechange: make GetImage a class method of Vehicle instead of Get(Aircraft|RoadVeh|Ship|Train)Image.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index f98fde144..555af11b5 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -90,15 +90,15 @@ void GetShipSpriteSize(EngineID engine, uint &width, uint &height) height = spr->height; } -int GetShipImage(const Vehicle* v, Direction direction) +int Ship::GetImage(Direction direction) const { - int spritenum = v->spritenum; + int spritenum = this->spritenum; if (is_custom_sprite(spritenum)) { - int sprite = GetCustomVehicleSprite(v, direction); + int sprite = GetCustomVehicleSprite(this, direction); if (sprite != 0) return sprite; - spritenum = orig_ship_vehicle_info[v->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; } @@ -233,7 +233,7 @@ static void HandleBrokenShip(Vehicle *v) void Ship::MarkDirty() { - this->cur_image = GetShipImage(this, this->direction); + this->cur_image = this->GetImage(this->direction); MarkAllViewportsDirty(this->left_coord, this->top_coord, this->right_coord + 1, this->bottom_coord + 1); } @@ -337,7 +337,7 @@ void Ship::UpdateDeltaXY(Direction direction) void RecalcShipStuff(Vehicle *v) { v->UpdateDeltaXY(v->direction); - v->cur_image = GetShipImage(v, v->direction); + v->cur_image = v->GetImage(v->direction); v->MarkDirty(); InvalidateWindow(WC_VEHICLE_DEPOT, v->tile); } @@ -770,7 +770,7 @@ static void ShipController(Vehicle *v) getout: v->UpdateDeltaXY(dir); - v->cur_image = GetShipImage(v, dir); + v->cur_image = v->GetImage(dir); VehiclePositionChanged(v); EndVehicleMove(v); return; |