summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-21 11:29:01 +0000
committerrubidium <rubidium@openttd.org>2008-04-21 11:29:01 +0000
commita40bba8bace426b961d31f5b0362629044c0766e (patch)
tree05dfb2564e3487afc402523c5fbe4b764fc97d54 /src/newgrf_station.cpp
parent2a779a5e100be9133e21b5645d90d0d390af9ecd (diff)
downloadopenttd-a40bba8bace426b961d31f5b0362629044c0766e.tar.xz
(svn r12817) -Feature: the ability to play NewGRF sounds for industries and stations.
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index aa81743bf..edb49515f 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -16,6 +16,7 @@
#include "newgrf_commons.h"
#include "newgrf_station.h"
#include "newgrf_spritegroup.h"
+#include "newgrf_sound.h"
#include "cargotype.h"
#include "town_map.h"
#include "newgrf_town.h"
@@ -901,6 +902,10 @@ void AnimateStationTile(TileIndex tile)
frame = callback & 0xFF;
break;
}
+
+ /* If the lower 7 bits of the upper byte of the callback
+ * result are not empty, it is a sound effect. */
+ if (GB(callback, 8, 7) != 0) PlayTileSound(ss->grffile, GB(callback, 8, 7), tile);
}
}
@@ -935,6 +940,10 @@ static void ChangeStationAnimationFrame(const StationSpec *ss, const Station *st
AddAnimatedTile(tile);
break;
}
+
+ /* If the lower 7 bits of the upper byte of the callback
+ * result are not empty, it is a sound effect. */
+ if (GB(callback, 8, 7) != 0) PlayTileSound(ss->grffile, GB(callback, 8, 7), tile);
}
enum TriggerArea {