summaryrefslogtreecommitdiff
path: root/src/vehicle.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-01 19:11:47 +0000
committerrubidium <rubidium@openttd.org>2007-07-01 19:11:47 +0000
commitc0e341ee05792cc692d19a8ed80aeebc05d3af0e (patch)
tree2e6180dd4e262fcc66cf94a5d26c4c6fb7df642f /src/vehicle.h
parent162617eeb398d7a67afccc57afb21e27f41988b3 (diff)
downloadopenttd-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/vehicle.h')
-rw-r--r--src/vehicle.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/vehicle.h b/src/vehicle.h
index df587b84b..8d2ac0e08 100644
--- a/src/vehicle.h
+++ b/src/vehicle.h
@@ -420,6 +420,13 @@ struct Vehicle {
* basically, if GetFirstVehicleInChain() can be called for it.
*/
virtual bool HasFront() const { return false; }
+
+ /**
+ * Gets the sprite to show for the given direction
+ * @param direction the direction the vehicle is facing
+ * @return the sprite for the given vehicle in the given direction
+ */
+ virtual int GetImage(Direction direction) const { return 0; }
};
/**
@@ -520,11 +527,6 @@ CommandCost GetRefitCost(EngineID engine_type);
void ViewportAddVehicles(DrawPixelInfo *dpi);
-/* train_cmd.h */
-int GetTrainImage(const Vehicle* v, Direction direction);
-int GetAircraftImage(const Vehicle* v, Direction direction);
-int GetRoadVehImage(const Vehicle* v, Direction direction);
-int GetShipImage(const Vehicle* v, Direction direction);
SpriteID GetRotorImage(const Vehicle *v);
Vehicle *CreateEffectVehicle(int x, int y, int z, EffectVehicle type);