summaryrefslogtreecommitdiff
path: root/ship_cmd.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-09-27 18:17:01 +0000
committerpeter1138 <peter1138@openttd.org>2006-09-27 18:17:01 +0000
commit653e7fa54843b4427908b47d2e7da8ee48071a18 (patch)
tree89f67db5c4825d95a0c5687363b43db1311ffae7 /ship_cmd.c
parent3ded010d91a755f3f719d5bfe91cda6d161ef2d0 (diff)
downloadopenttd-653e7fa54843b4427908b47d2e7da8ee48071a18.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.c11
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)