summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-12-04 09:26:39 +0000
committertron <tron@openttd.org>2004-12-04 09:26:39 +0000
commit291d25a88bfcc8fa5e10b383ceaf03c446e032f5 (patch)
treec64a0b16a280a9b4e7a310e747e96bca0821aa0e
parentb88fc15e4744dd7bcba649ac399f1f07fbcab769 (diff)
downloadopenttd-291d25a88bfcc8fa5e10b383ceaf03c446e032f5.tar.xz
(svn r925) Use sound enums
Also play the correct sound when a toyland road vehicle breaks down
-rw-r--r--aircraft_cmd.c6
-rw-r--r--airport_gui.c6
-rw-r--r--bridge_gui.c2
-rw-r--r--disaster_cmd.c10
-rw-r--r--dock_gui.c6
-rw-r--r--economy.c2
-rw-r--r--industry_cmd.c38
-rw-r--r--main_gui.c48
-rw-r--r--misc_gui.c2
-rw-r--r--news_gui.c2
-rw-r--r--players.c4
-rw-r--r--rail_cmd.c4
-rw-r--r--rail_gui.c24
-rw-r--r--road_cmd.c4
-rw-r--r--road_gui.c14
-rw-r--r--roadveh_cmd.c10
-rw-r--r--ship_cmd.c3
-rw-r--r--smallmap_gui.c6
-rw-r--r--terraform_gui.c2
-rw-r--r--train_cmd.c14
-rw-r--r--tree_cmd.c9
-rw-r--r--tunnelbridge_cmd.c2
-rw-r--r--vehicle.c4
-rw-r--r--water_cmd.c2
24 files changed, 118 insertions, 106 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c
index 5dddf907a..5da1823fb 100644
--- a/aircraft_cmd.c
+++ b/aircraft_cmd.c
@@ -734,7 +734,7 @@ static bool Aircraft_5(Vehicle *v)
if (u->cur_speed > 32) {
v->cur_speed = 0;
if (--u->cur_speed == 32) {
- SndPlayVehicleFx(0x16, v);
+ SndPlayVehicleFx(SND_18_HELICOPTER, v);
}
} else {
u->cur_speed = 32;
@@ -1098,7 +1098,7 @@ static void MaybeCrashAirplane(Vehicle *v)
0);
ModifyStationRatingAround(TILE_FROM_XY(v->x_pos, v->y_pos), v->owner, -160, 30);
- SndPlayVehicleFx(16, v);
+ SndPlayVehicleFx(SND_12_EXPLOSION, v);
}
// we've landed and just arrived at a terminal
@@ -1182,7 +1182,7 @@ static void AircraftLand(Vehicle *v)
static void AircraftLandAirplane(Vehicle *v)
{
AircraftLand(v);
- SndPlayVehicleFx(0x15, v);
+ SndPlayVehicleFx(SND_17_SKID_PLANE, v);
MaybeCrashAirplane(v);
}
diff --git a/airport_gui.c b/airport_gui.c
index 2cd9c15a7..1d46cfbfe 100644
--- a/airport_gui.c
+++ b/airport_gui.c
@@ -19,7 +19,7 @@ static void ShowBuildAirportPicker();
static void CcBuildAirport(bool success, uint tile, uint32 p1, uint32 p2)
{
if (success) {
- SndPlayTileFx(0x1D, tile);
+ SndPlayTileFx(SND_1F_SPLAT, tile);
ResetObjectToPlace();
}
}
@@ -172,12 +172,12 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
break;
case 3: case 4: case 5: case 6: case 7:
_selected_airport_type = e->click.widget - 3;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
case 8: case 9:
_station_show_coverage = e->click.widget - 8;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
}
diff --git a/bridge_gui.c b/bridge_gui.c
index 731d217d2..02177790a 100644
--- a/bridge_gui.c
+++ b/bridge_gui.c
@@ -25,7 +25,7 @@ extern const StringID _bridge_material[MAX_BRIDGES];
static void CcBuildBridge(bool success, uint tile, uint32 p1, uint32 p2)
{
- if (success) { SndPlayTileFx(0x25, tile); }
+ if (success) SndPlayTileFx(SND_27_BLACKSMITH_ANVIL, tile);
}
static void BuildBridge(Window *w, int i)
diff --git a/disaster_cmd.c b/disaster_cmd.c
index 6d9b7646e..ed7d382db 100644
--- a/disaster_cmd.c
+++ b/disaster_cmd.c
@@ -208,7 +208,7 @@ static void DisasterTick_Zeppeliner(Vehicle *v)
if (++v->age == 1) {
CreateEffectVehicleRel(v, 0, 7, 8, EV_CRASHED_SMOKE);
- SndPlayVehicleFx(0x10, v);
+ SndPlayVehicleFx(SND_12_EXPLOSION, v);
v->u.disaster.image_override = 0xF42;
} else if (v->age == 70) {
v->u.disaster.image_override = 0xF43;
@@ -311,7 +311,7 @@ static void DisasterTick_UFO(Vehicle *v)
// destroy?
if (v->age > 50) {
CreateEffectVehicleRel(v, 0, 7, 8, EV_CRASHED_SMOKE);
- SndPlayVehicleFx(0x10, v);
+ SndPlayVehicleFx(SND_12_EXPLOSION, v);
DeleteDisasterVeh(v);
}
}
@@ -374,7 +374,7 @@ static void DisasterTick_2(Vehicle *v)
SetDParam(0, i->town->index);
AddNewsItem(STR_B002_OIL_REFINERY_EXPLOSION, NEWS_FLAGS(NM_THIN,NF_VIEWPORT|NF_TILE,NT_ACCIDENT,0), i->xy, 0);
- SndPlayTileFx(0x10, i->xy);
+ SndPlayTileFx(SND_12_EXPLOSION, i->xy);
}
} else if (v->next_order == 0) {
int x,y;
@@ -444,7 +444,7 @@ static void DisasterTick_3(Vehicle *v)
SetDParam(0, i->town->index);
AddNewsItem(STR_B003_FACTORY_DESTROYED_IN_SUSPICIOUS, NEWS_FLAGS(NM_THIN,NF_VIEWPORT|NF_TILE,NT_ACCIDENT,0), i->xy, 0);
- SndPlayTileFx(0x10, i->xy);
+ SndPlayTileFx(SND_12_EXPLOSION, i->xy);
}
} else if (v->next_order == 0) {
int x,y;
@@ -601,7 +601,7 @@ static void DisasterTick_4b(Vehicle *v)
v->next_order = 1;
CreateEffectVehicleRel(u, 0, 7, 8, EV_CRASHED_SMOKE);
- SndPlayVehicleFx(0x10, u);
+ SndPlayVehicleFx(SND_12_EXPLOSION, u);
DeleteDisasterVeh(u);
diff --git a/dock_gui.c b/dock_gui.c
index 1b024086f..26e3ee8ff 100644
--- a/dock_gui.c
+++ b/dock_gui.c
@@ -16,14 +16,14 @@ static byte _ship_depot_direction;
static void CcBuildDocks(bool success, uint tile, uint32 p1, uint32 p2)
{
if (success) {
- SndPlayTileFx(0, tile);
+ SndPlayTileFx(SND_02_SPLAT, tile);
ResetObjectToPlace();
}
}
static void CcBuildCanal(bool success, uint tile, uint32 p1, uint32 p2)
{
- if (success) { SndPlayTileFx(0, tile); }
+ if (success) SndPlayTileFx(SND_02_SPLAT, tile);
}
@@ -279,7 +279,7 @@ static void BuildDocksDepotWndProc(Window *w, WindowEvent *e)
case 3:
case 4:
_ship_depot_direction = e->click.widget - 3;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
UpdateDocksDirection();
SetWindowDirty(w);
break;
diff --git a/economy.c b/economy.c
index 0b6fc09b3..5cc54883d 100644
--- a/economy.c
+++ b/economy.c
@@ -1388,7 +1388,7 @@ int LoadUnloadVehicle(Vehicle *v)
SubtractMoneyFromPlayer(-profit);
if (_current_player == _local_player)
- SndPlayVehicleFx(0x12, v);
+ SndPlayVehicleFx(SND_14_CASHTILL, v);
ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, -profit);
}
diff --git a/industry_cmd.c b/industry_cmd.c
index edcef12f1..93d3b0578 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -473,8 +473,8 @@ static void AnimateTile_Industry(uint tile)
m = _map3_lo[tile] + 1;
switch(m & 7) {
- case 2: SndPlayTileFx(45, tile); break;
- case 6: SndPlayTileFx(41, tile); break;
+ case 2: SndPlayTileFx(SND_2D_RIP_2, tile); break;
+ case 6: SndPlayTileFx(SND_29_RIP, tile); break;
}
if (m >= 96) {
@@ -492,7 +492,7 @@ static void AnimateTile_Industry(uint tile)
m = _map3_lo[tile];
if (_industry_anim_offs[m] == 0xFF) {
- SndPlayTileFx(48, tile);
+ SndPlayTileFx(SND_30_CARTOON_SOUND, tile);
}
if (++m >= 70) {
@@ -538,11 +538,11 @@ static void AnimateTile_Industry(uint tile)
m = _map3_lo[tile] + 1;
if (m == 1) {
- SndPlayTileFx(44, tile);
+ SndPlayTileFx(SND_2C_MACHINERY, tile);
} else if (m == 23) {
- SndPlayTileFx(43, tile);
+ SndPlayTileFx(SND_2B_COMEDY_HIT, tile);
} else if (m == 28) {
- SndPlayTileFx(42, tile);
+ SndPlayTileFx(SND_2A_EXTRACT_AND_POP, tile);
}
if (m >= 50 && (m=0,++_map3_hi[tile] >= 8)) {
@@ -595,7 +595,7 @@ static void AnimateTile_Industry(uint tile)
if (state < 0x20 || state >= 0x180) {
if (! (_map_owner[tile] & 0x40)) {
_map_owner[tile] |= 0x40;
- SndPlayTileFx(9, tile);
+ SndPlayTileFx(SND_0B_MINING_MACHINERY, tile);
}
if (state & 7)
return;
@@ -684,7 +684,7 @@ static void TileLoopIndustryCase161(uint tile)
49, 59, 60, 65,
};
- SndPlayTileFx(46, tile);
+ SndPlayTileFx(SND_2E_EXTRACT_AND_POP, tile);
dir = Random() & 3;
@@ -770,7 +770,7 @@ static void TileLoop_Industry(uint tile)
case 10:
if (CHANCE16(1,3)) {
- SndPlayTileFx(10, tile);
+ SndPlayTileFx(SND_0C_ELECTRIC_SPARK, tile);
AddAnimatedTile(tile);
}
break;
@@ -998,7 +998,7 @@ static void ChopLumberMillTrees(Industry *i)
_current_player = OWNER_NONE;
_industry_sound_ctr = 1;
_industry_sound_tile = tile;
- SndPlayTileFx(56, tile);
+ SndPlayTileFx(SND_38_CHAINSAW, tile);
DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
SetMapExtraBits(tile, 0);
@@ -1018,19 +1018,19 @@ static void ChopLumberMillTrees(Industry *i)
static const byte _industry_sounds[37][2] = {
{0},
{0},
- {1,38},
+ {1, SND_28_SAWMILL},
{0},
{0},
{0},
- {1,1},
- {1,1},
+ {1, SND_03_FACTORY_WHISTLE},
+ {1, SND_03_FACTORY_WHISTLE},
{0},
- {3,34},
+ {3, SND_24_SHEEP},
{0},
{0},
{0},
{0},
- {1,38},
+ {1, SND_28_SAWMILL},
{0},
{0},
{0},
@@ -1039,7 +1039,7 @@ static const byte _industry_sounds[37][2] = {
{0},
{0},
{0},
- {1,1},
+ {1, SND_03_FACTORY_WHISTLE},
{0},
{0},
{0},
@@ -1048,7 +1048,7 @@ static const byte _industry_sounds[37][2] = {
{0},
{0},
{0},
- {1,51},
+ {1, SND_33_PLASTIC_MINE},
{0},
{0},
{0},
@@ -1092,10 +1092,10 @@ void OnTick_Industry()
_industry_sound_ctr++;
if (_industry_sound_ctr == 75) {
- SndPlayTileFx(55, _industry_sound_tile);
+ SndPlayTileFx(SND_37_BALLOON_SQUEAK, _industry_sound_tile);
} else if (_industry_sound_ctr == 160) {
_industry_sound_ctr = 0;
- SndPlayTileFx(54, _industry_sound_tile);
+ SndPlayTileFx(SND_36_CARTOON_CRASH, _industry_sound_tile);
}
}
diff --git a/main_gui.c b/main_gui.c
index 0fec015fe..be5993018 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -63,7 +63,7 @@ bool HandlePlacePushButton(Window *w, int widget, uint32 cursor, int mode, Place
if (w->disabled_state & mask)
return false;
- if (!_no_button_sound) SndPlayFx(0x13);
+ if (!_no_button_sound) SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
if (w->click_state & mask) {
@@ -80,7 +80,7 @@ bool HandlePlacePushButton(Window *w, int widget, uint32 cursor, int mode, Place
void CcPlaySound10(bool success, uint tile, uint32 p1, uint32 p2)
{
- if (success) { SndPlayTileFx(0x10, tile); }
+ if (success) SndPlayTileFx(SND_12_EXPLOSION, tile);
}
@@ -91,13 +91,13 @@ static void ToolbarPauseClick(Window *w)
if (_networking && !_networking_server) { return;} // only server can pause the game
if (DoCommandP(0, _pause?0:1, 0, NULL, CMD_PAUSE | CMD_NET_INSTANT))
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
}
static void ToolbarFastForwardClick(Window *w)
{
_fast_forward ^= true;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
}
@@ -596,7 +596,7 @@ static Window *PopupMainToolbMenu(Window *w, int x, int main_button, StringID ba
_popup_menu_active = true;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
return w;
}
@@ -617,7 +617,7 @@ static Window *PopupMainPlayerToolbMenu(Window *w, int x, int main_button, int g
WP(w,menu_d).main_button = main_button;
WP(w,menu_d).checked_items = gray;
_popup_menu_active = true;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
return w;
}
@@ -781,7 +781,7 @@ static void ToolbarZoomInClick(Window *w)
{
if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) {
HandleButtonClick(w, 17);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
}
}
@@ -789,7 +789,7 @@ static void ToolbarZoomOutClick(Window *w)
{
if (DoZoomInOutWindow(ZOOM_OUT,FindWindowById(WC_MAIN_WINDOW, 0))) {
HandleButtonClick(w, 18);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
}
}
@@ -894,7 +894,7 @@ static void ToolbarScenZoomIn(Window *w)
{
if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) {
HandleButtonClick(w, 9);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
}
}
@@ -902,7 +902,7 @@ static void ToolbarScenZoomOut(Window *w)
{
if (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0))) {
HandleButtonClick(w, 10);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
}
}
@@ -966,7 +966,7 @@ static void AskResetLandscapeWndProc(Window *w, WindowEvent *e)
ResetLandscape();
}
else { // make random landscape
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
_switch_mode = SM_GENRANDLAND;
}
@@ -991,7 +991,7 @@ static void AskResetLandscape(uint mode)
static void CcTerraform(bool success, uint tile, uint32 p1, uint32 p2)
{
if (success) {
- SndPlayTileFx(0x1D, tile);
+ SndPlayTileFx(SND_1F_SPLAT, tile);
} else {
SetRedErrorSquare(_terraform_err_tile);
}
@@ -1011,7 +1011,7 @@ static void CommonRaiseLowerBigLand(uint tile, int mode)
if (_terraform_size == 1) {
DoCommandP(tile, 8, (uint32)mode, CcTerraform, CMD_TERRAFORM_LAND | CMD_AUTO);
} else {
- SndPlayTileFx(0x1D, tile);
+ SndPlayTileFx(SND_1F_SPLAT, tile);
size = _terraform_size;
assert(size != 0);
@@ -1070,7 +1070,7 @@ static void PlaceProc_RockyArea(uint tile)
_map5[tile] = (_map5[tile] & ~0x1C) | 8;
MarkTileDirtyByTile(tile);
- SndPlayTileFx(0x1D, tile);
+ SndPlayTileFx(SND_1F_SPLAT, tile);
}
static void PlaceProc_LightHouse(uint tile)
@@ -1082,7 +1082,7 @@ static void PlaceProc_LightHouse(uint tile)
return;
ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAP5, 1);
- SndPlayTileFx(0x1D, tile);
+ SndPlayTileFx(SND_1F_SPLAT, tile);
}
static void PlaceProc_Transmitter(uint tile)
@@ -1094,7 +1094,7 @@ static void PlaceProc_Transmitter(uint tile)
return;
ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAP5, 0);
- SndPlayTileFx(0x1D, tile);
+ SndPlayTileFx(SND_1F_SPLAT, tile);
}
static void PlaceProc_Desert(uint tile)
@@ -1180,7 +1180,7 @@ terraform_size_common:;
if (!IS_INT_INSIDE(size, 1, 8+1))
return;
_terraform_size = size;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
}
@@ -1252,7 +1252,7 @@ static const WindowDesc _scen_edit_land_gen_desc = {
static void ToolbarScenGenLand(Window *w)
{
HandleButtonClick(w, 11);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
AllocateWindowDescFront(&_scen_edit_land_gen_desc, 0);
}
@@ -1260,7 +1260,7 @@ static void ToolbarScenGenLand(Window *w)
static void CcBuildTown(bool success, uint tile, uint32 p1, uint32 p2)
{
if (success) {
- SndPlayTileFx(0x1D, tile);
+ SndPlayTileFx(SND_1F_SPLAT, tile);
ResetObjectToPlace();
}
}
@@ -1350,7 +1350,7 @@ static const WindowDesc _scen_edit_town_gen_desc = {
static void ToolbarScenGenTown(Window *w)
{
HandleButtonClick(w, 12);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
AllocateWindowDescFront(&_scen_edit_town_gen_desc, 0);
}
@@ -1594,28 +1594,28 @@ static const WindowDesc * const _scenedit_industry_descs[] = {
static void ToolbarScenGenIndustry(Window *w)
{
HandleButtonClick(w, 13);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
AllocateWindowDescFront(_scenedit_industry_descs[_opt.landscape],0);
}
static void ToolbarScenBuildRoad(Window *w)
{
HandleButtonClick(w, 14);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
ShowBuildRoadScenToolbar();
}
static void ToolbarScenPlantTrees(Window *w)
{
HandleButtonClick(w, 15);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
ShowBuildTreesScenToolbar();
}
static void ToolbarScenPlaceSign(Window *w)
{
HandleButtonClick(w, 16);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SelectSignTool();
}
diff --git a/misc_gui.c b/misc_gui.c
index ecde8b78c..5b166d247 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -267,7 +267,7 @@ static void BuildTreesWndProc(Window *w, WindowEvent *e)
case 16: /* place trees randomly over the landscape*/
w->click_state |= 1 << 16;
w->flags4 |= 5 << WF_TIMEOUT_SHL;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
PlaceTreesRandomly();
MarkWholeScreenDirty();
break;
diff --git a/news_gui.c b/news_gui.c
index 632c53632..af804f226 100644
--- a/news_gui.c
+++ b/news_gui.c
@@ -369,7 +369,7 @@ static void ShowTicker(const NewsItem *ni)
{
Window *w;
- SndPlayFx(20);
+ SndPlayFx(SND_16_MORSE);
_statusbar_news_item = *ni;
w = FindWindowById(WC_STATUS_BAR, 0);
if (w != NULL)
diff --git a/players.c b/players.c
index 2f0c193f1..4cfd5522c 100644
--- a/players.c
+++ b/players.c
@@ -592,9 +592,9 @@ void PlayersYearlyLoop()
ShowPlayerFinances(_local_player);
p = DEREF_PLAYER(_local_player);
if (p->num_valid_stat_ent > 5 && p->old_economy[0].performance_history < p->old_economy[4].performance_history) {
- SndPlayFx(0x28);
+ SndPlayFx(SND_01_BAD_YEAR);
} else {
- SndPlayFx(0x27);
+ SndPlayFx(SND_00_GOOD_YEAR);
}
}
}
diff --git a/rail_cmd.c b/rail_cmd.c
index 19f84a8d2..335b37c76 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -542,7 +542,7 @@ int32 CmdBuildRailroadTrack(int x, int y, uint32 flags, uint32 p1, uint32 p2)
int railbit;
if (flags & DC_EXEC)
- SndPlayTileFx(0x1E, TILE_FROM_XY(x,y));
+ SndPlayTileFx(SND_20_SPLAT_2, TILE_FROM_XY(x,y));
/* unpack end point */
sx = (p1 & 0xFFFF) & ~0xF;
@@ -592,7 +592,7 @@ int32 CmdRemoveRailroadTrack(int x, int y, uint32 flags, uint32 p1, uint32 p2)
int railbit;
if (flags & DC_EXEC)
- SndPlayTileFx(0x1E, TILE_FROM_XY(x,y));
+ SndPlayTileFx(SND_20_SPLAT_2, TILE_FROM_XY(x,y));
/* unpack start point */
sx = (p1 & 0xFFFF) & ~0xF;
diff --git a/rail_gui.c b/rail_gui.c
index 05040cb84..a166a4c6f 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -33,7 +33,7 @@ typedef void OnButtonClick(Window *w);
static void CcPlaySound1E(bool success, uint tile, uint32 p1, uint32 p2)
{
- if (success) SndPlayTileFx(0x1E, tile);
+ if (success) SndPlayTileFx(SND_20_SPLAT_2, tile);
}
static void GenericPlaceRail(uint tile, int cmd)
@@ -96,7 +96,7 @@ static void CcDepot(bool success, uint tile, uint32 p1, uint32 p2)
if (success) {
int dir = p2;
- SndPlayTileFx(0x1E, tile);
+ SndPlayTileFx(SND_20_SPLAT_2, tile);
ResetObjectToPlace();
tile += _place_depot_offs_xy[dir];
@@ -127,7 +127,7 @@ static void PlaceRail_Waypoint(uint tile)
static void CcStation(bool success, uint tile, uint32 p1, uint32 p2)
{
if (success) {
- SndPlayTileFx(0x1E, tile);
+ SndPlayTileFx(SND_20_SPLAT_2, tile);
ResetObjectToPlace();
}
}
@@ -183,7 +183,7 @@ static void PlaceRail_Bridge(uint tile)
static void CcBuildTunnel(bool success, uint tile, uint32 p1, uint32 p2)
{
if (success) {
- SndPlayTileFx(0x1E, tile);
+ SndPlayTileFx(SND_20_SPLAT_2, tile);
ResetObjectToPlace();
} else {
SetRedErrorSquare(_build_tunnel_endtile);
@@ -287,7 +287,7 @@ static void BuildRailClick_Remove(Window *w)
if (w->disabled_state & (1<<16))
return;
SetWindowDirty(w);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
_thd.make_square_red = !!((w->click_state ^= (1 << 16)) & (1<<16));
MarkTileDirty(_thd.pos.x, _thd.pos.y);
@@ -900,7 +900,7 @@ static void StationBuildWndProc(Window *w, WindowEvent *e) {
case 3:
case 4:
_railstation.orientation = e->click.widget - 3;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
@@ -913,7 +913,7 @@ static void StationBuildWndProc(Window *w, WindowEvent *e) {
case 11:
_railstation.numtracks = (e->click.widget - 5) + 1;
_railstation.dragdrop = false;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
@@ -926,20 +926,20 @@ static void StationBuildWndProc(Window *w, WindowEvent *e) {
case 18:
_railstation.platlength = (e->click.widget - 12) + 1;
_railstation.dragdrop = false;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
case 19:
_railstation.dragdrop ^= true;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
case 20:
case 21:
_station_show_coverage = e->click.widget - 20;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
}
@@ -1025,7 +1025,7 @@ static void BuildTrainDepotWndProc(Window *w, WindowEvent *e)
case 5:
case 6:
_build_depot_direction = e->click.widget - 3;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
}
@@ -1091,7 +1091,7 @@ static void BuildWaypointWndProc(Window *w, WindowEvent *e)
case 6:
case 7:
_cur_waypoint_type = e->click.widget - 3;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
}
diff --git a/road_cmd.c b/road_cmd.c
index 75426cb55..a269171be 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -973,7 +973,7 @@ static void TileLoop_Road(uint tile)
if (GetTileSlope(tile, NULL) == 0 && EnsureNoVehicle(tile) && CHANCE16(1,20)) {
_map2[tile] = ((_map2[tile]&7) <= 1) ? 6 : 7;
- SndPlayTileFx(0x1F,tile);
+ SndPlayTileFx(SND_21_JACKHAMMER, tile);
CreateEffectVehicleAbove(
GET_TILE_X(tile) * 16 + 7,
GET_TILE_Y(tile) * 16 + 7,
@@ -1086,7 +1086,7 @@ static uint32 VehicleEnter_Road(Vehicle *v, uint tile, int x, int y)
if ((_map5[tile] & 0xF0) == 0x10) {
if (v->type == VEH_Train && (_map5[tile] & 4) == 0) {
/* train crossing a road */
- SndPlayVehicleFx(12, v);
+ SndPlayVehicleFx(SND_0E_LEVEL_CROSSING, v);
_map5[tile] |= 4;
MarkTileDirtyByTile(tile);
}
diff --git a/road_gui.c b/road_gui.c
index f28aff360..21be5360a 100644
--- a/road_gui.c
+++ b/road_gui.c
@@ -22,7 +22,7 @@ static byte _road_station_picker_orientation;
static void CcPlaySound1D(bool success, uint tile, uint32 p1, uint32 p2)
{
- if (success) { SndPlayTileFx(0x1D, tile); }
+ if (success) SndPlayTileFx(SND_1F_SPLAT, tile);
}
static void PlaceRoad_NE(uint tile)
@@ -46,7 +46,7 @@ static void PlaceRoad_Bridge(uint tile)
static void CcBuildTunnel(bool success, uint tile, uint32 p1, uint32 p2)
{
if (success) {
- SndPlayTileFx(0x1E, tile);
+ SndPlayTileFx(SND_20_SPLAT_2, tile);
ResetObjectToPlace();
} else {
SetRedErrorSquare(_build_tunnel_endtile);
@@ -71,7 +71,7 @@ static void BuildRoadOutsideStation(uint tile, int direction)
static void CcDepot(bool success, uint tile, uint32 p1, uint32 p2)
{
if (success) {
- SndPlayTileFx(0x1D, tile);
+ SndPlayTileFx(SND_1F_SPLAT, tile);
ResetObjectToPlace();
BuildRoadOutsideStation(tile, (int)p1);
}
@@ -159,7 +159,7 @@ static void BuildRoadClick_Remove(Window *w)
if (w->disabled_state & (1<<12))
return;
SetWindowDirty(w);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
_thd.make_square_red = !!((w->click_state ^= (1 << 12)) & (1<<12));
MarkTileDirty(_thd.pos.x, _thd.pos.y);
}
@@ -362,7 +362,7 @@ static void BuildRoadDepotWndProc(Window *w, WindowEvent *e) {
case 5:
case 6:
_road_depot_orientation = e->click.widget - 3;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
}
@@ -436,13 +436,13 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e) {
case 5:
case 6:
_road_station_picker_orientation = e->click.widget - 3;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
case 7:
case 8:
_station_show_coverage = e->click.widget - 7;
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
SetWindowDirty(w);
break;
}
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index 647237e07..7c5d8688a 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -503,7 +503,7 @@ static void RoadVehCrash(Vehicle *v)
0);
ModifyStationRatingAround(v->tile, v->owner, -160, 22);
- SndPlayVehicleFx(16, v);
+ SndPlayVehicleFx(SND_12_EXPLOSION, v);
}
static void RoadVehCheckTrainCrash(Vehicle *v)
@@ -536,7 +536,8 @@ static void HandleBrokenRoadVeh(Vehicle *v)
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
- SndPlayVehicleFx((_opt.landscape != LT_CANDY) ? 0xD : 0x34, v);
+ SndPlayVehicleFx((_opt.landscape != LT_CANDY) ?
+ SND_0F_VEHICLE_BREAKDOWN : SND_35_COMEDY_BREAKDOWN, v);
if (!(v->vehstatus & VS_HIDDEN)) {
Vehicle *u = CreateEffectVehicleRel(v, 4, 4, 5, EV_BREAKDOWN_SMOKE);
@@ -635,8 +636,9 @@ static void HandleRoadVehLoading(Vehicle *v)
static void StartRoadVehSound(Vehicle *v)
{
- int s = RoadVehInfo(v->engine_type)->sfx;
- if (s == 23 && (v->tick_counter&3) == 0) s++;
+ SoundFx s = RoadVehInfo(v->engine_type)->sfx;
+ if (s == SND_19_BUS_START_PULL_AWAY && (v->tick_counter & 3) == 0)
+ s = SND_1A_BUS_START_PULL_AWAY_WITH_HORN;
SndPlayVehicleFx(s, v);
}
diff --git a/ship_cmd.c b/ship_cmd.c
index 7c2dc0720..9865f746f 100644
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -157,7 +157,8 @@ static void HandleBrokenShip(Vehicle *v)
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
- SndPlayVehicleFx((_opt.landscape != LT_CANDY) ? 0xE : 0x3A, v);
+ 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);
diff --git a/smallmap_gui.c b/smallmap_gui.c
index 3cbca89a8..3f8debefe 100644
--- a/smallmap_gui.c
+++ b/smallmap_gui.c
@@ -881,7 +881,7 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
case 2: {/* big/small size */
// const Widget *wi = w->widget;
DeleteWindow(w);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
{
int i = _smallmap_size + 1;
if (i == 3) i = 0;
@@ -913,14 +913,14 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
_smallmap_type = e->click.widget - 5;
SetWindowDirty(w);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
break;
case 11: /* toggle town names */
w->click_state ^= (1 << 11);
_smallmap_show_towns = (w->click_state >> 11) & 1;
SetWindowDirty(w);
- SndPlayFx(0x13);
+ SndPlayFx(SND_15_BEEP);
break;
}
break;
diff --git a/terraform_gui.c b/terraform_gui.c
index 7704903be..f94ebf92b 100644
--- a/terraform_gui.c
+++ b/terraform_gui.c
@@ -13,7 +13,7 @@
static void CcTerraform(bool success, uint tile, uint32 p1, uint32 p2)
{
if (success) {
- SndPlayTileFx(0x1D, tile);
+ SndPlayTileFx(SND_1F_SPLAT, tile);
} else {
SetRedErrorSquare(_terraform_err_tile);
}
diff --git a/train_cmd.c b/train_cmd.c
index 568d1c90d..8f9b18782 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -1243,7 +1243,12 @@ static void HandleLocomotiveSmokeCloud(Vehicle *v)
static void TrainPlayLeaveStationSound(Vehicle *v)
{
- static const byte sfx[3] = { 0x2, 0x8, 0x8 };
+ static const SoundFx sfx[] = {
+ SND_04_TRAIN,
+ SND_0A_TRAIN_HORN,
+ SND_0A_TRAIN_HORN
+ };
+
int engtype = v->engine_type;
switch (_engines[engtype].railtype) {
@@ -2007,7 +2012,7 @@ static void CheckTrainCollision(Vehicle *v)
0);
ModifyStationRatingAround(v->tile, v->owner, -160, 30);
- SndPlayVehicleFx(17, v);
+ SndPlayVehicleFx(SND_13_BIG_CRASH, v);
}
static void *CheckVehicleAtSignal(Vehicle *v, void *data)
@@ -2320,7 +2325,8 @@ static void HandleBrokenTrain(Vehicle *v)
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
- SndPlayVehicleFx((_opt.landscape != LT_CANDY) ? 0xE : 0x3A, v);
+ 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);
@@ -2417,7 +2423,7 @@ static void TrainCheckIfLineEnds(Vehicle *v)
if (IS_TILETYPE(tile, MP_STREET) && (_map5[tile] & 0xF0)==0x10) {
if (!(_map5[tile] & 4)) {
_map5[tile] |= 4;
- SndPlayVehicleFx(12, v);
+ SndPlayVehicleFx(SND_0E_LEVEL_CROSSING, v);
MarkTileDirtyByTile(tile);
}
}
diff --git a/tree_cmd.c b/tree_cmd.c
index ed7946691..64590fa69 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -382,8 +382,11 @@ static void AnimateTile_Trees(uint tile)
/* not used */
}
-static byte _desert_sounds[] = {
- 66,67,68,72
+static SoundFx _desert_sounds[] = {
+ SND_42_LOON_BIRD,
+ SND_43_LION,
+ SND_44_MONKEYS,
+ SND_48_DISTANT_BIRD
};
static void TileLoopTreesDesert(uint tile)
@@ -440,7 +443,7 @@ static void TileLoopTreesAlps(uint tile)
if (tmp == 0xC0) {
uint32 r;
if (CHANCE16I(1,200,r=Random())) {
- SndPlayTileFx( (r&0x80000000) ? 57 : 52, tile);
+ SndPlayTileFx((r & 0x80000000) ? SND_39_HEAVY_WIND : SND_34_WIND, tile);
}
return;
} else {
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index 9930a9f1d..5ff825ddb 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -1407,7 +1407,7 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, uint tile, int x, int y)
if (v->u.rail.track != 0x40 && dir == vdir) {
if (v->subtype == 0 && fc == _tunnel_fractcoord_1[dir]) {
if (v->spritenum < 4)
- SndPlayVehicleFx(3, v);
+ SndPlayVehicleFx(SND_05_TRAIN_THROUGH_TUNNEL, v);
return 0;
}
if (fc == _tunnel_fractcoord_2[dir]) {
diff --git a/vehicle.c b/vehicle.c
index 69dc9f8d8..9c46bb13b 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1106,7 +1106,7 @@ again:
if (*b == 0x81) {
if (v->z_pos > 180 || CHANCE16(1,96)) {
v->spritenum = 5;
- SndPlayVehicleFx(0x2F, v);
+ SndPlayVehicleFx(SND_2F_POP, v);
}
et = 0;
goto again;
@@ -1116,7 +1116,7 @@ again:
uint tile;
et++;
- SndPlayVehicleFx(0x31, v);
+ SndPlayVehicleFx(SND_31_EXTRACT, v);
tile = TILE_FROM_XY(v->x_pos, v->y_pos);
if (IS_TILETYPE(tile, MP_INDUSTRY) &&
diff --git a/water_cmd.c b/water_cmd.c
index fc34b323b..9a7db7ad3 100644
--- a/water_cmd.c
+++ b/water_cmd.c
@@ -565,7 +565,7 @@ static void FloodVehicle(Vehicle *v)
0);
}
CreateEffectVehicleRel(v,4,4,8,EV_CRASHED_SMOKE); // show cool destruction effects
- SndPlayVehicleFx(16, v); // create sound
+ SndPlayVehicleFx(SND_12_EXPLOSION, v); // create sound
}
// called from tunnelbridge_cmd