diff options
author | smatz <smatz@openttd.org> | 2008-02-20 12:07:22 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-02-20 12:07:22 +0000 |
commit | 169ac7c91da69d0b11dc78b7e9212ce50d4503dc (patch) | |
tree | 728361e17d5b3994754a8255263ea72824e5d2f6 /src | |
parent | 595d9357c35267245d733d741a8deacce0660b59 (diff) | |
download | openttd-169ac7c91da69d0b11dc78b7e9212ce50d4503dc.tar.xz |
(svn r12189) -Codechange: mark some functions in train_cmd.cpp inline (called once or very short)
Diffstat (limited to 'src')
-rw-r--r-- | src/train_cmd.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 9a9f0a2f7..c4c18910e 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1544,7 +1544,7 @@ static void UpdateVarsAfterSwap(Vehicle *v) EndVehicleMove(v); } -static void SetLastSpeed(Vehicle* v, int spd) +static inline void SetLastSpeed(Vehicle* v, int spd) { int old = v->u.rail.last_speed; if (spd != old) { @@ -2771,7 +2771,7 @@ static const Direction _new_vehicle_direction_table[11] = { DIR_E , DIR_SE, DIR_S }; -static Direction GetNewVehicleDirectionByTile(TileIndex new_tile, TileIndex old_tile) +static inline Direction GetNewVehicleDirectionByTile(TileIndex new_tile, TileIndex old_tile) { uint offs = (TileY(new_tile) - TileY(old_tile) + 1) * 4 + TileX(new_tile) - TileX(old_tile) + 1; @@ -2779,7 +2779,7 @@ static Direction GetNewVehicleDirectionByTile(TileIndex new_tile, TileIndex old_ return _new_vehicle_direction_table[offs]; } -static int GetDirectionToVehicle(const Vehicle *v, int x, int y) +static inline int GetDirectionToVehicle(const Vehicle *v, int x, int y) { byte offs; @@ -2802,7 +2802,7 @@ static int GetDirectionToVehicle(const Vehicle *v, int x, int y) } /* Check if the vehicle is compatible with the specified tile */ -static bool CheckCompatibleRail(const Vehicle *v, TileIndex tile) +static inline bool CheckCompatibleRail(const Vehicle *v, TileIndex tile) { return IsTileOwner(tile, v->owner) && ( @@ -2826,7 +2826,7 @@ static const RailtypeSlowdownParams _railtype_slowdown[] = { }; /** Modify the speed of the vehicle due to a turn */ -static void AffectSpeedByDirChange(Vehicle* v, Direction new_dir) +static inline void AffectSpeedByDirChange(Vehicle* v, Direction new_dir) { if (_patches.realistic_acceleration) return; @@ -2838,7 +2838,7 @@ static void AffectSpeedByDirChange(Vehicle* v, Direction new_dir) } /** Modify the speed of the vehicle due to a change in altitude */ -static void AffectSpeedByZChange(Vehicle *v, byte old_z) +static inline void AffectSpeedByZChange(Vehicle *v, byte old_z) { if (old_z == v->z_pos || _patches.realistic_acceleration) return; |