1
0
Fork 0

(svn r12128) -Codechange: Replace last use of TrainPlayLeaveStationSound(v) with v->PlayLeaveStationSound(), and remove wrapper function.

release/0.6
peter1138 2008-02-13 09:34:56 +00:00
parent 6bb9c474dd
commit df7327b453
1 changed files with 5 additions and 10 deletions

View File

@ -2202,7 +2202,7 @@ static void HandleLocomotiveSmokeCloud(const Vehicle* v)
if (sound) PlayVehicleSound(u, VSE_TRAIN_EFFECT); if (sound) PlayVehicleSound(u, VSE_TRAIN_EFFECT);
} }
static void TrainPlayLeaveStationSound(const Vehicle* v) void Train::PlayLeaveStationSound() const
{ {
static const SoundFx sfx[] = { static const SoundFx sfx[] = {
SND_04_TRAIN, SND_04_TRAIN,
@ -2212,15 +2212,10 @@ static void TrainPlayLeaveStationSound(const Vehicle* v)
SND_41_MAGLEV SND_41_MAGLEV
}; };
if (PlayVehicleSound(v, VSE_START)) return; if (PlayVehicleSound(this, VSE_START)) return;
EngineID engtype = v->engine_type; EngineID engtype = this->engine_type;
SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], v); SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], this);
}
void Train::PlayLeaveStationSound() const
{
TrainPlayLeaveStationSound(this);
} }
static bool CheckTrainStayInDepot(Vehicle *v) static bool CheckTrainStayInDepot(Vehicle *v)
@ -2253,7 +2248,7 @@ static bool CheckTrainStayInDepot(Vehicle *v)
VehicleServiceInDepot(v); VehicleServiceInDepot(v);
InvalidateWindowClasses(WC_TRAINS_LIST); InvalidateWindowClasses(WC_TRAINS_LIST);
TrainPlayLeaveStationSound(v); v->PlayLeaveStationSound();
v->u.rail.track = TRACK_BIT_X; v->u.rail.track = TRACK_BIT_X;
if (v->direction & 2) v->u.rail.track = TRACK_BIT_Y; if (v->direction & 2) v->u.rail.track = TRACK_BIT_Y;