diff options
author | peter1138 <peter1138@openttd.org> | 2006-09-27 18:17:01 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-09-27 18:17:01 +0000 |
commit | 8b2e4e970ad3379fb294934e7720128986220d0e (patch) | |
tree | 89f67db5c4825d95a0c5687363b43db1311ffae7 /ship_cmd.c | |
parent | def6a391a0cca03132a4cdfea2f7bd53a3a25bdf (diff) | |
download | openttd-8b2e4e970ad3379fb294934e7720128986220d0e.tar.xz |
(svn r6532) - Feature: Add support for NewGRF sound effects. Currently sound priority isn't supported.
Diffstat (limited to 'ship_cmd.c')
-rw-r--r-- | ship_cmd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ship_cmd.c b/ship_cmd.c index 371a51e7f..f39e5d6ac 100644 --- a/ship_cmd.c +++ b/ship_cmd.c @@ -25,6 +25,7 @@ #include "debug.h" #include "newgrf_callbacks.h" #include "newgrf_text.h" +#include "newgrf_sound.h" #include "date.h" static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D}; @@ -173,8 +174,10 @@ static void HandleBrokenShip(Vehicle *v) InvalidateWindow(WC_VEHICLE_VIEW, v->index); InvalidateWindow(WC_VEHICLE_DETAILS, v->index); - SndPlayVehicleFx((_opt.landscape != LT_CANDY) ? - SND_10_TRAIN_BREAKDOWN : SND_3A_COMEDY_BREAKDOWN_2, v); + if (!PlayVehicleSound(v, VSE_BREAKDOWN)) { + SndPlayVehicleFx((_opt.landscape != LT_CANDY) ? + SND_10_TRAIN_BREAKDOWN : SND_3A_COMEDY_BREAKDOWN_2, v); + } if (!(v->vehstatus & VS_HIDDEN)) { Vehicle *u = CreateEffectVehicleRel(v, 4, 4, 5, EV_BREAKDOWN_SMOKE); @@ -198,7 +201,9 @@ static void MarkShipDirty(Vehicle *v) static void PlayShipSound(Vehicle *v) { - SndPlayVehicleFx(ShipVehInfo(v->engine_type)->sfx, v); + if (!PlayVehicleSound(v, VSE_START)) { + SndPlayVehicleFx(ShipVehInfo(v->engine_type)->sfx, v); + } } static void ProcessShipOrder(Vehicle *v) |