diff options
author | rubidium <rubidium@openttd.org> | 2007-05-01 16:35:14 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-05-01 16:35:14 +0000 |
commit | a4e045a3fbb04a7020d47caf0e2ac41d630df817 (patch) | |
tree | 3af9b32e32882e876dac13b47e51e15d2bba5c06 /src/vehicle.h | |
parent | 2ccee752fde0f4ff93c210f0801fefa2848c8ccf (diff) | |
download | openttd-a4e045a3fbb04a7020d47caf0e2ac41d630df817.tar.xz |
(svn r9760) -Codechange: remove the need for saving some vehicle variables.
Diffstat (limited to 'src/vehicle.h')
-rw-r--r-- | src/vehicle.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/vehicle.h b/src/vehicle.h index 2a1b75d25..dd9ca71ba 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -358,6 +358,13 @@ struct Vehicle { * Marks the vehicles to be redrawn and updates cached variables */ virtual void MarkDirty() {} + + /** + * Updates the x and y offsets and the size of the sprite used + * for this vehicle. + * @param direction the direction the vehicle is facing + */ + virtual void UpdateDeltaXY(Direction direction) {} }; /** @@ -383,6 +390,7 @@ struct SpecialVehicle : public Vehicle { virtual ~SpecialVehicle() {} const char *GetTypeString() { return "special vehicle"; } + void UpdateDeltaXY(Direction direction); }; /** @@ -401,6 +409,7 @@ struct DisasterVehicle : public Vehicle { virtual ~DisasterVehicle() {} const char *GetTypeString() { return "disaster vehicle"; } + void UpdateDeltaXY(Direction direction); }; /** @@ -410,9 +419,6 @@ struct DisasterVehicle : public Vehicle { * v = new (v) Train(); * * As side-effect the vehicle type is set correctly. - * - * An invalid vehicle must never be used; all (virtual) functions from - * Vehicle should assert (NOT_REACHED). */ struct InvalidVehicle : public Vehicle { /** Initializes the Vehicle to a invalid vehicle */ @@ -422,7 +428,6 @@ struct InvalidVehicle : public Vehicle { virtual ~InvalidVehicle() {} const char *GetTypeString() { return "invalid vehicle"; } - void MarkDirty() { NOT_REACHED(); } }; #define is_custom_sprite(x) (x >= 0xFD) |