diff options
author | frosch <frosch@openttd.org> | 2016-05-22 10:07:48 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2016-05-22 10:07:48 +0000 |
commit | 9aa33862a7abe113bdb594fb04a60926837b2ade (patch) | |
tree | 6dc8cc256f1edecca1e4da63d12812827ee5edfb /src | |
parent | 97e6981e39154d293056567bae84bac7f3202125 (diff) | |
download | openttd-9aa33862a7abe113bdb594fb04a60926837b2ade.tar.xz |
(svn r27571) -Codechange: Consistent naming for command callbacks which play a sound effect.
Diffstat (limited to 'src')
-rw-r--r-- | src/command_func.h | 8 | ||||
-rw-r--r-- | src/dock_gui.cpp | 6 | ||||
-rw-r--r-- | src/main_gui.cpp | 2 | ||||
-rw-r--r-- | src/network/network_command.cpp | 8 | ||||
-rw-r--r-- | src/rail_gui.cpp | 20 | ||||
-rw-r--r-- | src/road_gui.cpp | 8 | ||||
-rw-r--r-- | src/terraform_gui.cpp | 4 |
7 files changed, 28 insertions, 28 deletions
diff --git a/src/command_func.h b/src/command_func.h index c4cc51e3d..336947567 100644 --- a/src/command_func.h +++ b/src/command_func.h @@ -81,7 +81,7 @@ CommandCallback CcBuildBridge; /* dock_gui.cpp */ CommandCallback CcBuildDocks; -CommandCallback CcBuildCanal; +CommandCallback CcPlaySound_SPLAT_WATER; /* depot_gui.cpp */ CommandCallback CcCloneVehicle; @@ -97,19 +97,19 @@ CommandCallback CcAddVehicleNewGroup; CommandCallback CcBuildIndustry; /* main_gui.cpp */ -CommandCallback CcPlaySound10; +CommandCallback CcPlaySound_EXPLOSION; CommandCallback CcPlaceSign; CommandCallback CcTerraform; CommandCallback CcGiveMoney; /* rail_gui.cpp */ -CommandCallback CcPlaySound1E; +CommandCallback CcPlaySound_SPLAT_RAIL; CommandCallback CcRailDepot; CommandCallback CcStation; CommandCallback CcBuildRailTunnel; /* road_gui.cpp */ -CommandCallback CcPlaySound1D; +CommandCallback CcPlaySound_SPLAT_OTHER; CommandCallback CcBuildRoadTunnel; CommandCallback CcRoadDepot; CommandCallback CcRoadStop; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index f6699daef..c20920668 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -48,7 +48,7 @@ void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcBuildCanal(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcPlaySound_SPLAT_WATER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_SPLAT_WATER, tile); } @@ -235,10 +235,10 @@ struct BuildDocksToolbarWindow : Window { GUIPlaceProcDragXY(select_proc, start_tile, end_tile); break; case DDSP_CREATE_WATER: - DoCommandP(end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_BUILD_CANALS), CcBuildCanal); + DoCommandP(end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_BUILD_CANALS), CcPlaySound_SPLAT_WATER); break; case DDSP_CREATE_RIVER: - DoCommandP(end_tile, start_tile, WATER_CLASS_RIVER, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_PLACE_RIVERS), CcBuildCanal); + DoCommandP(end_tile, start_tile, WATER_CLASS_RIVER, CMD_BUILD_CANAL | CMD_MSG(STR_ERROR_CAN_T_PLACE_RIVERS), CcPlaySound_SPLAT_WATER); break; default: break; diff --git a/src/main_gui.cpp b/src/main_gui.cpp index cdef1e6a6..b13920a64 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -118,7 +118,7 @@ bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyl } -void CcPlaySound10(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcPlaySound_EXPLOSION(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_12_EXPLOSION, tile); } diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 6e5458fd8..bc08bc5f1 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -27,7 +27,7 @@ static CommandCallback * const _callback_table[] = { /* 0x01 */ CcBuildPrimaryVehicle, /* 0x02 */ CcBuildAirport, /* 0x03 */ CcBuildBridge, - /* 0x04 */ CcBuildCanal, + /* 0x04 */ CcPlaySound_SPLAT_WATER, /* 0x05 */ CcBuildDocks, /* 0x06 */ CcFoundTown, /* 0x07 */ CcBuildRoadTunnel, @@ -36,9 +36,9 @@ static CommandCallback * const _callback_table[] = { /* 0x0A */ CcRoadDepot, /* 0x0B */ CcRailDepot, /* 0x0C */ CcPlaceSign, - /* 0x0D */ CcPlaySound10, - /* 0x0E */ CcPlaySound1D, - /* 0x0F */ CcPlaySound1E, + /* 0x0D */ CcPlaySound_EXPLOSION, + /* 0x0E */ CcPlaySound_SPLAT_OTHER, + /* 0x0F */ CcPlaySound_SPLAT_RAIL, /* 0x10 */ CcStation, /* 0x11 */ CcTerraform, /* 0x12 */ CcAI, diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 3a903fbe7..64a1126d8 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -86,7 +86,7 @@ static bool IsStationAvailable(const StationSpec *statspec) return Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res); } -void CcPlaySound1E(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcPlaySound_SPLAT_RAIL(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_RAIL, tile); } @@ -97,7 +97,7 @@ static void GenericPlaceRail(TileIndex tile, int cmd) _remove_button_clicked ? CMD_REMOVE_SINGLE_RAIL | CMD_MSG(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK) : CMD_BUILD_SINGLE_RAIL | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK), - CcPlaySound1E); + CcPlaySound_SPLAT_RAIL); } /** @@ -223,7 +223,7 @@ static void GenericPlaceSignals(TileIndex tile) Track track = FindFirstTrack(trackbits); if (_remove_button_clicked) { - DoCommandP(tile, track, 0, CMD_REMOVE_SIGNALS | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM), CcPlaySound1E); + DoCommandP(tile, track, 0, CMD_REMOVE_SIGNALS | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM), CcPlaySound_SPLAT_RAIL); } else { const Window *w = FindWindowById(WC_BUILD_SIGNAL, 0); @@ -250,7 +250,7 @@ static void GenericPlaceSignals(TileIndex tile) DoCommandP(tile, p1, 0, CMD_BUILD_SIGNALS | CMD_MSG((w != NULL && _convert_signal_button) ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE), - CcPlaySound1E); + CcPlaySound_SPLAT_RAIL); } } @@ -355,7 +355,7 @@ static void DoRailroadTrack(int mode) _remove_button_clicked ? CMD_REMOVE_RAILROAD_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK) : CMD_BUILD_RAILROAD_TRACK | CMD_MSG(STR_ERROR_CAN_T_BUILD_RAILROAD_TRACK), - CcPlaySound1E); + CcPlaySound_SPLAT_RAIL); } static void HandleAutodirPlacement() @@ -410,7 +410,7 @@ static void HandleAutoSignalPlacement() _remove_button_clicked ? CMD_REMOVE_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM) : CMD_BUILD_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE), - CcPlaySound1E); + CcPlaySound_SPLAT_RAIL); } @@ -710,7 +710,7 @@ struct BuildRailToolbarWindow : Window { break; case DDSP_CONVERT_RAIL: - DoCommandP(end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 0x10 : 0), CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound1E); + DoCommandP(end_tile, start_tile, _cur_railtype | (_ctrl_pressed ? 0x10 : 0), CMD_CONVERT_RAIL | CMD_MSG(STR_ERROR_CAN_T_CONVERT_RAIL), CcPlaySound_SPLAT_RAIL); break; case DDSP_REMOVE_STATION: @@ -718,20 +718,20 @@ struct BuildRailToolbarWindow : Window { if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) { /* Station */ if (_remove_button_clicked) { - DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION), CcPlaySound1E); + DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_STATION | CMD_MSG(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION), CcPlaySound_SPLAT_RAIL); } else { HandleStationPlacement(start_tile, end_tile); } } else { /* Waypoint */ if (_remove_button_clicked) { - DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT), CcPlaySound1E); + DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT), CcPlaySound_SPLAT_RAIL); } else { TileArea ta(start_tile, end_tile); uint32 p1 = _cur_railtype | (select_method == VPM_FIX_X ? AXIS_X : AXIS_Y) << 4 | ta.w << 8 | ta.h << 16 | _ctrl_pressed << 24; uint32 p2 = STAT_CLASS_WAYP | _cur_waypoint_type << 8 | INVALID_STATION << 16; - CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT), CcPlaySound1E, "" }; + CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT), CcPlaySound_SPLAT_RAIL, "" }; ShowSelectWaypointIfNeeded(cmdcont, ta); } } diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 92c660e8a..03dd12bbf 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -64,7 +64,7 @@ static RoadType _cur_roadtype; static DiagDirection _road_depot_orientation; static DiagDirection _road_station_picker_orientation; -void CcPlaySound1D(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcPlaySound_SPLAT_OTHER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT_OTHER, tile); } @@ -629,7 +629,7 @@ struct BuildRoadToolbarWindow : Window { DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5), _remove_button_clicked ? CMD_REMOVE_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) : - CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound1D); + CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound_SPLAT_OTHER); break; case DDSP_BUILD_BUSSTOP: @@ -642,13 +642,13 @@ struct BuildRoadToolbarWindow : Window { case DDSP_REMOVE_BUSSTOP: { TileArea ta(start_tile, end_tile); - DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound1D); + DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound_SPLAT_OTHER); break; } case DDSP_REMOVE_TRUCKSTOP: { TileArea ta(start_tile, end_tile); - DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound1D); + DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound_SPLAT_OTHER); break; } } diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 7a319d66f..6274de8cd 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -114,7 +114,7 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t switch (proc) { case DDSP_DEMOLISH_AREA: - DoCommandP(end_tile, start_tile, _ctrl_pressed ? 1 : 0, CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound10); + DoCommandP(end_tile, start_tile, _ctrl_pressed ? 1 : 0, CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound_EXPLOSION); break; case DDSP_RAISE_AND_LEVEL_AREA: DoCommandP(end_tile, start_tile, LM_RAISE << 1 | (_ctrl_pressed ? 1 : 0), CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_RAISE_LAND_HERE), CcTerraform); @@ -237,7 +237,7 @@ struct TerraformToolbarWindow : Window { break; case WID_TT_BUY_LAND: // Buy land button - DoCommandP(tile, OBJECT_OWNED_LAND, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound1E); + DoCommandP(tile, OBJECT_OWNED_LAND, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_PURCHASE_THIS_LAND), CcPlaySound_SPLAT_RAIL); break; case WID_TT_PLACE_SIGN: // Place sign button |