From 653e7fa54843b4427908b47d2e7da8ee48071a18 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Wed, 27 Sep 2006 18:17:01 +0000 Subject: (svn r6532) - Feature: Add support for NewGRF sound effects. Currently sound priority isn't supported. --- ship_cmd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'ship_cmd.c') 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) -- cgit v1.2.3-70-g09d2