diff --git a/src/openrct2-ui/input/KeyboardShortcut.cpp b/src/openrct2-ui/input/KeyboardShortcut.cpp index 20a7f30630..ea0c3c7358 100644 --- a/src/openrct2-ui/input/KeyboardShortcut.cpp +++ b/src/openrct2-ui/input/KeyboardShortcut.cpp @@ -619,7 +619,7 @@ static void shortcut_show_options() static void shortcut_mute_sound() { - audio_toggle_all_sounds(); + OpenRCT2::Audio::ToggleAllSounds(); } static void shortcut_windowed_mode_toggle() diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 204e6148d7..edad48465b 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -1052,7 +1052,7 @@ static void input_widget_left(const ScreenCoordsXY& screenCoords, rct_window* w, default: if (widget_is_enabled(w, widgetIndex) && !widget_is_disabled(w, widgetIndex)) { - audio_play_sound(SoundId::Click1, 0, w->windowPos.x + widget->midX()); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + widget->midX()); // Set new cursor down widget gPressedWidget.window_classification = windowClass; @@ -1337,7 +1337,7 @@ void input_state_widget_pressed( { int32_t mid_point_x = widget->midX() + w->windowPos.x; - audio_play_sound(SoundId::Click2, 0, mid_point_x); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click2, 0, mid_point_x); } if (cursor_w_class != w->classification || cursor_w_number != w->number || widgetIndex != cursor_widgetIndex) break; diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index da433e3437..c958a00200 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -139,7 +139,7 @@ rct_window* window_create( if (!(flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))) { w->flags |= WF_WHITE_BORDER_MASK; - audio_play_sound(SoundId::WindowOpen, 0, screenCoords.x + (width / 2)); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::WindowOpen, 0, screenCoords.x + (width / 2)); } w->number = 0; diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index e61b9f3714..97eb616454 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -679,7 +679,7 @@ static void window_editor_object_selection_scroll_mousedown( w->Invalidate(); const CursorState* state = context_get_cursor_state(); - audio_play_sound(SoundId::Click1, 0, state->position.x); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, state->position.x); if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 2483bf179d..a25943692b 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -124,7 +124,7 @@ rct_window* window_error_open(const std::string_view& title, const std::string_v w->error.var_480 = 0; if (!gDisableErrorWindowSound) { - audio_play_sound(SoundId::Error, 0, w->windowPos.x + (w->width / 2)); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, w->windowPos.x + (w->width / 2)); } return w; diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 34f5c582ef..c27a9a8425 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -870,7 +870,7 @@ static void window_footpath_place_path_at_point(const ScreenCoordsXY& screenCoor // Don't play sound if it is no cost to prevent multiple sounds. TODO: make this work in no money scenarios if (result->Cost != 0) { - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); } } else @@ -957,7 +957,7 @@ static void window_footpath_construct() footpathPlaceAction.SetCallback([=](const GameAction* ga, const GameActionResult* result) { if (result->Error == GA_ERROR::OK) { - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); if (gFootpathConstructSlope == 0) { diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 0eede9f5cf..348f379d7d 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1293,7 +1293,7 @@ static void window_map_place_park_entrance_tool_down(const ScreenCoordsXY& scree auto result = GameActions::Execute(&gameAction); if (result->Error == GA_ERROR::OK) { - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); } } } @@ -1318,7 +1318,7 @@ static void window_map_set_peep_spawn_tool_down(const ScreenCoordsXY& screenCoor auto result = GameActions::Execute(&gameAction); if (result->Error == GA_ERROR::OK) { - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); } } diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 6ba336fa6b..adaf37a00f 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -364,7 +364,7 @@ static void window_maze_construction_entrance_tooldown(const ScreenCoordsXY& scr if (result->Error != GA_ERROR::OK) return; - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); auto ride = get_ride(rideIndex); if (ride != nullptr && ride_are_all_possible_entrances_and_exits_built(ride)) @@ -504,6 +504,6 @@ static void window_maze_construction_construct(int32_t direction) _currentTrackBegin.y = y; if (_rideConstructionState != RIDE_CONSTRUCTION_STATE_MAZE_MOVE) { - audio_play_sound_at_location(SoundId::PlaceItem, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { x, y, z }); } } diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 9707cb7044..466b1367f7 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -711,7 +711,7 @@ static void window_new_ride_scrollmousedown(rct_window* w, int32_t scrollIndex, _windowNewRideHighlightedItem[_windowNewRideCurrentTab] = item; w->new_ride.SelectedRide = item; - audio_play_sound(SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); w->new_ride.selected_ride_countdown = 8; w->Invalidate(); } diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index f4ce332a95..2bcf2c6750 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -123,7 +123,7 @@ static void window_news_update(rct_window* w) } w->Invalidate(); - audio_play_sound(SoundId::Click2, 0, w->windowPos.x + (w->width / 2)); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click2, 0, w->windowPos.x + (w->width / 2)); size_t j = w->news.var_480; w->news.var_480 = -1; @@ -198,7 +198,7 @@ static void window_news_scrollmousedown(rct_window* w, int32_t scrollIndex, cons w->news.var_482 = buttonIndex; w->news.var_484 = 4; w->Invalidate(); - audio_play_sound(SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); } } diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index b1785013ac..5e8d7d6171 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -1338,9 +1338,9 @@ static void window_options_audio_mouseup(rct_window* w, rct_widgetindex widgetIn case WIDX_MASTER_SOUND_CHECKBOX: gConfigSound.master_sound_enabled = !gConfigSound.master_sound_enabled; if (!gConfigSound.master_sound_enabled) - audio_pause_sounds(); + OpenRCT2::Audio::Pause(); else - audio_unpause_sounds(); + OpenRCT2::Audio::Resume(); window_invalidate_by_class(WC_TOP_TOOLBAR); config_save_default(); w->Invalidate(); @@ -1350,7 +1350,7 @@ static void window_options_audio_mouseup(rct_window* w, rct_widgetindex widgetIn gConfigSound.ride_music_enabled = !gConfigSound.ride_music_enabled; if (!gConfigSound.ride_music_enabled) { - audio_stop_ride_music(); + OpenRCT2::Audio::StopRideMusic(); } config_save_default(); w->Invalidate(); @@ -1371,18 +1371,18 @@ static void window_options_audio_mousedown(rct_window* w, rct_widgetindex widget switch (widgetIndex) { case WIDX_SOUND_DROPDOWN: - audio_populate_devices(); + OpenRCT2::Audio::PopulateDevices(); // populate the list with the sound devices - for (size_t i = 0; static_cast(i) < audio_get_device_count(); i++) + for (int32_t i = 0; i < OpenRCT2::Audio::GetDeviceCount(); i++) { gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItemsArgs[i] = reinterpret_cast(audio_get_device_name(i).c_str()); + gDropdownItemsArgs[i] = reinterpret_cast(OpenRCT2::Audio::GetDeviceName(i).c_str()); } - window_options_show_dropdown(w, widget, audio_get_device_count()); + window_options_show_dropdown(w, widget, OpenRCT2::Audio::GetDeviceCount()); - dropdown_set_checked(audio_get_device_index(), true); + dropdown_set_checked(OpenRCT2::Audio::GetCurrentDeviceIndex(), true); break; case WIDX_TITLE_MUSIC_DROPDOWN: uint32_t num_items = 4; @@ -1408,8 +1408,8 @@ static void window_options_audio_dropdown(rct_window* w, rct_widgetindex widgetI switch (widgetIndex) { case WIDX_SOUND_DROPDOWN: - audio_init_ride_sounds(dropdownIndex); - if (dropdownIndex < audio_get_device_count()) + OpenRCT2::Audio::InitRideSounds(dropdownIndex); + if (dropdownIndex < OpenRCT2::Audio::GetDeviceCount()) { if (dropdownIndex == 0) { @@ -1418,13 +1418,13 @@ static void window_options_audio_dropdown(rct_window* w, rct_widgetindex widgetI } else { - const char* devicename = audio_get_device_name(dropdownIndex).c_str(); + const char* devicename = OpenRCT2::Audio::GetDeviceName(dropdownIndex).c_str(); Mixer_Init(devicename); SafeFree(gConfigSound.device); gConfigSound.device = strndup(devicename, AUDIO_DEVICE_NAME_SIZE); } config_save_default(); - audio_start_title_music(); + OpenRCT2::Audio::PlayTitleMusic(); } w->Invalidate(); break; @@ -1440,9 +1440,9 @@ static void window_options_audio_dropdown(rct_window* w, rct_widgetindex widgetI w->Invalidate(); } - audio_stop_title_music(); + OpenRCT2::Audio::StopTitleMusic(); if (dropdownIndex != 0) - audio_start_title_music(); + OpenRCT2::Audio::PlayTitleMusic(); break; } } @@ -1513,7 +1513,7 @@ static void window_options_audio_invalidate(rct_window* w) // Sound device rct_string_id audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; const char* audioDeviceName = nullptr; - const int32_t currentDeviceIndex = audio_get_device_index(); + const int32_t currentDeviceIndex = OpenRCT2::Audio::GetCurrentDeviceIndex(); if (currentDeviceIndex == -1) { audioDeviceStringId = STR_SOUND_NONE; @@ -1529,7 +1529,7 @@ static void window_options_audio_invalidate(rct_window* w) #endif // __linux__ if (audioDeviceStringId == STR_STRING) { - audioDeviceName = audio_get_device_name(currentDeviceIndex).c_str(); + audioDeviceName = OpenRCT2::Audio::GetDeviceName(currentDeviceIndex).c_str(); } } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 6e4f982f1c..d280444b35 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -4976,9 +4976,9 @@ static void window_ride_music_mousedown(rct_window* w, rct_widgetindex widgetInd for (size_t n = 0; n < std::size(MusicStyleOrder); n++) window_ride_current_music_style_order[numItems++] = MusicStyleOrder[n]; - if (gRideMusicInfoList[36].length != 0) + if (OpenRCT2::Audio::gRideMusicInfoList[36].length != 0) window_ride_current_music_style_order[numItems++] = MUSIC_STYLE_CUSTOM_MUSIC_1; - if (gRideMusicInfoList[37].length != 0) + if (OpenRCT2::Audio::gRideMusicInfoList[37].length != 0) window_ride_current_music_style_order[numItems++] = MUSIC_STYLE_CUSTOM_MUSIC_2; } @@ -5099,7 +5099,7 @@ static void cancel_scenery_selection() { gGamePaused &= ~GAME_PAUSED_SAVING_TRACK; gTrackDesignSaveMode = false; - audio_unpause_sounds(); + OpenRCT2::Audio::Resume(); rct_window* main_w = window_get_main(); @@ -5132,7 +5132,7 @@ static void setup_scenery_selection(rct_window* w) gGamePaused |= GAME_PAUSED_SAVING_TRACK; gTrackDesignSaveMode = true; - audio_stop_all_music_and_sounds(); + OpenRCT2::Audio::StopAll(); rct_window* w_main = window_get_main(); diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 4df90e7b2f..17b7831926 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1819,7 +1819,7 @@ static void window_ride_construction_construct(rct_window* w) { return; } - audio_play_sound_at_location(SoundId::PlaceItem, trackPos); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, trackPos); if (network_get_mode() != NETWORK_MODE_NONE) { @@ -3777,7 +3777,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) || errorText == STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND || errorText == STR_TOO_HIGH_FOR_SUPPORTS || zAttempts == (numAttempts - 1) || z < 0) { - audio_play_sound(SoundId::Error, 0, state->position.x); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, state->position.x); w = window_find_by_class(WC_RIDE_CONSTRUCTION); if (w != nullptr) { @@ -3795,7 +3795,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) else { window_close_by_class(WC_ERROR); - audio_play_sound_at_location(SoundId::PlaceItem, _currentTrackBegin); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, _currentTrackBegin); break; } } @@ -3849,7 +3849,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) _currentTrackAlternative = saveCurrentTrackAlternative; _currentTrackLiftHill = saveCurrentTrackLiftHill; - audio_play_sound(SoundId::Error, 0, state->position.x); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, state->position.x); break; } @@ -3885,7 +3885,7 @@ static void ride_construction_tooldown_entrance_exit(const ScreenCoordsXY& scree if (result->Error != GA_ERROR::OK) return; - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); auto ride = get_ride(gRideEntranceExitPlaceRideIndex); if (ride != nullptr && ride_are_all_possible_entrances_and_exits_built(ride)) diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 9f0cf22893..6423a2d4c7 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -157,7 +157,7 @@ rct_window* window_save_prompt_open() if (network_get_mode() == NETWORK_MODE_NONE) { gGamePaused |= GAME_PAUSED_MODAL; - audio_stop_all_music_and_sounds(); + OpenRCT2::Audio::StopAll(); } window_invalidate_by_class(WC_TOP_TOOLBAR); @@ -183,7 +183,7 @@ static void window_save_prompt_close(rct_window* w) if (network_get_mode() == NETWORK_MODE_NONE) { gGamePaused &= ~GAME_PAUSED_MODAL; - audio_unpause_sounds(); + OpenRCT2::Audio::Resume(); } window_invalidate_by_class(WC_TOP_TOOLBAR); diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 1ed551fa53..dbbdda523c 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -325,7 +325,7 @@ static void window_scenarioselect_scrollmousedown(rct_window* w, int32_t scrollI mutableScreenCoords.y -= scenarioItemHeight; if (mutableScreenCoords.y < 0 && !listItem.scenario.is_locked) { - audio_play_sound(SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); gFirstTimeSaving = true; _callback(listItem.scenario.scenario->path); if (_titleEditor) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 4a8c76fe55..2e0e6c5ea1 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -885,7 +885,7 @@ void window_scenery_scrollmousedown(rct_window* w, int32_t scrollIndex, const Sc gWindowSceneryPaintEnabled &= 0xFE; gWindowSceneryEyedropperEnabled = false; - audio_play_sound(SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); w->scenery.hover_counter = -16; gSceneryPlaceCost = MONEY32_UNDEFINED; w->Invalidate(); @@ -1377,7 +1377,7 @@ bool window_scenery_set_selected_item(const ScenerySelection& scenery) gWindowSceneryActiveTabIndex = tabIndex; gWindowSceneryTabSelections[tabIndex] = scenery; - audio_play_sound(SoundId::Click1, 0, context_get_width() / 2); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, context_get_width() / 2); w->scenery.hover_counter = -16; gSceneryPlaceCost = MONEY32_UNDEFINED; w->Invalidate(); diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index a5d6831c52..56abdfea89 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -403,7 +403,7 @@ static void window_top_toolbar_mouseup(rct_window* w, rct_widgetindex widgetInde context_open_window(WC_RECENT_NEWS); break; case WIDX_MUTE: - audio_toggle_all_sounds(); + OpenRCT2::Audio::ToggleAllSounds(); break; case WIDX_CHAT: if (chat_available()) @@ -795,7 +795,7 @@ static void window_top_toolbar_invalidate(rct_window* w) else w->pressed_widgets &= ~(1 << WIDX_PAUSE); - if (!gGameSoundsOff) + if (!OpenRCT2::Audio::gGameSoundsOff) window_top_toolbar_widgets[WIDX_MUTE].image = IMAGE_TYPE_REMAP | SPR_G2_TOOLBAR_MUTE; else window_top_toolbar_widgets[WIDX_MUTE].image = IMAGE_TYPE_REMAP | SPR_G2_TOOLBAR_UNMUTE; @@ -1840,7 +1840,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos smallSceneryPlaceAction.SetCallback([=](const GameAction* ga, const GameActionResult* result) { if (result->Error == GA_ERROR::OK) { - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); } }); auto res = GameActions::Execute(&smallSceneryPlaceAction); @@ -1872,7 +1872,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos { return; } - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); }); auto res = GameActions::Execute(&footpathSceneryPlaceAction); break; @@ -1922,7 +1922,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos wallPlaceAction.SetCallback([](const GameAction* ga, const GameActionResult* result) { if (result->Error == GA_ERROR::OK) { - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); } }); auto res = GameActions::Execute(&wallPlaceAction); @@ -1975,11 +1975,11 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos sceneryPlaceAction.SetCallback([=](const GameAction* ga, const GameActionResult* result) { if (result->Error == GA_ERROR::OK) { - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); } else { - audio_play_sound_at_location(SoundId::Error, { loc.x, loc.y, gSceneryPlaceZ }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Error, { loc.x, loc.y, gSceneryPlaceZ }); } }); auto res = GameActions::Execute(&sceneryPlaceAction); @@ -2005,7 +2005,7 @@ static void window_top_toolbar_scenery_tool_down(const ScreenCoordsXY& windowPos bannerPlaceAction.SetCallback([=](const GameAction* ga, const GameActionResult* result) { if (result->Error == GA_ERROR::OK) { - audio_play_sound_at_location(SoundId::PlaceItem, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); context_open_detail_window(WD_BANNER, bannerIndex); } }); diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 7caabbadb1..8c8277b92c 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -341,7 +341,7 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd if (ride != nullptr) { window_close_by_class(WC_ERROR); - audio_play_sound_at_location(SoundId::PlaceItem, trackLoc); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, trackLoc); _currentRideIndex = result->rideIndex; if (track_design_are_entrance_and_exit_placed()) @@ -362,7 +362,7 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd } else { - audio_play_sound_at_location(SoundId::Error, result->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Error, result->Position); } }); GameActions::Execute(&tdAction); @@ -370,7 +370,7 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd } // Unable to build track - audio_play_sound_at_location(SoundId::Error, trackLoc); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Error, trackLoc); auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); windowManager->ShowError(res->GetErrorTitle(), res->GetErrorMessage()); diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index e3e2b13be1..9d04c44ce7 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -222,7 +222,7 @@ static void window_track_list_close(rct_window* w) */ static void window_track_list_select(rct_window* w, int32_t listIndex) { - audio_play_sound(SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, w->windowPos.x + (w->width / 2)); if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { if (listIndex == 0) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 3c3e5392c5..560889729b 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -445,9 +445,9 @@ namespace OpenRCT2 if (!gOpenRCT2Headless) { - audio_init(); - audio_populate_devices(); - audio_init_ride_sounds_and_info(); + Init(); + PopulateDevices(); + InitRideSoundsAndInfo(); gGameSoundsOff = !gConfigSound.master_sound_enabled; } diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 7948f6eafd..a287059211 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -77,7 +77,7 @@ namespace Editor */ void Load() { - audio_stop_all_music_and_sounds(); + OpenRCT2::Audio::StopAll(); object_manager_unload_all_objects(); object_list_load(); OpenRCT2::GetContext()->GetGameState()->InitAll(150); @@ -152,7 +152,7 @@ namespace Editor */ void LoadTrackDesigner() { - audio_stop_all_music_and_sounds(); + OpenRCT2::Audio::StopAll(); gScreenFlags = SCREEN_FLAGS_TRACK_DESIGNER; gScreenAge = 0; @@ -173,7 +173,7 @@ namespace Editor */ void LoadTrackManager() { - audio_stop_all_music_and_sounds(); + OpenRCT2::Audio::StopAll(); gScreenFlags = SCREEN_FLAGS_TRACK_MANAGER; gScreenAge = 0; diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index c968c3a5d7..9602326ca4 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -301,7 +301,7 @@ void pause_toggle() window_invalidate_by_class(WC_TOP_TOOLBAR); if (gGamePaused & GAME_PAUSED_NORMAL) { - audio_stop_all_music_and_sounds(); + OpenRCT2::Audio::StopAll(); } } @@ -550,7 +550,7 @@ void game_load_init() snapshots->Reset(); gScreenFlags = SCREEN_FLAGS_PLAYING; - audio_stop_all_music_and_sounds(); + OpenRCT2::Audio::StopAll(); if (!gLoadKeepWindowsOpen) { viewport_init_all(); @@ -587,7 +587,7 @@ void game_load_init() window_update_all(); } - audio_stop_title_music(); + OpenRCT2::Audio::StopTitleMusic(); gGameSpeed = 1; } diff --git a/src/openrct2/Intro.cpp b/src/openrct2/Intro.cpp index 070523bb61..b313e006d2 100644 --- a/src/openrct2/Intro.cpp +++ b/src/openrct2/Intro.cpp @@ -55,7 +55,8 @@ void intro_update() _introStateCounter = -580; // Play the chain lift sound - _soundChannel = Mixer_Play_Effect(SoundId::LiftBM, MIXER_LOOP_INFINITE, MIXER_VOLUME_MAX, 0.5f, 1, true); + _soundChannel = Mixer_Play_Effect( + OpenRCT2::Audio::SoundId::LiftBM, MIXER_LOOP_INFINITE, MIXER_VOLUME_MAX, 0.5f, 1, true); _chainLiftFinished = false; gIntroState = IntroState::PublisherScroll; break; @@ -94,7 +95,7 @@ void intro_update() // Play the track friction sound _soundChannel = Mixer_Play_Effect( - SoundId::TrackFrictionBM, MIXER_LOOP_INFINITE, MIXER_VOLUME_MAX, 0.25f, 0.75, true); + OpenRCT2::Audio::SoundId::TrackFrictionBM, MIXER_LOOP_INFINITE, MIXER_VOLUME_MAX, 0.25f, 0.75, true); } // Check if logo is off the screen...ish @@ -108,7 +109,8 @@ void intro_update() } // Play long peep scream sound - _soundChannel = Mixer_Play_Effect(SoundId::Scream1, MIXER_LOOP_NONE, MIXER_VOLUME_MAX, 0.5f, 1, false); + _soundChannel = Mixer_Play_Effect( + OpenRCT2::Audio::SoundId::Scream1, MIXER_LOOP_NONE, MIXER_VOLUME_MAX, 0.5f, 1, false); gIntroState = IntroState::LogoFadeIn; _introStateCounter = 0; @@ -157,7 +159,7 @@ void intro_update() case IntroState::Finish: gIntroState = IntroState::None; load_palette(); - audio_start_title_music(); + OpenRCT2::Audio::PlayTitleMusic(); break; default: break; diff --git a/src/openrct2/actions/LandLowerAction.hpp b/src/openrct2/actions/LandLowerAction.hpp index f4310b50d8..b94e109c97 100644 --- a/src/openrct2/actions/LandLowerAction.hpp +++ b/src/openrct2/actions/LandLowerAction.hpp @@ -86,7 +86,8 @@ private: if (isExecuting) { - audio_play_sound_at_location(SoundId::PlaceItem, { _coords.x, _coords.y, tile_element_height(_coords) }); + OpenRCT2::Audio::Play3D( + OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, tile_element_height(_coords) }); } uint8_t maxHeight = map_get_highest_land_height(validRange); diff --git a/src/openrct2/actions/LandRaiseAction.hpp b/src/openrct2/actions/LandRaiseAction.hpp index 8b39c37d69..f7dec665c8 100644 --- a/src/openrct2/actions/LandRaiseAction.hpp +++ b/src/openrct2/actions/LandRaiseAction.hpp @@ -87,7 +87,8 @@ private: if (isExecuting) { - audio_play_sound_at_location(SoundId::PlaceItem, { _coords.x, _coords.y, tile_element_height(_coords) }); + OpenRCT2::Audio::Play3D( + OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, tile_element_height(_coords) }); } uint8_t minHeight = map_get_lowest_land_height(validRange); diff --git a/src/openrct2/actions/LandSetRightsAction.hpp b/src/openrct2/actions/LandSetRightsAction.hpp index e360e1acb7..ae0639b978 100644 --- a/src/openrct2/actions/LandSetRightsAction.hpp +++ b/src/openrct2/actions/LandSetRightsAction.hpp @@ -126,7 +126,7 @@ private: if (isExecuting) { map_count_remaining_land_rights(); - audio_play_sound_at_location(SoundId::PlaceItem, centre); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, centre); } return res; } diff --git a/src/openrct2/actions/LandSmoothAction.hpp b/src/openrct2/actions/LandSmoothAction.hpp index 7e872d1f02..17d3185d87 100644 --- a/src/openrct2/actions/LandSmoothAction.hpp +++ b/src/openrct2/actions/LandSmoothAction.hpp @@ -664,7 +664,7 @@ private: if (isExecuting) { - audio_play_sound_at_location(SoundId::PlaceItem, { _coords.x, _coords.y, centreZ }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, centreZ }); } res->Cost += result->Cost; return res; diff --git a/src/openrct2/actions/WaterLowerAction.hpp b/src/openrct2/actions/WaterLowerAction.hpp index d70b7ce6db..c34cdab749 100644 --- a/src/openrct2/actions/WaterLowerAction.hpp +++ b/src/openrct2/actions/WaterLowerAction.hpp @@ -128,7 +128,7 @@ private: if (isExecuting && hasChanged) { - audio_play_sound_at_location(SoundId::LayingOutWater, res->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::LayingOutWater, res->Position); } // Force ride construction to recheck area _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK; diff --git a/src/openrct2/actions/WaterRaiseAction.hpp b/src/openrct2/actions/WaterRaiseAction.hpp index 49ba3c6a00..afb07bb73c 100644 --- a/src/openrct2/actions/WaterRaiseAction.hpp +++ b/src/openrct2/actions/WaterRaiseAction.hpp @@ -136,7 +136,7 @@ private: if (isExecuting && hasChanged) { - audio_play_sound_at_location(SoundId::LayingOutWater, res->Position); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::LayingOutWater, res->Position); } // Force ride construction to recheck area _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK; diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 6f16edb241..e05fbc70ca 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -30,430 +30,432 @@ #include #include -using namespace OpenRCT2::Audio; - -struct AudioParams +namespace OpenRCT2::Audio { - bool in_range; - int32_t volume; - int32_t pan; -}; - -static std::vector _audioDevices; -static int32_t _currentAudioDevice = -1; - -bool gGameSoundsOff = false; -int32_t gVolumeAdjustZoom = 0; - -void* gTitleMusicChannel = nullptr; -void* gWeatherSoundChannel = nullptr; - -rct_ride_music gRideMusicList[AUDIO_MAX_RIDE_MUSIC]; -rct_ride_music_params gRideMusicParamsList[AUDIO_MAX_RIDE_MUSIC]; -rct_ride_music_params* gRideMusicParamsListEnd; - -rct_vehicle_sound gVehicleSoundList[AUDIO_MAX_VEHICLE_SOUNDS]; - -// clang-format off -static int32_t SoundVolumeAdjust[RCT2SoundCount] = -{ - 0, // LiftClassic - 0, // TrackFrictionClassicWood - 0, // FrictionClassic - 0, // Scream1 - 0, // Click1 - 0, // Click2 - 0, // PlaceItem - 0, // Scream2 - 0, // Scream3 - 0, // Scream4 - 0, // Scream5 - 0, // Scream6 - 0, // LiftFrictionWheels - -400, // Purchase - 0, // Crash - 0, // LayingOutWater - 0, // Water1 - 0, // Water2 - 0, // TrainWhistle - 0, // TrainDeparting - -1000, // WaterSplash - 0, // GoKartEngine - -800, // RideLaunch1 - -1700, // RideLaunch2 - -700, // Cough1 - -700, // Cough2 - -700, // Cough3 - -700, // Cough4 - 0, // Rain - 0, // Thunder1 - 0, // Thunder2 - 0, // TrackFrictionTrain - 0, // TrackFrictionWater - 0, // BalloonPop - -700, // MechanicFix - 0, // Scream7 - -2500, // ToiletFlush original value: -1000 - 0, // Click3 - 0, // Quack - 0, // NewsItem - 0, // WindowOpen - -900, // Laugh1 - -900, // Laugh2 - -900, // Laugh3 - 0, // Applause - -600, // HauntedHouseScare - -700, // HauntedHouseScream1 - -700, // HauntedHouseScream2 - -2550, // BlockBrakeClose - -2900, // BlockBrakeRelease - 0, // Error - -3400, // BrakeRelease - 0, // LiftArrow - 0, // LiftWood - 0, // TrackFrictionWood - 0, // LiftWildMouse - 0, // LiftBM - 0, // TrackFrictionBM - 0, // Scream8 - 0, // Tram - -2000, // DoorOpen - -2700, // DoorClose - -700 // Portcullis -}; -// clang-format on - -static AudioParams audio_get_params_from_location(SoundId soundId, const CoordsXYZ& location); - -bool audio_is_available() -{ - if (_currentAudioDevice == -1) - return false; - if (gGameSoundsOff) - return false; - if (!gConfigSound.sound_enabled) - return false; - if (gOpenRCT2Headless) - return false; - return true; -} - -void audio_init() -{ - if (str_is_null_or_empty(gConfigSound.device)) + struct AudioParams { - Mixer_Init(nullptr); - _currentAudioDevice = 0; + bool in_range; + int32_t volume; + int32_t pan; + }; + + static std::vector _audioDevices; + static int32_t _currentAudioDevice = -1; + + bool gGameSoundsOff = false; + int32_t gVolumeAdjustZoom = 0; + + void* gTitleMusicChannel = nullptr; + void* gWeatherSoundChannel = nullptr; + + RideMusic gRideMusicList[AUDIO_MAX_RIDE_MUSIC]; + RideMusicParams gRideMusicParamsList[AUDIO_MAX_RIDE_MUSIC]; + RideMusicParams* gRideMusicParamsListEnd; + + VehicleSound gVehicleSoundList[AUDIO_MAX_VEHICLE_SOUNDS]; + + // clang-format off + static int32_t SoundVolumeAdjust[RCT2SoundCount] = + { + 0, // LiftClassic + 0, // TrackFrictionClassicWood + 0, // FrictionClassic + 0, // Scream1 + 0, // Click1 + 0, // Click2 + 0, // PlaceItem + 0, // Scream2 + 0, // Scream3 + 0, // Scream4 + 0, // Scream5 + 0, // Scream6 + 0, // LiftFrictionWheels + -400, // Purchase + 0, // Crash + 0, // LayingOutWater + 0, // Water1 + 0, // Water2 + 0, // TrainWhistle + 0, // TrainDeparting + -1000, // WaterSplash + 0, // GoKartEngine + -800, // RideLaunch1 + -1700, // RideLaunch2 + -700, // Cough1 + -700, // Cough2 + -700, // Cough3 + -700, // Cough4 + 0, // Rain + 0, // Thunder1 + 0, // Thunder2 + 0, // TrackFrictionTrain + 0, // TrackFrictionWater + 0, // BalloonPop + -700, // MechanicFix + 0, // Scream7 + -2500, // ToiletFlush original value: -1000 + 0, // Click3 + 0, // Quack + 0, // NewsItem + 0, // WindowOpen + -900, // Laugh1 + -900, // Laugh2 + -900, // Laugh3 + 0, // Applause + -600, // HauntedHouseScare + -700, // HauntedHouseScream1 + -700, // HauntedHouseScream2 + -2550, // BlockBrakeClose + -2900, // BlockBrakeRelease + 0, // Error + -3400, // BrakeRelease + 0, // LiftArrow + 0, // LiftWood + 0, // TrackFrictionWood + 0, // LiftWildMouse + 0, // LiftBM + 0, // TrackFrictionBM + 0, // Scream8 + 0, // Tram + -2000, // DoorOpen + -2700, // DoorClose + -700 // Portcullis + }; + // clang-format on + + static AudioParams audio_get_params_from_location(SoundId soundId, const CoordsXYZ& location); + + bool IsAvailable() + { + if (_currentAudioDevice == -1) + return false; + if (gGameSoundsOff) + return false; + if (!gConfigSound.sound_enabled) + return false; + if (gOpenRCT2Headless) + return false; + return true; } - else - { - Mixer_Init(gConfigSound.device); - audio_populate_devices(); - for (int32_t i = 0; i < audio_get_device_count(); i++) + void Init() + { + if (str_is_null_or_empty(gConfigSound.device)) { - if (_audioDevices[i] == gConfigSound.device) + Mixer_Init(nullptr); + _currentAudioDevice = 0; + } + else + { + Mixer_Init(gConfigSound.device); + + PopulateDevices(); + for (int32_t i = 0; i < GetDeviceCount(); i++) { - _currentAudioDevice = i; + if (_audioDevices[i] == gConfigSound.device) + { + _currentAudioDevice = i; + } } } } -} -void audio_populate_devices() -{ - auto audioContext = OpenRCT2::GetContext()->GetAudioContext(); - std::vector devices = audioContext->GetOutputDevices(); - - // Replace blanks with localised unknown string - for (auto& device : devices) + void PopulateDevices() { - if (device.empty()) + auto audioContext = OpenRCT2::GetContext()->GetAudioContext(); + std::vector devices = audioContext->GetOutputDevices(); + + // Replace blanks with localised unknown string + for (auto& device : devices) { - device = language_get_string(STR_OPTIONS_SOUND_VALUE_DEFAULT); + if (device.empty()) + { + device = language_get_string(STR_OPTIONS_SOUND_VALUE_DEFAULT); + } } - } #ifndef __linux__ - // The first device is always system default on Windows and macOS - std::string defaultDevice = language_get_string(STR_OPTIONS_SOUND_VALUE_DEFAULT); - devices.insert(devices.begin(), defaultDevice); + // The first device is always system default on Windows and macOS + std::string defaultDevice = language_get_string(STR_OPTIONS_SOUND_VALUE_DEFAULT); + devices.insert(devices.begin(), defaultDevice); #endif - _audioDevices = devices; -} - -void audio_play_sound_at_location(SoundId soundId, const CoordsXYZ& loc) -{ - if (!audio_is_available()) - return; - - AudioParams params = audio_get_params_from_location(soundId, loc); - if (params.in_range) - { - audio_play_sound(soundId, params.volume, params.pan); - } -} - -/** - * Returns the audio parameters to use when playing the specified sound at a virtual location. - * @param soundId The sound effect to be played. - * @param location The location at which the sound effect is to be played. - * @return The audio parameters to be used when playing this sound effect. - */ -static AudioParams audio_get_params_from_location(SoundId soundId, const CoordsXYZ& location) -{ - int32_t volumeDown = 0; - AudioParams params; - params.in_range = true; - params.volume = 0; - params.pan = 0; - - auto element = map_get_surface_element_at(location); - if (element && (element->GetBaseZ()) - 5 > location.z) - { - volumeDown = 10; + _audioDevices = devices; } - uint8_t rotation = get_current_rotation(); - auto pos2 = translate_3d_to_2d_with_z(rotation, location); - - rct_viewport* viewport = nullptr; - while ((viewport = window_get_previous_viewport(viewport)) != nullptr) + void Play3D(SoundId soundId, const CoordsXYZ& loc) { - if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) - { - int16_t vx = pos2.x - viewport->viewPos.x; - int16_t vy = pos2.y - viewport->viewPos.y; - params.pan = viewport->pos.x + (vx / viewport->zoom); - params.volume = SoundVolumeAdjust[static_cast(soundId)] - + ((-1024 * viewport->zoom - 1) * (1 << volumeDown)) + 1; - - if (vy < 0 || vy >= viewport->view_height || vx < 0 || vx >= viewport->view_width || params.volume < -10000) - { - params.in_range = false; - return params; - } - } - } - - return params; -} - -void audio_play_sound(SoundId soundId, int32_t volume, int32_t pan) -{ - if (gGameSoundsOff) - return; - - int32_t mixerPan = 0; - if (pan != AUDIO_PLAY_AT_CENTRE) - { - int32_t x2 = pan << 16; - uint16_t screenWidth = std::max(64, OpenRCT2::GetContext()->GetUiContext()->GetWidth()); - mixerPan = ((x2 / screenWidth) - 0x8000) >> 4; - } - - Mixer_Play_Effect(soundId, MIXER_LOOP_NONE, DStoMixerVolume(volume), DStoMixerPan(mixerPan), 1, 1); -} - -void audio_start_title_music() -{ - if (gGameSoundsOff || !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) || gIntroState != IntroState::None) - { - audio_stop_title_music(); - return; - } - - if (gTitleMusicChannel != nullptr) - { - return; - } - - int32_t pathId; - switch (gConfigSound.title_music) - { - case 1: - pathId = PATH_ID_CSS50; - break; - case 2: - pathId = PATH_ID_CSS17; - break; - case 3: - pathId = (util_rand() & 1) ? PATH_ID_CSS50 : PATH_ID_CSS17; - break; - default: + if (!IsAvailable()) return; - } - gTitleMusicChannel = Mixer_Play_Music(pathId, MIXER_LOOP_INFINITE, true); - if (gTitleMusicChannel != nullptr) - { - Mixer_Channel_SetGroup(gTitleMusicChannel, OpenRCT2::Audio::MixerGroup::TitleMusic); - } -} - -void audio_stop_ride_music() -{ - for (auto& rideMusic : gRideMusicList) - { - if (rideMusic.ride_id != RIDE_ID_NULL) + AudioParams params = audio_get_params_from_location(soundId, loc); + if (params.in_range) { - rideMusic.ride_id = RIDE_ID_NULL; - if (rideMusic.sound_channel != nullptr) + Play(soundId, params.volume, params.pan); + } + } + + /** + * Returns the audio parameters to use when playing the specified sound at a virtual location. + * @param soundId The sound effect to be played. + * @param location The location at which the sound effect is to be played. + * @return The audio parameters to be used when playing this sound effect. + */ + static AudioParams audio_get_params_from_location(SoundId soundId, const CoordsXYZ& location) + { + int32_t volumeDown = 0; + AudioParams params; + params.in_range = true; + params.volume = 0; + params.pan = 0; + + auto element = map_get_surface_element_at(location); + if (element && (element->GetBaseZ()) - 5 > location.z) + { + volumeDown = 10; + } + + uint8_t rotation = get_current_rotation(); + auto pos2 = translate_3d_to_2d_with_z(rotation, location); + + rct_viewport* viewport = nullptr; + while ((viewport = window_get_previous_viewport(viewport)) != nullptr) + { + if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) { - Mixer_Stop_Channel(rideMusic.sound_channel); + int16_t vx = pos2.x - viewport->viewPos.x; + int16_t vy = pos2.y - viewport->viewPos.y; + params.pan = viewport->pos.x + (vx / viewport->zoom); + params.volume = SoundVolumeAdjust[static_cast(soundId)] + + ((-1024 * viewport->zoom - 1) * (1 << volumeDown)) + 1; + + if (vy < 0 || vy >= viewport->view_height || vx < 0 || vx >= viewport->view_width || params.volume < -10000) + { + params.in_range = false; + return params; + } + } + } + + return params; + } + + void Play(SoundId soundId, int32_t volume, int32_t pan) + { + if (gGameSoundsOff) + return; + + int32_t mixerPan = 0; + if (pan != AUDIO_PLAY_AT_CENTRE) + { + int32_t x2 = pan << 16; + uint16_t screenWidth = std::max(64, OpenRCT2::GetContext()->GetUiContext()->GetWidth()); + mixerPan = ((x2 / screenWidth) - 0x8000) >> 4; + } + + Mixer_Play_Effect(soundId, MIXER_LOOP_NONE, DStoMixerVolume(volume), DStoMixerPan(mixerPan), 1, 1); + } + + void PlayTitleMusic() + { + if (gGameSoundsOff || !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) || gIntroState != IntroState::None) + { + StopTitleMusic(); + return; + } + + if (gTitleMusicChannel != nullptr) + { + return; + } + + int32_t pathId; + switch (gConfigSound.title_music) + { + case 1: + pathId = PATH_ID_CSS50; + break; + case 2: + pathId = PATH_ID_CSS17; + break; + case 3: + pathId = (util_rand() & 1) ? PATH_ID_CSS50 : PATH_ID_CSS17; + break; + default: + return; + } + + gTitleMusicChannel = Mixer_Play_Music(pathId, MIXER_LOOP_INFINITE, true); + if (gTitleMusicChannel != nullptr) + { + Mixer_Channel_SetGroup(gTitleMusicChannel, OpenRCT2::Audio::MixerGroup::TitleMusic); + } + } + + void StopRideMusic() + { + for (auto& rideMusic : gRideMusicList) + { + if (rideMusic.ride_id != RIDE_ID_NULL) + { + rideMusic.ride_id = RIDE_ID_NULL; + if (rideMusic.sound_channel != nullptr) + { + Mixer_Stop_Channel(rideMusic.sound_channel); + } } } } -} -void audio_stop_all_music_and_sounds() -{ - audio_stop_title_music(); - audio_stop_vehicle_sounds(); - audio_stop_ride_music(); - peep_stop_crowd_noise(); - audio_stop_weather_sound(); -} - -int32_t audio_get_device_count() -{ - return static_cast(_audioDevices.size()); -} - -const std::string& audio_get_device_name(int32_t index) -{ - Guard::Assert(index >= 0 && index < audio_get_device_count()); - return _audioDevices[index]; -} - -int32_t audio_get_device_index() -{ - return _currentAudioDevice; -} - -void audio_stop_title_music() -{ - if (gTitleMusicChannel != nullptr) + void StopAll() { - Mixer_Stop_Channel(gTitleMusicChannel); - gTitleMusicChannel = nullptr; + StopTitleMusic(); + StopVehicleSounds(); + StopRideMusic(); + peep_stop_crowd_noise(); + StopWeatherSound(); } -} -void audio_stop_weather_sound() -{ - if (gWeatherSoundChannel != nullptr) + int32_t GetDeviceCount() { - Mixer_Stop_Channel(gWeatherSoundChannel); - gWeatherSoundChannel = nullptr; + return static_cast(_audioDevices.size()); } -} -void audio_init_ride_sounds_and_info() -{ - int32_t deviceNum = 0; - audio_init_ride_sounds(deviceNum); - - for (auto& rideMusicInfo : gRideMusicInfoList) + const std::string& GetDeviceName(int32_t index) { - const utf8* path = context_get_path_legacy(rideMusicInfo.path_id); - if (File::Exists(path)) + Guard::Assert(index >= 0 && index < GetDeviceCount()); + return _audioDevices[index]; + } + + int32_t GetCurrentDeviceIndex() + { + return _currentAudioDevice; + } + + void StopTitleMusic() + { + if (gTitleMusicChannel != nullptr) { - try + Mixer_Stop_Channel(gTitleMusicChannel); + gTitleMusicChannel = nullptr; + } + } + + void StopWeatherSound() + { + if (gWeatherSoundChannel != nullptr) + { + Mixer_Stop_Channel(gWeatherSoundChannel); + gWeatherSoundChannel = nullptr; + } + } + + void InitRideSoundsAndInfo() + { + int32_t deviceNum = 0; + InitRideSounds(deviceNum); + + for (auto& rideMusicInfo : gRideMusicInfoList) + { + const utf8* path = context_get_path_legacy(rideMusicInfo.path_id); + if (File::Exists(path)) { - auto fs = OpenRCT2::FileStream(path, OpenRCT2::FILE_MODE_OPEN); - uint32_t head = fs.ReadValue(); - if (head == 0x78787878) + try { - rideMusicInfo.length = 0; + auto fs = OpenRCT2::FileStream(path, OpenRCT2::FILE_MODE_OPEN); + uint32_t head = fs.ReadValue(); + if (head == 0x78787878) + { + rideMusicInfo.length = 0; + } + // The length used to be hardcoded, but we stopped doing that to allow replacement. + if (rideMusicInfo.length == 0) + { + rideMusicInfo.length = fs.GetLength(); + } } - // The length used to be hardcoded, but we stopped doing that to allow replacement. - if (rideMusicInfo.length == 0) + catch (const std::exception&) { - rideMusicInfo.length = fs.GetLength(); } } - catch (const std::exception&) - { - } } } -} -void audio_init_ride_sounds(int32_t device) -{ - audio_close(); - for (auto& vehicleSound : gVehicleSoundList) + void InitRideSounds(int32_t device) { - vehicleSound.id = SOUND_ID_NULL; - } - - _currentAudioDevice = device; - config_save_default(); - for (auto& rideMusic : gRideMusicList) - { - rideMusic.ride_id = RIDE_ID_NULL; - } -} - -void audio_close() -{ - peep_stop_crowd_noise(); - audio_stop_title_music(); - audio_stop_ride_music(); - audio_stop_weather_sound(); - _currentAudioDevice = -1; -} - -void audio_toggle_all_sounds() -{ - gConfigSound.master_sound_enabled = !gConfigSound.master_sound_enabled; - if (gConfigSound.master_sound_enabled) - { - audio_unpause_sounds(); - } - else - { - audio_stop_title_music(); - audio_pause_sounds(); - } - - window_invalidate_by_class(WC_OPTIONS); -} - -void audio_pause_sounds() -{ - gGameSoundsOff = true; - audio_stop_vehicle_sounds(); - audio_stop_ride_music(); - peep_stop_crowd_noise(); - audio_stop_weather_sound(); -} - -void audio_unpause_sounds() -{ - gGameSoundsOff = false; -} - -void audio_stop_vehicle_sounds() -{ - if (!audio_is_available()) - return; - - for (auto& vehicleSound : gVehicleSoundList) - { - if (vehicleSound.id != SOUND_ID_NULL) + Close(); + for (auto& vehicleSound : gVehicleSoundList) { vehicleSound.id = SOUND_ID_NULL; - if (vehicleSound.TrackSound.Id != SoundId::Null) + } + + _currentAudioDevice = device; + config_save_default(); + for (auto& rideMusic : gRideMusicList) + { + rideMusic.ride_id = RIDE_ID_NULL; + } + } + + void Close() + { + peep_stop_crowd_noise(); + StopTitleMusic(); + StopRideMusic(); + StopWeatherSound(); + _currentAudioDevice = -1; + } + + void ToggleAllSounds() + { + gConfigSound.master_sound_enabled = !gConfigSound.master_sound_enabled; + if (gConfigSound.master_sound_enabled) + { + Resume(); + } + else + { + StopTitleMusic(); + Pause(); + } + + window_invalidate_by_class(WC_OPTIONS); + } + + void Pause() + { + gGameSoundsOff = true; + StopVehicleSounds(); + StopRideMusic(); + peep_stop_crowd_noise(); + StopWeatherSound(); + } + + void Resume() + { + gGameSoundsOff = false; + } + + void StopVehicleSounds() + { + if (!IsAvailable()) + return; + + for (auto& vehicleSound : gVehicleSoundList) + { + if (vehicleSound.id != SOUND_ID_NULL) { - Mixer_Stop_Channel(vehicleSound.TrackSound.Channel); - } - if (vehicleSound.OtherSound.Id != SoundId::Null) - { - Mixer_Stop_Channel(vehicleSound.OtherSound.Channel); + vehicleSound.id = SOUND_ID_NULL; + if (vehicleSound.TrackSound.Id != SoundId::Null) + { + Mixer_Stop_Channel(vehicleSound.TrackSound.Channel); + } + if (vehicleSound.OtherSound.Id != SoundId::Null) + { + Mixer_Stop_Channel(vehicleSound.OtherSound.Channel); + } } } } -} + +} // namespace OpenRCT2::Audio diff --git a/src/openrct2/audio/AudioMixer.h b/src/openrct2/audio/AudioMixer.h index 1d94d635ef..cfba2b95a9 100644 --- a/src/openrct2/audio/AudioMixer.h +++ b/src/openrct2/audio/AudioMixer.h @@ -15,10 +15,10 @@ #define MIXER_LOOP_NONE 0 #define MIXER_LOOP_INFINITE (-1) -enum class SoundId : uint8_t; - namespace OpenRCT2::Audio { + enum class SoundId : uint8_t; + enum class MixerGroup : int32_t { Sound, @@ -58,7 +58,8 @@ namespace OpenRCT2::Audio #endif void Mixer_Init(const char* device); -void* Mixer_Play_Effect(SoundId id, int32_t loop, int32_t volume, float pan, double rate, int32_t deleteondone); +void* Mixer_Play_Effect( + OpenRCT2::Audio::SoundId id, int32_t loop, int32_t volume, float pan, double rate, int32_t deleteondone); void Mixer_Stop_Channel(void* channel); void Mixer_Channel_Volume(void* channel, int32_t volume); void Mixer_Channel_Pan(void* channel, float pan); diff --git a/src/openrct2/audio/audio.h b/src/openrct2/audio/audio.h index 33ac63fcce..8b3366d5b9 100644 --- a/src/openrct2/audio/audio.h +++ b/src/openrct2/audio/audio.h @@ -12,6 +12,10 @@ #include "../common.h" #include "../ride/RideTypes.h" +struct CoordsXYZ; + +namespace OpenRCT2::Audio +{ #define AUDIO_DEVICE_NAME_SIZE 256 #define AUDIO_MAX_RIDE_MUSIC 32 #define AUDIO_MAX_VEHICLE_SOUNDS 14 @@ -20,240 +24,259 @@ #define AUDIO_PLAY_AT_LOCATION 0x8001 #define SOUND_ID_NULL 0xFFFF -enum class SoundId : uint8_t; -struct CoordsXYZ; + enum class SoundId : uint8_t; -struct rct_ride_music -{ - ride_id_t ride_id; - uint8_t tune_id; - int16_t volume; - int16_t pan; - uint16_t frequency; - void* sound_channel; -}; + struct RideMusic + { + ride_id_t ride_id; + uint8_t tune_id; + int16_t volume; + int16_t pan; + uint16_t frequency; + void* sound_channel; + }; -struct rct_ride_music_info -{ - uint8_t path_id; - uint32_t offset; - uint32_t length; -}; + struct RideMusicInfo + { + uint8_t path_id; + uint32_t offset; + uint32_t length; + }; -struct rct_ride_music_params -{ - ride_id_t ride_id; - uint8_t tune_id; - int32_t offset; - int16_t volume; - int16_t pan; - uint16_t frequency; -}; + struct RideMusicParams + { + ride_id_t ride_id; + uint8_t tune_id; + int32_t offset; + int16_t volume; + int16_t pan; + uint16_t frequency; + }; -struct Sound -{ - SoundId Id; - int16_t Volume; - int16_t Pan; - uint16_t Frequency; - void* Channel; -}; + struct Sound + { + SoundId Id; + int16_t Volume; + int16_t Pan; + uint16_t Frequency; + void* Channel; + }; -struct rct_vehicle_sound -{ - uint16_t id; - int16_t volume; - Sound TrackSound; - Sound OtherSound; -}; + struct VehicleSound + { + uint16_t id; + int16_t volume; + Sound TrackSound; + Sound OtherSound; + }; -struct rct_vehicle_sound_params -{ - uint16_t id; - int16_t pan_x; - int16_t pan_y; - uint16_t frequency; - int16_t volume; - uint16_t priority; -}; + struct VehicleSoundParams + { + uint16_t id; + int16_t pan_x; + int16_t pan_y; + uint16_t frequency; + int16_t volume; + uint16_t priority; + }; -enum class SoundId : uint8_t -{ - LiftClassic, - TrackFrictionClassicWood, - FrictionClassic, - Scream1, - Click1, - Click2, - PlaceItem, - Scream2, - Scream3, - Scream4, - Scream5, - Scream6, - LiftFrictionWheels, - Purchase, - Crash, - LayingOutWater, - Water1, - Water2, - TrainWhistle, - TrainDeparting, - WaterSplash, - GoKartEngine, - RideLaunch1, - RideLaunch2, - Cough1, - Cough2, - Cough3, - Cough4, - Rain, - Thunder1, - Thunder2, - TrackFrictionTrain, - TrackFrictionWater, - BalloonPop, - MechanicFix, - Scream7, - ToiletFlush, - Click3, - Quack, - NewsItem, - WindowOpen, - Laugh1, - Laugh2, - Laugh3, - Applause, - HauntedHouseScare, - HauntedHouseScream1, - HauntedHouseScream2, - BlockBrakeClose, - BlockBrakeRelease, - Error, - BrakeRelease, - LiftArrow, - LiftWood, - TrackFrictionWood, - LiftWildMouse, - LiftBM, - TrackFrictionBM, - Scream8, - Tram, - DoorOpen, - DoorClose, - Portcullis, - NoScream = 254, - Null = 255 -}; + enum class SoundId : uint8_t + { + LiftClassic, + TrackFrictionClassicWood, + FrictionClassic, + Scream1, + Click1, + Click2, + PlaceItem, + Scream2, + Scream3, + Scream4, + Scream5, + Scream6, + LiftFrictionWheels, + Purchase, + Crash, + LayingOutWater, + Water1, + Water2, + TrainWhistle, + TrainDeparting, + WaterSplash, + GoKartEngine, + RideLaunch1, + RideLaunch2, + Cough1, + Cough2, + Cough3, + Cough4, + Rain, + Thunder1, + Thunder2, + TrackFrictionTrain, + TrackFrictionWater, + BalloonPop, + MechanicFix, + Scream7, + ToiletFlush, + Click3, + Quack, + NewsItem, + WindowOpen, + Laugh1, + Laugh2, + Laugh3, + Applause, + HauntedHouseScare, + HauntedHouseScream1, + HauntedHouseScream2, + BlockBrakeClose, + BlockBrakeRelease, + Error, + BrakeRelease, + LiftArrow, + LiftWood, + TrackFrictionWood, + LiftWildMouse, + LiftBM, + TrackFrictionBM, + Scream8, + Tram, + DoorOpen, + DoorClose, + Portcullis, + NoScream = 254, + Null = 255 + }; -constexpr uint8_t RCT2SoundCount = static_cast(SoundId::Portcullis) + 1; + constexpr uint8_t RCT2SoundCount = static_cast(SoundId::Portcullis) + 1; -extern bool gGameSoundsOff; -extern int32_t gVolumeAdjustZoom; + extern bool gGameSoundsOff; + extern int32_t gVolumeAdjustZoom; -extern void* gTitleMusicChannel; -extern void* gWeatherSoundChannel; + extern void* gTitleMusicChannel; + extern void* gWeatherSoundChannel; -extern rct_ride_music gRideMusicList[AUDIO_MAX_RIDE_MUSIC]; -extern rct_ride_music_info gRideMusicInfoList[NUM_DEFAULT_MUSIC_TRACKS]; -extern rct_ride_music_params gRideMusicParamsList[AUDIO_MAX_RIDE_MUSIC]; -extern rct_ride_music_params* gRideMusicParamsListEnd; + extern RideMusic gRideMusicList[AUDIO_MAX_RIDE_MUSIC]; + extern RideMusicInfo gRideMusicInfoList[NUM_DEFAULT_MUSIC_TRACKS]; + extern RideMusicParams gRideMusicParamsList[AUDIO_MAX_RIDE_MUSIC]; + extern RideMusicParams* gRideMusicParamsListEnd; -extern rct_vehicle_sound gVehicleSoundList[AUDIO_MAX_VEHICLE_SOUNDS]; + extern VehicleSound gVehicleSoundList[AUDIO_MAX_VEHICLE_SOUNDS]; -/** - * Returns false when no audio device is available or when audio is turned off, otherwise true. - */ -bool audio_is_available(); -/* - * Returns the amount of available audio devices. - */ -int32_t audio_get_device_count(); -/** - * Returns the device name by index. - */ -const std::string& audio_get_device_name(int32_t index); -/** - * Returns the currently used device index, -1 if not available. - */ -int32_t audio_get_device_index(); -/** - * Deregisters the audio device. - * rct2: 0x006BAB21 - */ -void audio_close(); -/** - * Initialises the audio subsystem. - */ -void audio_init(); -/** - * Loads the ride sounds and info. - * rct2: 0x006BA8E0 - */ -void audio_init_ride_sounds_and_info(); -/** - * Loads the ride sounds. - * rct2: 0x006BA9B5 - */ -void audio_init_ride_sounds(int32_t device); -/** - * Temporarily stops playing sounds until audio_unpause_sounds() is called. - * rct2: 0x006BABB4 - */ -void audio_pause_sounds(); -/** - * Plays the specified sound. - * @param soundId The sound effect to play. - * @param volume The volume at which the sound effect should be played. - * @param pan The pan at which the sound effect should be played. If set to anything other than AUDIO_PLAY_AT_CENTRE, plays the - * sound at a position relative to the centre of the viewport. - */ -void audio_play_sound(SoundId soundId, int32_t volume, int32_t pan); -/** - * Plays the specified sound at a virtual location. - * @param soundId The sound effect to play. - * @param x The x coordinate of the location. - * @param y The y coordinate of the location. - * @param z The z coordinate of the location. - */ -void audio_play_sound_at_location(SoundId soundId, const CoordsXYZ& loc); -/** - * Populates the gAudioDevices array with the available audio devices. - */ -void audio_populate_devices(); -/** - * Starts playing the title music. - * rct2: 0x006BD0F8 - */ -void audio_start_title_music(); -/** - * Stops the weather sound effect from playing. - */ -void audio_stop_weather_sound(); -/** - * Stops ride music from playing. - * rct2: 0x006BCA9F - */ -void audio_stop_ride_music(); -/** - * Stops the title music from playing. - * rct2: 0x006BD0BD - */ -void audio_stop_title_music(); -/** - * Stops vehicle sounds from playing. - * rct2: 0x006BABDF - */ -void audio_stop_vehicle_sounds(); -/** - * Toggles whether all sounds should be played. - * rct2: 0x006BAB8A - */ -void audio_toggle_all_sounds(); -/** - * Resumes playing sounds that had been paused by a call to audio_pause_sounds(). - * rct2: 0x006BABD8 - */ -void audio_unpause_sounds(); + /** + * Returns false when no audio device is available or when audio is turned off, otherwise true. + */ + bool IsAvailable(); -void audio_stop_all_music_and_sounds(); + /* + * Returns the amount of available audio devices. + */ + int32_t GetDeviceCount(); + + /** + * Returns the device name by index. + */ + const std::string& GetDeviceName(int32_t index); + + /** + * Returns the currently used device index, -1 if not available. + */ + int32_t GetCurrentDeviceIndex(); + + /** + * Deregisters the audio device. + * rct2: 0x006BAB21 + */ + void Close(); + + /** + * Initialises the audio subsystem. + */ + void Init(); + + /** + * Loads the ride sounds and info. + * rct2: 0x006BA8E0 + */ + void InitRideSoundsAndInfo(); + + /** + * Loads the ride sounds. + * rct2: 0x006BA9B5 + */ + void InitRideSounds(int32_t device); + + /** + * Temporarily stops playing sounds until audio_unpause_sounds() is called. + * rct2: 0x006BABB4 + */ + void Pause(); + + /** + * Plays the specified sound. + * @param soundId The sound effect to play. + * @param volume The volume at which the sound effect should be played. + * @param pan The pan at which the sound effect should be played. If set to anything other than AUDIO_PLAY_AT_CENTRE, plays + * the sound at a position relative to the centre of the viewport. + */ + void Play(SoundId soundId, int32_t volume, int32_t pan); + + /** + * Plays the specified sound at a virtual location. + * @param soundId The sound effect to play. + * @param x The x coordinate of the location. + * @param y The y coordinate of the location. + * @param z The z coordinate of the location. + */ + void Play3D(SoundId soundId, const CoordsXYZ& loc); + + /** + * Populates the gAudioDevices array with the available audio devices. + */ + void PopulateDevices(); + + /** + * Starts playing the title music. + * rct2: 0x006BD0F8 + */ + void PlayTitleMusic(); + + /** + * Stops the weather sound effect from playing. + */ + void StopWeatherSound(); + + /** + * Stops ride music from playing. + * rct2: 0x006BCA9F + */ + void StopRideMusic(); + + /** + * Stops the title music from playing. + * rct2: 0x006BD0BD + */ + void StopTitleMusic(); + + /** + * Stops vehicle sounds from playing. + * rct2: 0x006BABDF + */ + void StopVehicleSounds(); + + /** + * Toggles whether all sounds should be played. + * rct2: 0x006BAB8A + */ + void ToggleAllSounds(); + + /** + * Resumes playing sounds that had been paused by a call to audio_pause_sounds(). + * rct2: 0x006BABD8 + */ + void Resume(); + + void StopAll(); + +} // namespace OpenRCT2::Audio diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index 849d9bdfda..1b4510a38c 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -245,7 +245,7 @@ void chat_history_add(const char* src) free(buffer); - Mixer_Play_Effect(SoundId::NewsItem, 0, MIXER_VOLUME_MAX, 0.5f, 1.5f, true); + Mixer_Play_Effect(OpenRCT2::Audio::SoundId::NewsItem, 0, MIXER_VOLUME_MAX, 0.5f, 1.5f, true); } void chat_input(CHAT_INPUT input) diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index b49b42328d..6b73e3e3a3 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -80,7 +80,7 @@ void screenshot_check() if (!screenshotPath.empty()) { - audio_play_sound(SoundId::WindowOpen, 100, context_get_width() / 2); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::WindowOpen, 100, context_get_width() / 2); } else { diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 108fe3485b..00b15b052b 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -1716,7 +1716,7 @@ void window_close_construction_windows() */ void window_update_viewport_ride_music() { - gRideMusicParamsListEnd = &gRideMusicParamsList[0]; + OpenRCT2::Audio::gRideMusicParamsListEnd = &OpenRCT2::Audio::gRideMusicParamsList[0]; g_music_tracking_viewport = nullptr; for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) @@ -1730,11 +1730,11 @@ void window_update_viewport_ride_music() gWindowAudioExclusive = w; if (viewport->zoom <= 0) - gVolumeAdjustZoom = 0; + OpenRCT2::Audio::gVolumeAdjustZoom = 0; else if (viewport->zoom == 1) - gVolumeAdjustZoom = 30; + OpenRCT2::Audio::gVolumeAdjustZoom = 30; else - gVolumeAdjustZoom = 60; + OpenRCT2::Audio::gVolumeAdjustZoom = 60; break; } } diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index d4b64708f6..7c87ebd19c 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -128,7 +128,7 @@ static void TickCurrent() if (ticks == 1 && (gScreenFlags == SCREEN_FLAGS_PLAYING)) { // Play sound - audio_play_sound(SoundId::NewsItem, 0, context_get_width() / 2); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::NewsItem, 0, context_get_width() / 2); } } diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 2944d9aff0..33ed519f7d 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -439,7 +439,7 @@ void RideObject::ReadLegacyVehicle( vehicle->no_seating_rows = stream->ReadValue(); vehicle->spinning_inertia = stream->ReadValue(); vehicle->spinning_friction = stream->ReadValue(); - vehicle->friction_sound_id = stream->ReadValue(); + vehicle->friction_sound_id = stream->ReadValue(); vehicle->log_flume_reverser_vehicle_type = stream->ReadValue(); vehicle->sound_range = stream->ReadValue(); vehicle->double_sound_frequency = stream->ReadValue(); @@ -574,7 +574,7 @@ void RideObject::ReadJson(IReadObjectContext* context, json_t& root) car.sprite_height_positive = 1; car.flags = VEHICLE_ENTRY_FLAG_SPINNING; car.car_visual = VEHICLE_VISUAL_FLAT_RIDE_OR_CAR_RIDE; - car.friction_sound_id = SoundId::Null; + car.friction_sound_id = OpenRCT2::Audio::SoundId::Null; car.sound_range = 0xFF; car.draw_order = 6; @@ -733,7 +733,7 @@ rct_ride_entry_vehicle RideObject::ReadJsonCar(json_t& jCar) car.no_seating_rows = Json::GetNumber(jCar["numSeatRows"]); car.spinning_inertia = Json::GetNumber(jCar["spinningInertia"]); car.spinning_friction = Json::GetNumber(jCar["spinningFriction"]); - car.friction_sound_id = Json::GetEnum(jCar["frictionSoundId"], SoundId::Null); + car.friction_sound_id = Json::GetEnum(jCar["frictionSoundId"], OpenRCT2::Audio::SoundId::Null); car.log_flume_reverser_vehicle_type = Json::GetNumber(jCar["logFlumeReverserVehicleType"]); car.sound_range = Json::GetNumber(jCar["soundRange"], 255); car.double_sound_frequency = Json::GetNumber(jCar["doubleSoundFrequency"]); diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 4bdd24d42f..f682c470f6 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -890,7 +890,7 @@ void Guest::Tick128UpdateGuest(int32_t index) { if (State == PeepState::Walking || State == PeepState::Sitting) { - audio_play_sound_at_location(SoundId::Crash, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, { x, y, z }); sprite_misc_explosion_cloud_create({ x, y, z + 16 }); sprite_misc_explosion_flare_create({ x, y, z + 16 }); @@ -1828,11 +1828,13 @@ void Guest::OnExitRide(ride_id_t rideIndex) { InsertNewThought(PEEP_THOUGHT_TYPE_WAS_GREAT, rideIndex); - SoundId laughs[3] = { SoundId::Laugh1, SoundId::Laugh2, SoundId::Laugh3 }; + static constexpr OpenRCT2::Audio::SoundId laughs[3] = { OpenRCT2::Audio::SoundId::Laugh1, + OpenRCT2::Audio::SoundId::Laugh2, + OpenRCT2::Audio::SoundId::Laugh3 }; int32_t laughType = scenario_rand() & 7; if (laughType < 3) { - audio_play_sound_at_location(laughs[laughType], { x, y, z }); + OpenRCT2::Audio::Play3D(laughs[laughType], { x, y, z }); } } @@ -2369,7 +2371,7 @@ void Guest::SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureTyp } } - audio_play_sound_at_location(SoundId::Purchase, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Purchase, { x, y, z }); } void Guest::SetHasRidden(const Ride* ride) @@ -5102,7 +5104,7 @@ void Guest::UpdateRideShopInteract() // Do not play toilet flush sound on title screen as it's considered loud and annoying if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - audio_play_sound_at_location(SoundId::ToiletFlush, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::ToiletFlush, { x, y, z }); } RideSubState = PeepRideSubState::LeaveShop; @@ -6852,7 +6854,7 @@ void Guest::UpdateSpriteType() if ((scenario_rand() & 0xFFFF) <= 13107) { isBalloonPopped = true; - audio_play_sound_at_location(SoundId::BalloonPop, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::BalloonPop, { x, y, z }); } create_balloon({ x, y, z + 9 }, BalloonColour, isBalloonPopped); } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 2ab4a99361..4479fdb04f 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -641,9 +641,11 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) // Create sick at location litter_create({ x, y, z, sprite_direction }, (sprite_index & 1) ? LITTER_TYPE_SICK_ALT : LITTER_TYPE_SICK); - SoundId coughs[4] = { SoundId::Cough1, SoundId::Cough2, SoundId::Cough3, SoundId::Cough4 }; + static constexpr OpenRCT2::Audio::SoundId coughs[4] = { OpenRCT2::Audio::SoundId::Cough1, OpenRCT2::Audio::SoundId::Cough2, + OpenRCT2::Audio::SoundId::Cough3, + OpenRCT2::Audio::SoundId::Cough4 }; auto soundId = coughs[scenario_rand() & 3]; - audio_play_sound_at_location(soundId, { x, y, z }); + OpenRCT2::Audio::Play3D(soundId, { x, y, z }); return { { x, y } }; } @@ -1325,7 +1327,7 @@ void peep_stop_crowd_noise() */ void peep_update_crowd_noise() { - if (gGameSoundsOff) + if (OpenRCT2::Audio::gGameSoundsOff) return; if (!gConfigSound.sound_enabled) @@ -1423,7 +1425,7 @@ void peep_applause() } // Play applause noise - audio_play_sound(SoundId::Applause, 0, context_get_width() / 2); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Applause, 0, context_get_width() / 2); } /** diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 53e2573298..59e7564cc8 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -2512,7 +2512,7 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride* ride) if (ActionFrame == 0x13 || ActionFrame == 0x19 || ActionFrame == 0x1F || ActionFrame == 0x25 || ActionFrame == 0x2B) { - audio_play_sound_at_location(SoundId::MechanicFix, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::MechanicFix, { x, y, z }); } return false; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 9aabc18155..569d2336f1 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1195,8 +1195,8 @@ private: dst->sound_vector_factor = src->sound_vector_factor; dst->spin_speed = src->spin_speed; dst->sound2_flags = src->sound2_flags; - dst->sound1_id = SoundId::Null; - dst->sound2_id = SoundId::Null; + dst->sound1_id = OpenRCT2::Audio::SoundId::Null; + dst->sound2_id = OpenRCT2::Audio::SoundId::Null; dst->var_C0 = src->var_C0; dst->var_C4 = src->var_C4; dst->animation_frame = src->animation_frame; @@ -1204,7 +1204,7 @@ private: dst->var_CA = src->var_CA; dst->var_CE = src->var_CE; dst->var_D3 = src->var_D3; - dst->scream_sound_id = SoundId::Null; + dst->scream_sound_id = OpenRCT2::Audio::SoundId::Null; dst->vehicle_sprite_type = src->vehicle_sprite_type; dst->bank_rotation = src->bank_rotation; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index b17ff483c8..ffa44bb0f4 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1394,9 +1394,9 @@ public: dst->crash_x = src->crash_x; dst->sound2_flags = src->sound2_flags; dst->spin_sprite = src->spin_sprite; - dst->sound1_id = static_cast(src->sound1_id); + dst->sound1_id = static_cast(src->sound1_id); dst->sound1_volume = src->sound1_volume; - dst->sound2_id = static_cast(src->sound2_id); + dst->sound2_id = static_cast(src->sound2_id); dst->sound2_volume = src->sound2_volume; dst->sound_vector_factor = src->sound_vector_factor; dst->time_waiting = src->time_waiting; @@ -1406,7 +1406,7 @@ public: dst->animation_frame = src->animation_frame; dst->var_C8 = src->var_C8; dst->var_CA = src->var_CA; - dst->scream_sound_id = static_cast(src->scream_sound_id); + dst->scream_sound_id = static_cast(src->scream_sound_id); dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition }; dst->var_CE = src->var_CE; dst->var_CF = src->var_CF; diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 87b2cc59bb..b47b588512 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -51,13 +51,13 @@ Vehicle* cable_lift_segment_create( current->spin_sprite = 0; current->spin_speed = 0; current->sound2_flags = 0; - current->sound1_id = SoundId::Null; - current->sound2_id = SoundId::Null; + current->sound1_id = OpenRCT2::Audio::SoundId::Null; + current->sound2_id = OpenRCT2::Audio::SoundId::Null; current->var_C4 = 0; current->animation_frame = 0; current->var_C8 = 0; current->var_CA = 0; - current->scream_sound_id = SoundId::Null; + current->scream_sound_id = OpenRCT2::Audio::SoundId::Null; current->vehicle_sprite_type = 0; current->bank_rotation = 0; for (auto& peep : current->peep) diff --git a/src/openrct2/ride/MusicList.cpp b/src/openrct2/ride/MusicList.cpp index 82e748f2c9..adc322530a 100644 --- a/src/openrct2/ride/MusicList.cpp +++ b/src/openrct2/ride/MusicList.cpp @@ -13,99 +13,103 @@ #include "../audio/audio.h" #include "../common.h" +namespace OpenRCT2::Audio +{ #define MAKE_TUNEID_LIST(...) std::vector({ __VA_ARGS__ }) -// 0x009AEF28 -std::vector gRideMusicStyleTuneIds[] = { - MAKE_TUNEID_LIST(TUNE_DODGEMS_BEAT), // MUSIC_STYLE_DODGEMS_BEAT - MAKE_TUNEID_LIST( // MUSIC_STYLE_FAIRGROUND_ORGAN - TUNE_CHILDREN_OF_THE_REGIMENT, TUNE_SERENADE_OP_21, TUNE_IN_CONTINENTAL_MOOD, TUNE_WEDDING_JOURNEY, - TUNE_TALES_FROM_THE_VIENNA_WOODS, TUNE_SLAVONIC_DANCE, TUNE_CSS_10, TUNE_DAS_ALPENHORN, TUNE_BELLA_BELLA_BIMBA, - TUNE_THE_BLOND_SAILOR, TUNE_POET_AND_PEASANT_OVERTURE, TUNE_WALTZ_MEDLEY, TUNE_CSS_16), - MAKE_TUNEID_LIST(TUNE_CAESARS_MARCH), // MUSIC_STYLE_ROMAN_FANFARE - MAKE_TUNEID_LIST(TUNE_NINJAS_NOODLES), // MUSIC_STYLE_ORIENTAL - MAKE_TUNEID_LIST(TUNE_INVADERS), // MUSIC_STYLE_MARTIAN - MAKE_TUNEID_LIST(TUNE_JUNGLE_JUICE), // MUSIC_STYLE_JUNGLE_DRUMS - MAKE_TUNEID_LIST(TUNE_PHARAOHS_TOMB), // MUSIC_STYLE_EGYPTIAN - MAKE_TUNEID_LIST(TUNE_ETERNAL_TOYBOX), // MUSIC_STYLE_TOYLAND - MAKE_TUNEID_LIST(TUNE_CIRCUS_SHOW), // MUSIC_STYLE_CIRCUS_SHOW - MAKE_TUNEID_LIST(TUNE_VOYAGE_TO_ANDROMEDA), // MUSIC_STYLE_SPACE - MAKE_TUNEID_LIST(TUNE_VAMPIRES_LAIR), // MUSIC_STYLE_HORROR - MAKE_TUNEID_LIST(TUNE_BRIMBLES_BEAT), // MUSIC_STYLE_TECHNO - MAKE_TUNEID_LIST(TUNE_DRIFTING_TO_HEAVEN), // MUSIC_STYLE_GENTLE - MAKE_TUNEID_LIST(TUNE_MID_SUMMERS_HEAT), // MUSIC_STYLE_SUMMER - MAKE_TUNEID_LIST(TUNE_ATLANTIS), // MUSIC_STYLE_WATER - MAKE_TUNEID_LIST(TUNE_WILD_WEST_KID), // MUSIC_STYLE_WILD_WEST - MAKE_TUNEID_LIST(TUNE_BLOCKBUSTER), // MUSIC_STYLE_JURASSIC - MAKE_TUNEID_LIST(TUNE_AIRTIME_ROCK), // MUSIC_STYLE_ROCK - MAKE_TUNEID_LIST(TUNE_SEARCHLIGHT_RAG), // MUSIC_STYLE_RAGTIME - MAKE_TUNEID_LIST(TUNE_FLIGHT_OF_FANTASY), // MUSIC_STYLE_FANTASY - MAKE_TUNEID_LIST(TUNE_BIG_ROCK), // MUSIC_STYLE_ROCK_STYLE_2 - MAKE_TUNEID_LIST(TUNE_HYPOTHERMIA), // MUSIC_STYLE_ICE - MAKE_TUNEID_LIST(TUNE_LAST_SLEIGH_RIDE), // MUSIC_STYLE_SNOW - MAKE_TUNEID_LIST(TUNE_CUSTOM_1), // MUSIC_STYLE_CUSTOM_MUSIC_1 - MAKE_TUNEID_LIST(TUNE_CUSTOM_2), // MUSIC_STYLE_CUSTOM_MUSIC_2 - MAKE_TUNEID_LIST(TUNE_PIPES_OF_GLENCAIRN), // MUSIC_STYLE_MEDIEVAL - MAKE_TUNEID_LIST(TUNE_TRAFFIC_JAM), // MUSIC_STYLE_URBAN - MAKE_TUNEID_LIST(TUNE_TOCCATA), // MUSIC_STYLE_ORGAN - MAKE_TUNEID_LIST(TUNE_MANIC_MECHANIC), // MUSIC_STYLE_MECHANICAL - MAKE_TUNEID_LIST(TUNE_TECHNO_TORTURE), // MUSIC_STYLE_MODERN - MAKE_TUNEID_LIST(TUNE_WHAT_SHALL_WE_DO_WITH_THE_DRUNKEN_SAILOR), // MUSIC_STYLE_PIRATES - MAKE_TUNEID_LIST(TUNE_SPACE_ROCK), // MUSIC_STYLE_ROCK_STYLE_3 - MAKE_TUNEID_LIST(TUNE_SWEAT_DREAMS), // MUSIC_STYLE_CANDY_STYLE -}; + // 0x009AEF28 + std::vector gRideMusicStyleTuneIds[] = { + MAKE_TUNEID_LIST(TUNE_DODGEMS_BEAT), // MUSIC_STYLE_DODGEMS_BEAT + MAKE_TUNEID_LIST( // MUSIC_STYLE_FAIRGROUND_ORGAN + TUNE_CHILDREN_OF_THE_REGIMENT, TUNE_SERENADE_OP_21, TUNE_IN_CONTINENTAL_MOOD, TUNE_WEDDING_JOURNEY, + TUNE_TALES_FROM_THE_VIENNA_WOODS, TUNE_SLAVONIC_DANCE, TUNE_CSS_10, TUNE_DAS_ALPENHORN, TUNE_BELLA_BELLA_BIMBA, + TUNE_THE_BLOND_SAILOR, TUNE_POET_AND_PEASANT_OVERTURE, TUNE_WALTZ_MEDLEY, TUNE_CSS_16), + MAKE_TUNEID_LIST(TUNE_CAESARS_MARCH), // MUSIC_STYLE_ROMAN_FANFARE + MAKE_TUNEID_LIST(TUNE_NINJAS_NOODLES), // MUSIC_STYLE_ORIENTAL + MAKE_TUNEID_LIST(TUNE_INVADERS), // MUSIC_STYLE_MARTIAN + MAKE_TUNEID_LIST(TUNE_JUNGLE_JUICE), // MUSIC_STYLE_JUNGLE_DRUMS + MAKE_TUNEID_LIST(TUNE_PHARAOHS_TOMB), // MUSIC_STYLE_EGYPTIAN + MAKE_TUNEID_LIST(TUNE_ETERNAL_TOYBOX), // MUSIC_STYLE_TOYLAND + MAKE_TUNEID_LIST(TUNE_CIRCUS_SHOW), // MUSIC_STYLE_CIRCUS_SHOW + MAKE_TUNEID_LIST(TUNE_VOYAGE_TO_ANDROMEDA), // MUSIC_STYLE_SPACE + MAKE_TUNEID_LIST(TUNE_VAMPIRES_LAIR), // MUSIC_STYLE_HORROR + MAKE_TUNEID_LIST(TUNE_BRIMBLES_BEAT), // MUSIC_STYLE_TECHNO + MAKE_TUNEID_LIST(TUNE_DRIFTING_TO_HEAVEN), // MUSIC_STYLE_GENTLE + MAKE_TUNEID_LIST(TUNE_MID_SUMMERS_HEAT), // MUSIC_STYLE_SUMMER + MAKE_TUNEID_LIST(TUNE_ATLANTIS), // MUSIC_STYLE_WATER + MAKE_TUNEID_LIST(TUNE_WILD_WEST_KID), // MUSIC_STYLE_WILD_WEST + MAKE_TUNEID_LIST(TUNE_BLOCKBUSTER), // MUSIC_STYLE_JURASSIC + MAKE_TUNEID_LIST(TUNE_AIRTIME_ROCK), // MUSIC_STYLE_ROCK + MAKE_TUNEID_LIST(TUNE_SEARCHLIGHT_RAG), // MUSIC_STYLE_RAGTIME + MAKE_TUNEID_LIST(TUNE_FLIGHT_OF_FANTASY), // MUSIC_STYLE_FANTASY + MAKE_TUNEID_LIST(TUNE_BIG_ROCK), // MUSIC_STYLE_ROCK_STYLE_2 + MAKE_TUNEID_LIST(TUNE_HYPOTHERMIA), // MUSIC_STYLE_ICE + MAKE_TUNEID_LIST(TUNE_LAST_SLEIGH_RIDE), // MUSIC_STYLE_SNOW + MAKE_TUNEID_LIST(TUNE_CUSTOM_1), // MUSIC_STYLE_CUSTOM_MUSIC_1 + MAKE_TUNEID_LIST(TUNE_CUSTOM_2), // MUSIC_STYLE_CUSTOM_MUSIC_2 + MAKE_TUNEID_LIST(TUNE_PIPES_OF_GLENCAIRN), // MUSIC_STYLE_MEDIEVAL + MAKE_TUNEID_LIST(TUNE_TRAFFIC_JAM), // MUSIC_STYLE_URBAN + MAKE_TUNEID_LIST(TUNE_TOCCATA), // MUSIC_STYLE_ORGAN + MAKE_TUNEID_LIST(TUNE_MANIC_MECHANIC), // MUSIC_STYLE_MECHANICAL + MAKE_TUNEID_LIST(TUNE_TECHNO_TORTURE), // MUSIC_STYLE_MODERN + MAKE_TUNEID_LIST(TUNE_WHAT_SHALL_WE_DO_WITH_THE_DRUNKEN_SAILOR), // MUSIC_STYLE_PIRATES + MAKE_TUNEID_LIST(TUNE_SPACE_ROCK), // MUSIC_STYLE_ROCK_STYLE_3 + MAKE_TUNEID_LIST(TUNE_SWEAT_DREAMS), // MUSIC_STYLE_CANDY_STYLE + }; #define INIT_MUSIC_INFO(path_id, offset) \ { \ path_id, offset, 0 \ } -// 0x009AF1C8 -rct_ride_music_info gRideMusicInfoList[NUM_DEFAULT_MUSIC_TRACKS] = { - INIT_MUSIC_INFO(PATH_ID_CSS4, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS5, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS6, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS7, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS8, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS9, 1378), - INIT_MUSIC_INFO(0, 1378), // Referred to the nearly empty CSS10.DAT file - INIT_MUSIC_INFO(PATH_ID_CSS11, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS12, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS13, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS14, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS15, 1378), - INIT_MUSIC_INFO(0, 1378), // Referred to the nearly empty CSS16.DAT file - INIT_MUSIC_INFO(PATH_ID_CSS3, 689), - INIT_MUSIC_INFO(PATH_ID_CSS17, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS18, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS19, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS20, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS21, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS22, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS23, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS24, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS25, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS26, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS27, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS28, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS29, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS30, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS31, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS32, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS33, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS34, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS35, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS36, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS37, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS38, 2756), - INIT_MUSIC_INFO(PATH_ID_CUSTOM1, 2756), - INIT_MUSIC_INFO(PATH_ID_CUSTOM2, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS39, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS40, 1378), - INIT_MUSIC_INFO(PATH_ID_CSS41, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS42, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS43, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS44, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS45, 2756), - INIT_MUSIC_INFO(PATH_ID_CSS46, 2756), -}; + // 0x009AF1C8 + RideMusicInfo gRideMusicInfoList[NUM_DEFAULT_MUSIC_TRACKS] = { + INIT_MUSIC_INFO(PATH_ID_CSS4, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS5, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS6, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS7, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS8, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS9, 1378), + INIT_MUSIC_INFO(0, 1378), // Referred to the nearly empty CSS10.DAT file + INIT_MUSIC_INFO(PATH_ID_CSS11, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS12, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS13, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS14, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS15, 1378), + INIT_MUSIC_INFO(0, 1378), // Referred to the nearly empty CSS16.DAT file + INIT_MUSIC_INFO(PATH_ID_CSS3, 689), + INIT_MUSIC_INFO(PATH_ID_CSS17, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS18, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS19, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS20, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS21, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS22, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS23, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS24, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS25, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS26, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS27, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS28, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS29, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS30, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS31, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS32, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS33, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS34, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS35, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS36, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS37, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS38, 2756), + INIT_MUSIC_INFO(PATH_ID_CUSTOM1, 2756), + INIT_MUSIC_INFO(PATH_ID_CUSTOM2, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS39, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS40, 1378), + INIT_MUSIC_INFO(PATH_ID_CSS41, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS42, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS43, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS44, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS45, 2756), + INIT_MUSIC_INFO(PATH_ID_CSS46, 2756), + }; + +} // namespace OpenRCT2::Audio diff --git a/src/openrct2/ride/MusicList.h b/src/openrct2/ride/MusicList.h index 3f1abd70eb..1c94081d8f 100644 --- a/src/openrct2/ride/MusicList.h +++ b/src/openrct2/ride/MusicList.h @@ -14,54 +14,58 @@ #include -enum +namespace OpenRCT2::Audio { - TUNE_CHILDREN_OF_THE_REGIMENT, // 00 - TUNE_SERENADE_OP_21, // 01 - TUNE_IN_CONTINENTAL_MOOD, // 02 - TUNE_WEDDING_JOURNEY, // 03 - TUNE_TALES_FROM_THE_VIENNA_WOODS, // 04 - TUNE_SLAVONIC_DANCE, // 05 - TUNE_CSS_10, // 06, empty - TUNE_DAS_ALPENHORN, // 07 - TUNE_BELLA_BELLA_BIMBA, // 08 - TUNE_THE_BLOND_SAILOR, // 09 - TUNE_POET_AND_PEASANT_OVERTURE, // 10 - TUNE_WALTZ_MEDLEY, // 11 - TUNE_CSS_16, // 12, empty - TUNE_DODGEMS_BEAT, // 13 - TUNE_RCT2_THEME_MUSIC, // 14 - TUNE_CAESARS_MARCH, // 15 - TUNE_NINJAS_NOODLES, // 16 - TUNE_INVADERS, // 17 - TUNE_JUNGLE_JUICE, // 18 - TUNE_PHARAOHS_TOMB, // 19 - TUNE_ETERNAL_TOYBOX, // 20 - TUNE_CIRCUS_SHOW, // 21 - TUNE_VOYAGE_TO_ANDROMEDA, // 22 - TUNE_VAMPIRES_LAIR, // 23 - TUNE_BRIMBLES_BEAT, // 24 - TUNE_DRIFTING_TO_HEAVEN, // 25 - TUNE_MID_SUMMERS_HEAT, // 26 - TUNE_ATLANTIS, // 27 - TUNE_WILD_WEST_KID, // 28 - TUNE_BLOCKBUSTER, // 29 - TUNE_AIRTIME_ROCK, // 30 - TUNE_SEARCHLIGHT_RAG, // 31 - TUNE_FLIGHT_OF_FANTASY, // 32 - TUNE_BIG_ROCK, // 33 - TUNE_HYPOTHERMIA, // 34 - TUNE_LAST_SLEIGH_RIDE, // 35 - TUNE_CUSTOM_1, // 36 - TUNE_CUSTOM_2, // 37 - TUNE_PIPES_OF_GLENCAIRN, // 38 - TUNE_TRAFFIC_JAM, // 39 - TUNE_TOCCATA, // 40 - TUNE_MANIC_MECHANIC, // 41 - TUNE_TECHNO_TORTURE, // 42 - TUNE_WHAT_SHALL_WE_DO_WITH_THE_DRUNKEN_SAILOR, // 43 - TUNE_SPACE_ROCK, // 44 - TUNE_SWEAT_DREAMS, // 45, (sic) -}; + enum + { + TUNE_CHILDREN_OF_THE_REGIMENT, // 00 + TUNE_SERENADE_OP_21, // 01 + TUNE_IN_CONTINENTAL_MOOD, // 02 + TUNE_WEDDING_JOURNEY, // 03 + TUNE_TALES_FROM_THE_VIENNA_WOODS, // 04 + TUNE_SLAVONIC_DANCE, // 05 + TUNE_CSS_10, // 06, empty + TUNE_DAS_ALPENHORN, // 07 + TUNE_BELLA_BELLA_BIMBA, // 08 + TUNE_THE_BLOND_SAILOR, // 09 + TUNE_POET_AND_PEASANT_OVERTURE, // 10 + TUNE_WALTZ_MEDLEY, // 11 + TUNE_CSS_16, // 12, empty + TUNE_DODGEMS_BEAT, // 13 + TUNE_RCT2_THEME_MUSIC, // 14 + TUNE_CAESARS_MARCH, // 15 + TUNE_NINJAS_NOODLES, // 16 + TUNE_INVADERS, // 17 + TUNE_JUNGLE_JUICE, // 18 + TUNE_PHARAOHS_TOMB, // 19 + TUNE_ETERNAL_TOYBOX, // 20 + TUNE_CIRCUS_SHOW, // 21 + TUNE_VOYAGE_TO_ANDROMEDA, // 22 + TUNE_VAMPIRES_LAIR, // 23 + TUNE_BRIMBLES_BEAT, // 24 + TUNE_DRIFTING_TO_HEAVEN, // 25 + TUNE_MID_SUMMERS_HEAT, // 26 + TUNE_ATLANTIS, // 27 + TUNE_WILD_WEST_KID, // 28 + TUNE_BLOCKBUSTER, // 29 + TUNE_AIRTIME_ROCK, // 30 + TUNE_SEARCHLIGHT_RAG, // 31 + TUNE_FLIGHT_OF_FANTASY, // 32 + TUNE_BIG_ROCK, // 33 + TUNE_HYPOTHERMIA, // 34 + TUNE_LAST_SLEIGH_RIDE, // 35 + TUNE_CUSTOM_1, // 36 + TUNE_CUSTOM_2, // 37 + TUNE_PIPES_OF_GLENCAIRN, // 38 + TUNE_TRAFFIC_JAM, // 39 + TUNE_TOCCATA, // 40 + TUNE_MANIC_MECHANIC, // 41 + TUNE_TECHNO_TORTURE, // 42 + TUNE_WHAT_SHALL_WE_DO_WITH_THE_DRUNKEN_SAILOR, // 43 + TUNE_SPACE_ROCK, // 44 + TUNE_SWEAT_DREAMS, // 45, (sic) + }; -extern std::vector gRideMusicStyleTuneIds[]; + extern std::vector gRideMusicStyleTuneIds[]; + +} // namespace OpenRCT2::Audio diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 11e1888e14..1245ef36d7 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2833,7 +2833,7 @@ static void ride_music_update(Ride* ride) // Select random tune from available tunes for a music style (of course only merry-go-rounds have more than one tune) if (ride->music_tune_id == 255) { - const auto& musicStyleTunes = gRideMusicStyleTuneIds[ride->music]; + const auto& musicStyleTunes = OpenRCT2::Audio::gRideMusicStyleTuneIds[ride->music]; auto numTunes = musicStyleTunes.size(); ride->music_tune_id = musicStyleTunes[util_rand() % numTunes]; ride->music_position = 0; @@ -3451,10 +3451,10 @@ void ride_set_map_tooltip(TileElement* tileElement) static int32_t ride_music_params_update_label_51( uint32_t a1, uint8_t* tuneId, Ride* ride, int32_t v32, int32_t pan_x, uint16_t sampleRate) { - if (a1 < gRideMusicInfoList[*tuneId].length) + if (a1 < OpenRCT2::Audio::gRideMusicInfoList[*tuneId].length) { - rct_ride_music_params* ride_music_params = gRideMusicParamsListEnd; - if (ride_music_params < &gRideMusicParamsList[std::size(gRideMusicParamsList)]) + OpenRCT2::Audio::RideMusicParams* ride_music_params = OpenRCT2::Audio::gRideMusicParamsListEnd; + if (ride_music_params < &OpenRCT2::Audio::gRideMusicParamsList[std::size(OpenRCT2::Audio::gRideMusicParamsList)]) { ride_music_params->ride_id = ride->id; ride_music_params->tune_id = *tuneId; @@ -3462,7 +3462,7 @@ static int32_t ride_music_params_update_label_51( ride_music_params->volume = v32; ride_music_params->pan = pan_x; ride_music_params->frequency = sampleRate; - gRideMusicParamsListEnd++; + OpenRCT2::Audio::gRideMusicParamsListEnd++; } return a1; @@ -3476,7 +3476,7 @@ static int32_t ride_music_params_update_label_51( static int32_t ride_music_params_update_label_58(uint32_t position, uint8_t* tuneId) { - rct_ride_music_info* ride_music_info = &gRideMusicInfoList[*tuneId]; + OpenRCT2::Audio::RideMusicInfo* ride_music_info = &OpenRCT2::Audio::gRideMusicInfoList[*tuneId]; position += ride_music_info->offset; if (position < ride_music_info->length) { @@ -3505,7 +3505,8 @@ static int32_t ride_music_params_update_label_58(uint32_t position, uint8_t* tun int32_t ride_music_params_update( const CoordsXYZ& rideCoords, Ride* ride, uint16_t sampleRate, uint32_t position, uint8_t* tuneId) { - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gGameSoundsOff && g_music_tracking_viewport != nullptr) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !OpenRCT2::Audio::gGameSoundsOff + && g_music_tracking_viewport != nullptr) { const ScreenCoordsXY rotatedCoords = translate_3d_to_2d_with_z(get_current_rotation(), rideCoords); rct_viewport* viewport = g_music_tracking_viewport; @@ -3584,13 +3585,13 @@ int32_t ride_music_params_update( { vol1 = vol2; } - if (vol1 < gVolumeAdjustZoom * 3) + if (vol1 < OpenRCT2::Audio::gVolumeAdjustZoom * 3) { vol1 = 0; } else { - vol1 = vol1 - (gVolumeAdjustZoom * 3); + vol1 = vol1 - (OpenRCT2::Audio::gVolumeAdjustZoom * 3); } int32_t v32 = -((static_cast(-vol1 - 1) * static_cast(-vol1 - 1)) / 16) - 700; if (vol1 && v32 >= -4000) @@ -3603,7 +3604,7 @@ int32_t ride_music_params_update( { pan_x = -10000; } - rct_ride_music* ride_music = &gRideMusicList[0]; + OpenRCT2::Audio::RideMusic* ride_music = &OpenRCT2::Audio::gRideMusicList[0]; int32_t channel = 0; uint32_t a1; while (ride_music->ride_id != ride->id || ride_music->tune_id != *tuneId) @@ -3612,19 +3613,19 @@ int32_t ride_music_params_update( channel++; if (channel >= AUDIO_MAX_RIDE_MUSIC) { - rct_ride_music_info* ride_music_info = &gRideMusicInfoList[*tuneId]; + OpenRCT2::Audio::RideMusicInfo* ride_music_info = &OpenRCT2::Audio::gRideMusicInfoList[*tuneId]; a1 = position + ride_music_info->offset; return ride_music_params_update_label_51(a1, tuneId, ride, v32, pan_x, sampleRate); } } - int32_t playing = Mixer_Channel_IsPlaying(gRideMusicList[channel].sound_channel); + int32_t playing = Mixer_Channel_IsPlaying(OpenRCT2::Audio::gRideMusicList[channel].sound_channel); if (!playing) { *tuneId = 0xFF; return 0; } - a1 = static_cast(Mixer_Channel_GetOffset(gRideMusicList[channel].sound_channel)); + a1 = static_cast(Mixer_Channel_GetOffset(OpenRCT2::Audio::gRideMusicList[channel].sound_channel)); return ride_music_params_update_label_51(a1, tuneId, ride, v32, pan_x, sampleRate); } @@ -3646,17 +3647,17 @@ void ride_music_update_final() return; // TODO Allow circus music (CSS24) to play if ride music is disabled (that should be sound) - if (gGameSoundsOff || !gConfigSound.ride_music_enabled) + if (OpenRCT2::Audio::gGameSoundsOff || !gConfigSound.ride_music_enabled) return; // Stop currently playing music that is not in music params list or not playing? - for (auto& rideMusic : gRideMusicList) + for (auto& rideMusic : OpenRCT2::Audio::gRideMusicList) { if (rideMusic.ride_id != RIDE_ID_NULL) { - rct_ride_music_params* rideMusicParams = &gRideMusicParamsList[0]; + OpenRCT2::Audio::RideMusicParams* rideMusicParams = &OpenRCT2::Audio::gRideMusicParamsList[0]; int32_t isPlaying = 0; - while (rideMusicParams < gRideMusicParamsListEnd && !isPlaying) + while (rideMusicParams < OpenRCT2::Audio::gRideMusicParamsListEnd && !isPlaying) { if (rideMusicParams->ride_id == rideMusic.ride_id && rideMusicParams->tune_id == rideMusic.tune_id) { @@ -3674,12 +3675,12 @@ void ride_music_update_final() } int32_t freeChannelIndex = 0; - for (rct_ride_music_params* rideMusicParams = &gRideMusicParamsList[0]; rideMusicParams < gRideMusicParamsListEnd; - rideMusicParams++) + for (auto* rideMusicParams = &OpenRCT2::Audio::gRideMusicParamsList[0]; + rideMusicParams < OpenRCT2::Audio::gRideMusicParamsListEnd; rideMusicParams++) { if (rideMusicParams->ride_id != RIDE_ID_NULL) { - rct_ride_music* rideMusic = &gRideMusicList[0]; + auto* rideMusic = &OpenRCT2::Audio::gRideMusicList[0]; int32_t channelIndex = 0; // Look for existing entry, if not found start playing the sound, otherwise update parameters. while (rideMusicParams->ride_id != rideMusic->ride_id || rideMusicParams->tune_id != rideMusic->tune_id) @@ -3692,8 +3693,8 @@ void ride_music_update_final() channelIndex++; if (channelIndex >= AUDIO_MAX_RIDE_MUSIC) { - rct_ride_music_info* ride_music_info = &gRideMusicInfoList[rideMusicParams->tune_id]; - rct_ride_music* ride_music_3 = &gRideMusicList[freeChannelIndex]; + auto* ride_music_info = &OpenRCT2::Audio::gRideMusicInfoList[rideMusicParams->tune_id]; + auto* ride_music_3 = &OpenRCT2::Audio::gRideMusicList[freeChannelIndex]; ride_music_3->sound_channel = Mixer_Play_Music(ride_music_info->path_id, MIXER_LOOP_NONE, true); if (ride_music_3->sound_channel) { @@ -4398,13 +4399,13 @@ static Vehicle* vehicle_create_car( vehicle->spin_sprite = 0; vehicle->spin_speed = 0; vehicle->sound2_flags = 0; - vehicle->sound1_id = SoundId::Null; - vehicle->sound2_id = SoundId::Null; + vehicle->sound1_id = OpenRCT2::Audio::SoundId::Null; + vehicle->sound2_id = OpenRCT2::Audio::SoundId::Null; vehicle->next_vehicle_on_train = SPRITE_INDEX_NULL; vehicle->var_C4 = 0; vehicle->animation_frame = 0; vehicle->var_C8 = 0; - vehicle->scream_sound_id = SoundId::Null; + vehicle->scream_sound_id = OpenRCT2::Audio::SoundId::Null; vehicle->vehicle_sprite_type = 0; vehicle->bank_rotation = 0; vehicle->target_seat_rotation = 4; diff --git a/src/openrct2/ride/RideData.cpp b/src/openrct2/ride/RideData.cpp index 68d7138490..7b3eb81b85 100644 --- a/src/openrct2/ride/RideData.cpp +++ b/src/openrct2/ride/RideData.cpp @@ -149,7 +149,7 @@ const rct_ride_entry_vehicle CableLiftVehicle = { /* .no_seating_rows = */ 0, /* .spinning_inertia = */ 0, /* .spinning_friction = */ 255, - /* .friction_sound_id = */ SoundId::LiftClassic, + /* .friction_sound_id = */ OpenRCT2::Audio::SoundId::LiftClassic, /* .log_flume_reverser_vehicle_type = */ 0, /* .sound_range = */ 0, /* .double_sound_frequency = */ 0, diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index 7010ca3748..8fd55de87f 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -96,7 +96,7 @@ struct RideHeights struct rct_ride_lift_data { - SoundId sound_id; + OpenRCT2::Audio::SoundId sound_id; uint8_t minimum_speed; uint8_t maximum_speed; }; @@ -327,7 +327,7 @@ constexpr const RideTypeDescriptor DummyRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 12, 64, 0, 0, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, nullptr), SET_FIELD(RatingsMultipliers, { 0, 0, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 6f45bd7033..8767386520 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -68,13 +68,21 @@ Vehicle* _vehicleFrontVehicle; CoordsXYZ unk_F64E20; // clang-format off -static constexpr const SoundId byte_9A3A14[] = { SoundId::Scream8, SoundId::Scream1 }; -static constexpr const SoundId byte_9A3A16[] = { SoundId::Scream1, SoundId::Scream6 }; -static constexpr const SoundId byte_9A3A18[] = { - SoundId::Scream3, SoundId::Scream1, SoundId::Scream5, SoundId::Scream6, - SoundId::Scream7, SoundId::Scream2, SoundId::Scream4 +static constexpr const OpenRCT2::Audio::SoundId byte_9A3A14[] = { OpenRCT2::Audio::SoundId::Scream8, + OpenRCT2::Audio::SoundId::Scream1 }; +static constexpr const OpenRCT2::Audio::SoundId byte_9A3A16[] = { OpenRCT2::Audio::SoundId::Scream1, + OpenRCT2::Audio::SoundId::Scream6 }; +static constexpr const OpenRCT2::Audio::SoundId byte_9A3A18[] = { + OpenRCT2::Audio::SoundId::Scream3, + OpenRCT2::Audio::SoundId::Scream1, + OpenRCT2::Audio::SoundId::Scream5, + OpenRCT2::Audio::SoundId::Scream6, + OpenRCT2::Audio::SoundId::Scream7, + OpenRCT2::Audio::SoundId::Scream2, + OpenRCT2::Audio::SoundId::Scream4 }; -static constexpr const uint8_t _soundParams[RCT2SoundCount][2] = + +static constexpr const uint8_t _soundParams[OpenRCT2::Audio::RCT2SoundCount][2] = { { 1, 0 }, // LiftClassic { 1, 0 }, // TrackFrictionClassicWood @@ -650,16 +658,16 @@ static constexpr const CoordsXY AvoidCollisionMoveOffset[] = }; -static constexpr const SoundId DoorOpenSoundIds[] = +static constexpr const OpenRCT2::Audio::SoundId DoorOpenSoundIds[] = { - SoundId::DoorOpen, - SoundId::Portcullis + OpenRCT2::Audio::SoundId::DoorOpen, + OpenRCT2::Audio::SoundId::Portcullis }; -static constexpr const SoundId DoorCloseSoundIds[] = +static constexpr const OpenRCT2::Audio::SoundId DoorCloseSoundIds[] = { - SoundId::DoorClose, - SoundId::Portcullis + OpenRCT2::Audio::SoundId::DoorClose, + OpenRCT2::Audio::SoundId::Portcullis }; static const struct @@ -910,7 +918,7 @@ bool Vehicle::SoundCanPlay() const if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER) return false; - if (sound1_id == SoundId::Null && sound2_id == SoundId::Null) + if (sound1_id == OpenRCT2::Audio::SoundId::Null && sound2_id == OpenRCT2::Audio::SoundId::Null) return false; if (sprite_left == LOCATION_NULL) @@ -955,13 +963,13 @@ bool Vehicle::SoundCanPlay() const uint16_t Vehicle::GetSoundPriority() const { int32_t result = Train(this).Mass() + (std::abs(velocity) >> 13); - rct_vehicle_sound* vehicle_sound = &gVehicleSoundList[0]; + auto* vehicle_sound = &OpenRCT2::Audio::gVehicleSoundList[0]; while (vehicle_sound->id != sprite_index) { vehicle_sound++; - if (vehicle_sound >= &gVehicleSoundList[std::size(gVehicleSoundList)]) + if (vehicle_sound >= &OpenRCT2::Audio::gVehicleSoundList[std::size(OpenRCT2::Audio::gVehicleSoundList)]) { return result; } @@ -971,9 +979,9 @@ uint16_t Vehicle::GetSoundPriority() const return result + 300; } -rct_vehicle_sound_params Vehicle::CreateSoundParam(uint16_t priority) const +OpenRCT2::Audio::VehicleSoundParams Vehicle::CreateSoundParam(uint16_t priority) const { - rct_vehicle_sound_params param; + OpenRCT2::Audio::VehicleSoundParams param; param.priority = priority; int32_t panX = (sprite_left / 2) + (sprite_right / 2) - g_music_tracking_viewport->viewPos.x; panX = panX / g_music_tracking_viewport->zoom; @@ -1036,7 +1044,7 @@ rct_vehicle_sound_params Vehicle::CreateSoundParam(uint16_t priority) const * * rct2: 0x006BB9FF */ -void Vehicle::UpdateSoundParams(std::vector& vehicleSoundParamsList) const +void Vehicle::UpdateSoundParams(std::vector& vehicleSoundParamsList) const { if (!SoundCanPlay()) return; @@ -1045,7 +1053,7 @@ void Vehicle::UpdateSoundParams(std::vector& vehicleSo // Find a sound param of lower priority to use auto soundParamIter = std::find_if( vehicleSoundParamsList.begin(), vehicleSoundParamsList.end(), - [soundPriority](rct_vehicle_sound_params param) { return soundPriority > param.priority; }); + [soundPriority](const auto& param) { return soundPriority > param.priority; }); if (soundParamIter == std::end(vehicleSoundParamsList)) { @@ -1087,14 +1095,14 @@ static void vehicle_sounds_update_window_setup() g_music_tracking_viewport = viewport; gWindowAudioExclusive = window; if (viewport->zoom <= 0) - gVolumeAdjustZoom = 0; + OpenRCT2::Audio::gVolumeAdjustZoom = 0; else if (viewport->zoom == 1) - gVolumeAdjustZoom = 35; + OpenRCT2::Audio::gVolumeAdjustZoom = 35; else - gVolumeAdjustZoom = 70; + OpenRCT2::Audio::gVolumeAdjustZoom = 70; } -static uint8_t vehicle_sounds_update_get_pan_volume(rct_vehicle_sound_params* sound_params) +static uint8_t vehicle_sounds_update_get_pan_volume(OpenRCT2::Audio::VehicleSoundParams* sound_params) { uint8_t vol1 = 0xFF; uint8_t vol2 = 0xFF; @@ -1135,7 +1143,7 @@ static uint8_t vehicle_sounds_update_get_pan_volume(rct_vehicle_sound_params* so } vol1 = std::min(vol1, vol2); - return std::max(0, vol1 - gVolumeAdjustZoom); + return std::max(0, vol1 - OpenRCT2::Audio::gVolumeAdjustZoom); } /* Returns the vehicle sound for a sound_param. @@ -1144,28 +1152,28 @@ static uint8_t vehicle_sounds_update_get_pan_volume(rct_vehicle_sound_params* so * If not playing allocates a sound slot to sound_param->id. * If no free slots returns nullptr. */ -static rct_vehicle_sound* vehicle_sounds_update_get_vehicle_sound(rct_vehicle_sound_params* sound_params) +static OpenRCT2::Audio::VehicleSound* vehicle_sounds_update_get_vehicle_sound(OpenRCT2::Audio::VehicleSoundParams* sound_params) { // Search for already playing vehicle sound - rct_vehicle_sound* vehicleSound = &gVehicleSoundList[0]; - for (; vehicleSound < &gVehicleSoundList[std::size(gVehicleSoundList)]; vehicleSound++) + auto* vehicleSound = &OpenRCT2::Audio::gVehicleSoundList[0]; + for (; vehicleSound < &OpenRCT2::Audio::gVehicleSoundList[std::size(OpenRCT2::Audio::gVehicleSoundList)]; vehicleSound++) { if (vehicleSound->id == sound_params->id) return vehicleSound; } // No sound already playing - if (vehicleSound >= &gVehicleSoundList[std::size(gVehicleSoundList)]) + if (vehicleSound >= &OpenRCT2::Audio::gVehicleSoundList[std::size(OpenRCT2::Audio::gVehicleSoundList)]) { - for (vehicleSound = &gVehicleSoundList[0]; vehicleSound < &gVehicleSoundList[std::size(gVehicleSoundList)]; - vehicleSound++) + for (vehicleSound = &OpenRCT2::Audio::gVehicleSoundList[0]; + vehicleSound < &OpenRCT2::Audio::gVehicleSoundList[std::size(OpenRCT2::Audio::gVehicleSoundList)]; vehicleSound++) { // Use free slot if (vehicleSound->id == SOUND_ID_NULL) { vehicleSound->id = sound_params->id; - vehicleSound->TrackSound.Id = SoundId::Null; - vehicleSound->OtherSound.Id = SoundId::Null; + vehicleSound->TrackSound.Id = OpenRCT2::Audio::SoundId::Null; + vehicleSound->OtherSound.Id = OpenRCT2::Audio::SoundId::Null; vehicleSound->volume = 0x30; return vehicleSound; } @@ -1180,7 +1188,7 @@ enum class SoundType OtherNoises, // e.g. Screams }; -template static uint16_t SoundFrequency(const SoundId id, uint16_t baseFrequency) +template static uint16_t SoundFrequency(const OpenRCT2::Audio::SoundId id, uint16_t baseFrequency) { if constexpr (type == SoundType::TrackNoises) { @@ -1200,34 +1208,36 @@ template static uint16_t SoundFrequency(const SoundId id, uint16 } } -template static bool ShouldUpdateChannelRate(const SoundId id) +template static bool ShouldUpdateChannelRate(const OpenRCT2::Audio::SoundId id) { return type == SoundType::TrackNoises || !(_soundParams[static_cast(id)][1] & 1); } template -static void UpdateSound(const SoundId id, int32_t volume, rct_vehicle_sound_params* sound_params, Sound& sound, uint8_t panVol) +static void UpdateSound( + const OpenRCT2::Audio::SoundId id, int32_t volume, OpenRCT2::Audio::VehicleSoundParams* sound_params, + OpenRCT2::Audio::Sound& sound, uint8_t panVol) { volume *= panVol; volume = volume / 8; volume = std::max(volume - 0x1FFF, -10000); - if (id == SoundId::Null) + if (id == OpenRCT2::Audio::SoundId::Null) { - if (sound.Id != SoundId::Null) + if (sound.Id != OpenRCT2::Audio::SoundId::Null) { - sound.Id = SoundId::Null; + sound.Id = OpenRCT2::Audio::SoundId::Null; Mixer_Stop_Channel(sound.Channel); } return; } - if (sound.Id != SoundId::Null && id != sound.Id) + if (sound.Id != OpenRCT2::Audio::SoundId::Null && id != sound.Id) { Mixer_Stop_Channel(sound.Channel); } - if ((sound.Id == SoundId::Null) || (id != sound.Id)) + if ((sound.Id == OpenRCT2::Audio::SoundId::Null) || (id != sound.Id)) { sound.Id = id; sound.Pan = sound_params->pan_x; @@ -1268,10 +1278,10 @@ static void UpdateSound(const SoundId id, int32_t volume, rct_vehicle_sound_para */ void vehicle_sounds_update() { - if (!audio_is_available()) + if (!OpenRCT2::Audio::IsAvailable()) return; - std::vector vehicleSoundParamsList; + std::vector vehicleSoundParamsList; vehicleSoundParamsList.reserve(AUDIO_MAX_VEHICLE_SOUNDS); vehicle_sounds_update_window_setup(); @@ -1282,7 +1292,7 @@ void vehicle_sounds_update() } // Stop all playing sounds that no longer have priority to play after vehicle_update_sound_params - for (auto& vehicle_sound : gVehicleSoundList) + for (auto& vehicle_sound : OpenRCT2::Audio::gVehicleSoundList) { if (vehicle_sound.id != SOUND_ID_NULL) { @@ -1299,11 +1309,11 @@ void vehicle_sounds_update() if (keepPlaying) continue; - if (vehicle_sound.TrackSound.Id != SoundId::Null) + if (vehicle_sound.TrackSound.Id != OpenRCT2::Audio::SoundId::Null) { Mixer_Stop_Channel(vehicle_sound.TrackSound.Channel); } - if (vehicle_sound.OtherSound.Id != SoundId::Null) + if (vehicle_sound.OtherSound.Id != OpenRCT2::Audio::SoundId::Null) { Mixer_Stop_Channel(vehicle_sound.OtherSound.Channel); } @@ -1315,7 +1325,7 @@ void vehicle_sounds_update() { uint8_t panVol = vehicle_sounds_update_get_pan_volume(&vehicleSoundParams); - rct_vehicle_sound* vehicleSound = vehicle_sounds_update_get_vehicle_sound(&vehicleSoundParams); + auto* vehicleSound = vehicle_sounds_update_get_vehicle_sound(&vehicleSoundParams); // No free vehicle sound slots (RCT2 corrupts the pointer here) if (vehicleSound == nullptr) continue; @@ -1912,13 +1922,15 @@ void Vehicle::UpdateMeasurements() struct SoundIdVolume { - SoundId id; + OpenRCT2::Audio::SoundId id; uint8_t volume; }; -static SoundIdVolume sub_6D7AC0(SoundId currentSoundId, uint8_t currentVolume, SoundId targetSoundId, uint8_t targetVolume) +static SoundIdVolume sub_6D7AC0( + OpenRCT2::Audio::SoundId currentSoundId, uint8_t currentVolume, OpenRCT2::Audio::SoundId targetSoundId, + uint8_t targetVolume) { - if (currentSoundId != SoundId::Null) + if (currentSoundId != OpenRCT2::Audio::SoundId::Null) { if (currentSoundId == targetSoundId) { @@ -3200,14 +3212,15 @@ void Vehicle::UpdateDeparting() if (rideEntry->flags & RIDE_ENTRY_FLAG_PLAY_DEPART_SOUND) { - auto soundId = (rideEntry->vehicles[0].sound_range == 4) ? SoundId::Tram : SoundId::TrainDeparting; + auto soundId = (rideEntry->vehicles[0].sound_range == 4) ? OpenRCT2::Audio::SoundId::Tram + : OpenRCT2::Audio::SoundId::TrainDeparting; - audio_play_sound_at_location(soundId, { x, y, z }); + OpenRCT2::Audio::Play3D(soundId, { x, y, z }); } if (curRide->mode == RideMode::UpwardLaunch || (curRide->mode == RideMode::DownwardLaunch && var_CE > 1)) { - audio_play_sound_at_location(SoundId::RideLaunch2, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch2, { x, y, z }); } if (!(curRide->lifecycle_flags & RIDE_LIFECYCLE_TESTED)) @@ -3420,7 +3433,7 @@ void Vehicle::FinishDeparting() if (var_CE >= 1 && (14 << 16) > velocity) return; - audio_play_sound_at_location(SoundId::RideLaunch1, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch1, { x, y, z }); } if (curRide->mode == RideMode::UpwardLaunch) @@ -3428,7 +3441,7 @@ void Vehicle::FinishDeparting() if ((curRide->launch_speed << 16) > velocity) return; - audio_play_sound_at_location(SoundId::RideLaunch1, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch1, { x, y, z }); } if (curRide->mode != RideMode::Race && !curRide->IsBlockSectioned()) @@ -3558,7 +3571,7 @@ void Vehicle::UpdateCollisionSetup() train->sub_state = 2; - audio_play_sound_at_location(SoundId::Crash, { train->x, train->y, train->z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, { train->x, train->y, train->z }); sprite_misc_explosion_cloud_create({ train->x, train->y, train->z }); @@ -3620,7 +3633,7 @@ void Vehicle::UpdateCrashSetup() if (NumPeepsUntilTrainTail() != 0) { - audio_play_sound_at_location(SoundId::HauntedHouseScream2, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScream2, { x, y, z }); } int32_t edx = velocity >> 10; @@ -4051,7 +4064,7 @@ loc_6D8E36: if ((curRide->mode == RideMode::UpwardLaunch || curRide->mode == RideMode::DownwardLaunch) && var_CE < 2) { - audio_play_sound_at_location(SoundId::RideLaunch2, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::RideLaunch2, { x, y, z }); velocity = 0; acceleration = 0; SetState(Vehicle::Status::Departing, 1); @@ -5044,24 +5057,24 @@ void Vehicle::UpdateHauntedHouseOperating() switch (current_time) { case 45: - audio_play_sound_at_location(SoundId::HauntedHouseScare, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScare, { x, y, z }); break; case 75: vehicle_sprite_type = 1; Invalidate(); break; case 400: - audio_play_sound_at_location(SoundId::HauntedHouseScream1, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScream1, { x, y, z }); break; case 745: - audio_play_sound_at_location(SoundId::HauntedHouseScare, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScare, { x, y, z }); break; case 775: vehicle_sprite_type = 1; Invalidate(); break; case 1100: - audio_play_sound_at_location(SoundId::HauntedHouseScream2, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::HauntedHouseScream2, { x, y, z }); break; } } @@ -5317,7 +5330,7 @@ void Vehicle::CrashOnLand() } sub_state = 2; - audio_play_sound_at_location(SoundId::Crash, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Crash, { x, y, z }); sprite_misc_explosion_cloud_create({ x, y, z }); sprite_misc_explosion_flare_create({ x, y, z }); @@ -5380,7 +5393,7 @@ void Vehicle::CrashOnWater() } sub_state = 2; - audio_play_sound_at_location(SoundId::Water1, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Water1, { x, y, z }); crash_splash_create({ x, y, z }); crash_splash_create({ x - 8, y - 9, z }); @@ -5499,9 +5512,9 @@ void Vehicle::UpdateSound() { // frictionVolume (bl) should be set before hand uint8_t frictionVolume = 255; - SoundId frictionId = SoundId::Null; + auto frictionId = OpenRCT2::Audio::SoundId::Null; // bh screamVolume should be set before hand - SoundId screamId = SoundId::Null; + auto screamId = OpenRCT2::Audio::SoundId::Null; uint8_t screamVolume = 255; auto curRide = GetRide(); @@ -5528,18 +5541,18 @@ void Vehicle::UpdateSound() screamId = scream_sound_id; if (!(gCurrentTicks & 0x7F)) { - if (velocity < 0x40000 || scream_sound_id != SoundId::Null) + if (velocity < 0x40000 || scream_sound_id != OpenRCT2::Audio::SoundId::Null) goto loc_6D7A97; if ((scenario_rand() & 0xFFFF) <= 0x5555) { - scream_sound_id = SoundId::TrainWhistle; + scream_sound_id = OpenRCT2::Audio::SoundId::TrainWhistle; screamVolume = 255; break; } } - if (screamId == SoundId::NoScream) - screamId = SoundId::Null; + if (screamId == OpenRCT2::Audio::SoundId::NoScream) + screamId = OpenRCT2::Audio::SoundId::Null; screamVolume = 255; break; @@ -5547,18 +5560,18 @@ void Vehicle::UpdateSound() screamId = scream_sound_id; if (!(gCurrentTicks & 0x7F)) { - if (velocity < 0x40000 || scream_sound_id != SoundId::Null) + if (velocity < 0x40000 || scream_sound_id != OpenRCT2::Audio::SoundId::Null) goto loc_6D7A97; if ((scenario_rand() & 0xFFFF) <= 0x5555) { - scream_sound_id = SoundId::Tram; + scream_sound_id = OpenRCT2::Audio::SoundId::Tram; screamVolume = 255; break; } } - if (screamId == SoundId::NoScream) - screamId = SoundId::Null; + if (screamId == OpenRCT2::Audio::SoundId::NoScream) + screamId = OpenRCT2::Audio::SoundId::Null; screamVolume = 255; break; @@ -5566,22 +5579,22 @@ void Vehicle::UpdateSound() if ((vehicleEntry->flags & VEHICLE_ENTRY_FLAG_RIDERS_SCREAM)) { screamId = UpdateScreamSound(); - if (screamId == SoundId::NoScream) - screamId = SoundId::Null; - else if (screamId == SoundId::Null) + if (screamId == OpenRCT2::Audio::SoundId::NoScream) + screamId = OpenRCT2::Audio::SoundId::Null; + else if (screamId == OpenRCT2::Audio::SoundId::Null) goto loc_6D7A97; break; } loc_6D7A97: - scream_sound_id = SoundId::Null; + scream_sound_id = OpenRCT2::Audio::SoundId::Null; if (curRide->type < std::size(RideTypeDescriptors)) { // Get lift hill sound screamId = RideTypeDescriptors[curRide->type].LiftData.sound_id; screamVolume = 243; if (!(sound2_flags & VEHICLE_SOUND2_FLAGS_LIFT_HILL)) - screamId = SoundId::Null; + screamId = OpenRCT2::Audio::SoundId::Null; } } @@ -5607,16 +5620,16 @@ void Vehicle::UpdateSound() * * rct2: 0x006D796B */ -SoundId Vehicle::UpdateScreamSound() +OpenRCT2::Audio::SoundId Vehicle::UpdateScreamSound() { int32_t totalNumPeeps = NumPeepsUntilTrainTail(); if (totalNumPeeps == 0) - return SoundId::Null; + return OpenRCT2::Audio::SoundId::Null; if (velocity < 0) { if (velocity > -0x2C000) - return SoundId::Null; + return OpenRCT2::Audio::SoundId::Null; for (Vehicle* vehicle2 = GetEntity(sprite_index); vehicle2 != nullptr; vehicle2 = GetEntity(vehicle2->next_vehicle_on_train)) @@ -5630,11 +5643,11 @@ SoundId Vehicle::UpdateScreamSound() if (vehicle2->vehicle_sprite_type <= 15) return ProduceScreamSound(totalNumPeeps); } - return SoundId::Null; + return OpenRCT2::Audio::SoundId::Null; } if (velocity < 0x2C000) - return SoundId::Null; + return OpenRCT2::Audio::SoundId::Null; for (Vehicle* vehicle2 = GetEntity(sprite_index); vehicle2 != nullptr; vehicle2 = GetEntity(vehicle2->next_vehicle_on_train)) @@ -5648,16 +5661,16 @@ SoundId Vehicle::UpdateScreamSound() if (vehicle2->vehicle_sprite_type <= 23) return ProduceScreamSound(totalNumPeeps); } - return SoundId::Null; + return OpenRCT2::Audio::SoundId::Null; } -SoundId Vehicle::ProduceScreamSound(const int32_t totalNumPeeps) +OpenRCT2::Audio::SoundId Vehicle::ProduceScreamSound(const int32_t totalNumPeeps) { rct_ride_entry* rideEntry = GetRideEntry(); rct_ride_entry_vehicle* vehicleEntry = &rideEntry->vehicles[vehicle_type]; - if (scream_sound_id == SoundId::Null) + if (scream_sound_id == OpenRCT2::Audio::SoundId::Null) { auto r = scenario_rand(); if (totalNumPeeps >= static_cast(r % 16)) @@ -5674,13 +5687,13 @@ SoundId Vehicle::ProduceScreamSound(const int32_t totalNumPeeps) scream_sound_id = byte_9A3A16[r % 2]; break; default: - scream_sound_id = SoundId::NoScream; + scream_sound_id = OpenRCT2::Audio::SoundId::NoScream; break; } } else { - scream_sound_id = SoundId::NoScream; + scream_sound_id = OpenRCT2::Audio::SoundId::NoScream; } } return scream_sound_id; @@ -6786,7 +6799,7 @@ static void block_brakes_open_previous_section(Ride& ride, const CoordsXYZ& vehi { if (ride.IsBlockSectioned()) { - audio_play_sound_at_location(SoundId::BlockBrakeClose, location); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::BlockBrakeClose, location); } } } @@ -7398,9 +7411,9 @@ static void play_scenery_door_open_sound(const CoordsXYZ& loc, WallElement* tile if (doorSoundType != 0) { auto soundId = DoorOpenSoundIds[doorSoundType - 1]; - if (soundId != SoundId::Null) + if (soundId != OpenRCT2::Audio::SoundId::Null) { - audio_play_sound_at_location(soundId, loc); + OpenRCT2::Audio::Play3D(soundId, loc); } } } @@ -7416,9 +7429,9 @@ static void play_scenery_door_close_sound(const CoordsXYZ& loc, WallElement* til if (doorSoundType != 0) { auto soundId = DoorCloseSoundIds[doorSoundType - 1]; - if (soundId != SoundId::Null) + if (soundId != OpenRCT2::Audio::SoundId::Null) { - audio_play_sound_at_location(soundId, loc); + Play3D(soundId, loc); } } } @@ -7531,7 +7544,7 @@ static void vehicle_update_play_water_splash_sound() return; } - audio_play_sound_at_location(SoundId::WaterSplash, { unk_F64E20.x, unk_F64E20.y, unk_F64E20.z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::WaterSplash, { unk_F64E20.x, unk_F64E20.y, unk_F64E20.z }); } /** @@ -7945,7 +7958,7 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(uint16_t trackType, Ride* cur { if (!(rideEntry->vehicles[0].flags & VEHICLE_ENTRY_FLAG_POWERED)) { - audio_play_sound_at_location(SoundId::BlockBrakeRelease, TrackLocation); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::BlockBrakeRelease, TrackLocation); } } map_invalidate_element(TrackLocation, tileElement); @@ -8144,7 +8157,7 @@ loc_6DAEB9: if (_vehicleF64E2C == 0) { _vehicleF64E2C++; - audio_play_sound_at_location(SoundId::BrakeRelease, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::BrakeRelease, { x, y, z }); } } } @@ -9828,10 +9841,10 @@ void Vehicle::Claxon() const switch (rideEntry->vehicles[vehicle_type].sound_range) { case SOUND_RANGE_WHISTLE: - audio_play_sound_at_location(SoundId::TrainWhistle, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::TrainWhistle, { x, y, z }); break; case SOUND_RANGE_BELL: - audio_play_sound_at_location(SoundId::Tram, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Tram, { x, y, z }); break; } } diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index f934360ebb..c1b9fdefb8 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -21,8 +21,6 @@ #include #include -enum class SoundId : uint8_t; - struct rct_vehicle_colour { uint8_t body_colour; @@ -79,13 +77,13 @@ struct rct_ride_entry_vehicle uint32_t curved_lift_hill_image_id; // 0x4C , 0x66 uint32_t corkscrew_image_id; // 0x4C , 0x66 }; - uint32_t no_vehicle_images; // 0x50 , 0x6A - uint8_t no_seating_rows; // 0x54 , 0x6E - uint8_t spinning_inertia; // 0x55 , 0x6F - uint8_t spinning_friction; // 0x56 , 0x70 - SoundId friction_sound_id; // 0x57 , 0x71 - uint8_t log_flume_reverser_vehicle_type; // 0x58 , 0x72 - uint8_t sound_range; // 0x59 , 0x73 + uint32_t no_vehicle_images; // 0x50 , 0x6A + uint8_t no_seating_rows; // 0x54 , 0x6E + uint8_t spinning_inertia; // 0x55 , 0x6F + uint8_t spinning_friction; // 0x56 , 0x70 + OpenRCT2::Audio::SoundId friction_sound_id; // 0x57 , 0x71 + uint8_t log_flume_reverser_vehicle_type; // 0x58 , 0x72 + uint8_t sound_range; // 0x59 , 0x73 uint8_t double_sound_frequency; // 0x5A , 0x74 (Doubles the velocity when working out the sound frequency {used on go karts}) uint8_t powered_acceleration; // 0x5B , 0x75 @@ -109,8 +107,6 @@ static_assert(sizeof(rct_ride_entry_vehicle) % 4 == 0, "Invalid struct size"); static_assert(sizeof(rct_ride_entry_vehicle) % 8 == 0, "Invalid struct size"); #endif -struct rct_vehicle_sound_params; - enum class VehicleTrackSubposition : uint8_t { Default, @@ -266,9 +262,9 @@ struct Vehicle : SpriteBase }; uint16_t sound2_flags; uint8_t spin_sprite; // lowest 3 bits not used for sprite selection (divide by 8 to use) - SoundId sound1_id; + OpenRCT2::Audio::SoundId sound1_id; uint8_t sound1_volume; - SoundId sound2_id; + OpenRCT2::Audio::SoundId sound2_id; uint8_t sound2_volume; int8_t sound_vector_factor; union @@ -289,7 +285,7 @@ struct Vehicle : SpriteBase uint8_t pad_C6[0x2]; uint16_t var_C8; uint16_t var_CA; - SoundId scream_sound_id; + OpenRCT2::Audio::SoundId scream_sound_id; VehicleTrackSubposition TrackSubposition; union { @@ -323,7 +319,7 @@ struct Vehicle : SpriteBase void Invalidate(); void SetState(Vehicle::Status vehicleStatus, uint8_t subState = 0); bool IsGhost() const; - void UpdateSoundParams(std::vector& vehicleSoundParamsList) const; + void UpdateSoundParams(std::vector& vehicleSoundParamsList) const; bool DodgemsCarWouldCollideAt(const CoordsXY& coords, uint16_t* spriteId) const; int32_t UpdateTrackMotion(int32_t* outStation); int32_t CableLiftUpdateTrackMotion(); @@ -359,7 +355,7 @@ private: uint16_t GetSoundPriority() const; const rct_vehicle_info* GetMoveInfo() const; uint16_t GetTrackProgress() const; - rct_vehicle_sound_params CreateSoundParam(uint16_t priority) const; + OpenRCT2::Audio::VehicleSoundParams CreateSoundParam(uint16_t priority) const; void CableLiftUpdate(); bool CableLiftUpdateTrackMotionForwards(); bool CableLiftUpdateTrackMotionBackwards(); @@ -400,8 +396,8 @@ private: void UpdateDoingCircusShow(); void UpdateCrossings() const; void UpdateSound(); - SoundId UpdateScreamSound(); - SoundId ProduceScreamSound(const int32_t totalNumPeeps); + OpenRCT2::Audio::SoundId UpdateScreamSound(); + OpenRCT2::Audio::SoundId ProduceScreamSound(const int32_t totalNumPeeps); void UpdateCrashSetup(); void UpdateCollisionSetup(); int32_t UpdateMotionDodgems(); diff --git a/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h b/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h index 2cae0a3e39..9a8d9a0cb3 100644 --- a/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h +++ b/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h @@ -34,7 +34,7 @@ constexpr const RideTypeDescriptor AirPoweredVerticalCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 255, 32, 4, 7, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_air_powered_vertical_coaster), SET_FIELD(RatingsMultipliers, { 44, 66, 10 }), SET_FIELD(UpkeepCosts, { 90, 20, 0, 0, 0, 10 }), diff --git a/src/openrct2/ride/coaster/meta/BobsleighCoaster.h b/src/openrct2/ride/coaster/meta/BobsleighCoaster.h index cb0606c8e3..518e604ee7 100644 --- a/src/openrct2/ride/coaster/meta/BobsleighCoaster.h +++ b/src/openrct2/ride/coaster/meta/BobsleighCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor BobsleighCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 19, 24, 5, 7, }), SET_FIELD(MaxMass, 25), - SET_FIELD(LiftData, { SoundId::LiftFrictionWheels, 4, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftFrictionWheels, 4, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_bobsleigh_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h b/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h index cde50d6855..ae2745d6f9 100644 --- a/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor ClassicMiniRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 15, 24, 4, 7, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::LiftFrictionWheels, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftFrictionWheels, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_junior_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 8, 3, 5 }), diff --git a/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h b/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h index 85f93a63f4..1e3ded169b 100644 --- a/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h +++ b/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor CompactInvertedCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 27, 40, 29, 8, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_compact_inverted_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 13, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h b/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h index 4a0f5d5ae3..b9f2ad24a7 100644 --- a/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h @@ -41,7 +41,7 @@ constexpr const RideTypeDescriptor CorkscrewRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 28, 24, 8, 11, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::LiftArrow, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftArrow, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_corkscrew_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 11, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h b/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h index eff9d2b1ae..191029311b 100644 --- a/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h @@ -38,7 +38,7 @@ constexpr const RideTypeDescriptor FlyingRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 30, 24, 8, 11, }), SET_FIELD(MaxMass, 35), - SET_FIELD(LiftData, { SoundId::LiftBM, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftBM, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_flying_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 49, 20, 90, 11, 3, 15 }), @@ -78,7 +78,7 @@ constexpr const RideTypeDescriptor FlyingRollerCoasterAltRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 30, 24, 8, 11, }), SET_FIELD(MaxMass, 35), - SET_FIELD(LiftData, { SoundId::LiftBM, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftBM, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_flying_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 49, 20, 90, 11, 3, 15 }), diff --git a/src/openrct2/ride/coaster/meta/GigaCoaster.h b/src/openrct2/ride/coaster/meta/GigaCoaster.h index cf13e3e1d3..17c2d764e3 100644 --- a/src/openrct2/ride/coaster/meta/GigaCoaster.h +++ b/src/openrct2/ride/coaster/meta/GigaCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor GigaCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 86, 24, 9, 11, }), SET_FIELD(MaxMass, 31), - SET_FIELD(LiftData, { SoundId::LiftClassic, 5, 8 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 5, 8 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_giga_coaster), SET_FIELD(RatingsMultipliers, { 51, 32, 10 }), SET_FIELD(UpkeepCosts, { 10, 20, 80, 12, 3, 40 }), diff --git a/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h b/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h index b7b136c594..aa88ef33c5 100644 --- a/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h +++ b/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor HeartlineTwisterCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 22, 24, 15, 9, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_heartline_twister_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 47, 20, 80, 11, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/HyperTwister.h b/src/openrct2/ride/coaster/meta/HyperTwister.h index 0064564c21..1ab8149ee5 100644 --- a/src/openrct2/ride/coaster/meta/HyperTwister.h +++ b/src/openrct2/ride/coaster/meta/HyperTwister.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor HyperTwisterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 54, 24, 8, 9, }), SET_FIELD(MaxMass, 31), - SET_FIELD(LiftData, { SoundId::LiftBM, 5, 8 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftBM, 5, 8 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_twister_roller_coaster), SET_FIELD(RatingsMultipliers, { 52, 36, 10 }), SET_FIELD(UpkeepCosts, { 43, 20, 80, 11, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/Hypercoaster.h b/src/openrct2/ride/coaster/meta/Hypercoaster.h index cb9f25753f..83ad16e528 100644 --- a/src/openrct2/ride/coaster/meta/Hypercoaster.h +++ b/src/openrct2/ride/coaster/meta/Hypercoaster.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor HypercoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 55, 24, 8, 11, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::LiftArrow, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftArrow, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_corkscrew_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 11, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h b/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h index f79c845338..1680f91fca 100644 --- a/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor InvertedHairpinCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 16, 24, 24, 7, }), SET_FIELD(MaxMass, 4), - SET_FIELD(LiftData, { SoundId::LiftWildMouse, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftWildMouse, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_inverted_hairpin_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 30 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 9, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h b/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h index 6e8e5fa1e6..13f78b03ed 100644 --- a/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor InvertedImpulseCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 45, 40, 29, 8, }), SET_FIELD(MaxMass, 23), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 7 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 7 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_inverted_impulse_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 180, 20, 80, 11, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h b/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h index 55c37a5b9e..2605458653 100644 --- a/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor InvertedRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 38, 40, 29, 8, }), SET_FIELD(MaxMass, 27), - SET_FIELD(LiftData, { SoundId::LiftBM, 5, 7 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftBM, 5, 7 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_inverted_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 13, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h b/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h index 875a459650..16698295c4 100644 --- a/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor JuniorRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 12, 24, 4, 7, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::LiftFrictionWheels, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftFrictionWheels, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_junior_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 8, 3, 5 }), diff --git a/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h b/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h index b4e240861c..6a6972a6a0 100644 --- a/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor LIMLaunchedRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 35, 24, 5, 7, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::Null, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_lim_launched_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 42, 20, 80, 9, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h b/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h index f255baf9a2..5c2697ee46 100644 --- a/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor LayDownRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 26, 24, 8, 11, }), SET_FIELD(MaxMass, 25), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_lay_down_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 49, 20, 90, 11, 3, 15 }), @@ -74,7 +74,7 @@ constexpr const RideTypeDescriptor LayDownRollerCoasterAltRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 26, 24, 8, 11, }), SET_FIELD(MaxMass, 25), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_lay_down_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 49, 20, 90, 11, 3, 15 }), diff --git a/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h b/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h index 69aa815f0a..7546ee7114 100644 --- a/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor LoopingRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 35, 24, 5, 7, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_looping_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/MineRide.h b/src/openrct2/ride/coaster/meta/MineRide.h index 86043d6a5e..0d30096ab6 100644 --- a/src/openrct2/ride/coaster/meta/MineRide.h +++ b/src/openrct2/ride/coaster/meta/MineRide.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor MineRideRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 13, 24, 9, 11, }), SET_FIELD(MaxMass, 27), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_mine_ride), SET_FIELD(RatingsMultipliers, { 60, 20, 10 }), SET_FIELD(UpkeepCosts, { 50, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/MineTrainCoaster.h b/src/openrct2/ride/coaster/meta/MineTrainCoaster.h index 10ca68fae9..0271f25e43 100644 --- a/src/openrct2/ride/coaster/meta/MineTrainCoaster.h +++ b/src/openrct2/ride/coaster/meta/MineTrainCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor MineTrainCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 21, 24, 4, 7, }), SET_FIELD(MaxMass, 15), - SET_FIELD(LiftData, { SoundId::LiftArrow, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftArrow, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_mine_train_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h b/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h index 05ecd7c4fb..9dd2ee1386 100644 --- a/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor MiniRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 16, 24, 9, 11, }), SET_FIELD(MaxMass, 10), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_mini_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 35, 20, 80, 8, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h b/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h index 6e609845b6..74ac7d304b 100644 --- a/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h +++ b/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor MiniSuspendedCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 10, 24, 24, 8, }), SET_FIELD(MaxMass, 3), - SET_FIELD(LiftData, { SoundId::LiftFrictionWheels, 4, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftFrictionWheels, 4, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_mini_suspended_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h b/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h index 0704210ef6..62284ed1fc 100644 --- a/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor MultiDimensionRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 40, 24, 8, 11, }), SET_FIELD(MaxMass, 78), - SET_FIELD(LiftData, { SoundId::LiftFrictionWheels, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftFrictionWheels, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_multi_dimension_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 75, 20, 90, 11, 3, 15 }), @@ -75,7 +75,7 @@ constexpr const RideTypeDescriptor MultiDimensionRollerCoasterAltRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 40, 24, 8, 11, }), SET_FIELD(MaxMass, 78), - SET_FIELD(LiftData, { SoundId::LiftFrictionWheels, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftFrictionWheels, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_multi_dimension_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 75, 20, 90, 11, 3, 15 }), diff --git a/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h b/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h index 367032a7aa..3ff016a782 100644 --- a/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h +++ b/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h @@ -34,7 +34,7 @@ constexpr const RideTypeDescriptor ReverseFreefallCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 255, 32, 4, 7, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_reverse_freefall_coaster), SET_FIELD(RatingsMultipliers, { 44, 66, 10 }), SET_FIELD(UpkeepCosts, { 80, 20, 0, 0, 0, 10 }), diff --git a/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h b/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h index 95f692dc15..2cceff26d1 100644 --- a/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor ReverserRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 18, 24, 8, 11, }), SET_FIELD(MaxMass, 15), - SET_FIELD(LiftData, { SoundId::LiftWood, 3, 4 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftWood, 3, 4 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_reverser_roller_coaster), SET_FIELD(RatingsMultipliers, { 48, 28, 7 }), SET_FIELD(UpkeepCosts, { 39, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h b/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h index 011b80b893..3ef954b5d5 100644 --- a/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor SideFrictionRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 15, 24, 4, 11, }), SET_FIELD(MaxMass, 15), - SET_FIELD(LiftData, { SoundId::LiftWood, 3, 4 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftWood, 3, 4 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_side_friction_roller_coaster), SET_FIELD(RatingsMultipliers, { 48, 28, 7 }), SET_FIELD(UpkeepCosts, { 39, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/SpinningWildMouse.h b/src/openrct2/ride/coaster/meta/SpinningWildMouse.h index 9b39954aba..34d54a4cd8 100644 --- a/src/openrct2/ride/coaster/meta/SpinningWildMouse.h +++ b/src/openrct2/ride/coaster/meta/SpinningWildMouse.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor SpinningWildMouseRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 16, 24, 4, 7, }), SET_FIELD(MaxMass, 4), - SET_FIELD(LiftData, { SoundId::LiftWildMouse, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftWildMouse, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_wild_mouse), SET_FIELD(RatingsMultipliers, { 50, 30, 30 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 9, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h b/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h index 003bd4c40c..0ce066851f 100644 --- a/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor SpiralRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 19, 24, 9, 11, }), SET_FIELD(MaxMass, 31), - SET_FIELD(LiftData, { SoundId::LiftFrictionWheels, 7, 7 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftFrictionWheels, 7, 7 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_spiral_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 41, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h b/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h index 4921622fbe..befb339497 100644 --- a/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor StandUpRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 25, 24, 9, 11, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_stand_up_roller_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/SteelWildMouse.h b/src/openrct2/ride/coaster/meta/SteelWildMouse.h index 44cc768f31..3a5109fd2e 100644 --- a/src/openrct2/ride/coaster/meta/SteelWildMouse.h +++ b/src/openrct2/ride/coaster/meta/SteelWildMouse.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor SteelWildMouseRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 16, 24, 4, 7, }), SET_FIELD(MaxMass, 4), - SET_FIELD(LiftData, { SoundId::LiftWildMouse, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftWildMouse, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_wild_mouse), SET_FIELD(RatingsMultipliers, { 50, 30, 30 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 9, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/Steeplechase.h b/src/openrct2/ride/coaster/meta/Steeplechase.h index 3a0582ca22..1b173a7776 100644 --- a/src/openrct2/ride/coaster/meta/Steeplechase.h +++ b/src/openrct2/ride/coaster/meta/Steeplechase.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor SteeplechaseRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 14, 24, 7, 7, }), SET_FIELD(MaxMass, 4), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_steeplechase), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h b/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h index c1fb2ca879..f2d486b9d1 100644 --- a/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h +++ b/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor SuspendedSwingingCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 24, 40, 29, 8, }), SET_FIELD(MaxMass, 26), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_suspended_swinging_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 20, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h b/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h index ef39083783..1fa599caf7 100644 --- a/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h @@ -44,7 +44,7 @@ constexpr const RideTypeDescriptor TwisterRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 40, 24, 8, 9, }), SET_FIELD(MaxMass, 31), - SET_FIELD(LiftData, { SoundId::LiftBM, 5, 8 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftBM, 5, 8 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_twister_roller_coaster), SET_FIELD(RatingsMultipliers, { 52, 36, 10 }), SET_FIELD(UpkeepCosts, { 43, 20, 80, 11, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h b/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h index 7683f2a7fb..1f3d0352f0 100644 --- a/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h +++ b/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor VerticalDropCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 53, 24, 8, 11, }), SET_FIELD(MaxMass, 25), - SET_FIELD(LiftData, { SoundId::LiftBM, 4, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftBM, 4, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_vertical_drop_roller_coaster), SET_FIELD(RatingsMultipliers, { 52, 38, 10 }), SET_FIELD(UpkeepCosts, { 44, 20, 80, 11, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/VirginiaReel.h b/src/openrct2/ride/coaster/meta/VirginiaReel.h index 35163cf393..3d4af486fd 100644 --- a/src/openrct2/ride/coaster/meta/VirginiaReel.h +++ b/src/openrct2/ride/coaster/meta/VirginiaReel.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor VirginiaReelRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 14, 24, 6, 7, }), SET_FIELD(MaxMass, 15), - SET_FIELD(LiftData, { SoundId::LiftClassic, 3, 4 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 3, 4 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_virginia_reel), SET_FIELD(RatingsMultipliers, { 30, 15, 25 }), SET_FIELD(UpkeepCosts, { 39, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/WaterCoaster.h b/src/openrct2/ride/coaster/meta/WaterCoaster.h index 7541d9e576..eee84827e0 100644 --- a/src/openrct2/ride/coaster/meta/WaterCoaster.h +++ b/src/openrct2/ride/coaster/meta/WaterCoaster.h @@ -38,7 +38,7 @@ constexpr const RideTypeDescriptor WaterCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 18, 24, 4, 7, }), SET_FIELD(MaxMass, 13), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 6 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_water_coaster), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 60, 20, 80, 8, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h b/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h index b146f39792..4dc0472f76 100644 --- a/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor WoodenRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 41, 24, 8, 11, }), SET_FIELD(MaxMass, 19), - SET_FIELD(LiftData, { SoundId::LiftWood, 5, 7 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftWood, 5, 7 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_wooden_roller_coaster), SET_FIELD(RatingsMultipliers, { 52, 33, 8 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/WoodenWildMouse.h b/src/openrct2/ride/coaster/meta/WoodenWildMouse.h index c4fd2a97fc..5b8fc32ce8 100644 --- a/src/openrct2/ride/coaster/meta/WoodenWildMouse.h +++ b/src/openrct2/ride/coaster/meta/WoodenWildMouse.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor WoodenWildMouseRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 14, 24, 4, 7, }), SET_FIELD(MaxMass, 4), - SET_FIELD(LiftData, { SoundId::LiftClassic, 4, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 4, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_wooden_wild_mouse), SET_FIELD(RatingsMultipliers, { 50, 30, 30 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 9, 3, 10 }), diff --git a/src/openrct2/ride/gentle/meta/CarRide.h b/src/openrct2/ride/gentle/meta/CarRide.h index f82608540c..5e860ea9b5 100644 --- a/src/openrct2/ride/gentle/meta/CarRide.h +++ b/src/openrct2/ride/gentle/meta/CarRide.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor CarRideRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 6, 24, 4, 7, }), SET_FIELD(MaxMass, 2), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_car_ride), SET_FIELD(RatingsMultipliers, { 70, 10, 10 }), SET_FIELD(UpkeepCosts, { 70, 20, 0, 8, 3, 5 }), diff --git a/src/openrct2/ride/gentle/meta/Circus.h b/src/openrct2/ride/gentle/meta/Circus.h index 8cdf848223..8e47ac5562 100644 --- a/src/openrct2/ride/gentle/meta/Circus.h +++ b/src/openrct2/ride/gentle/meta/Circus.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor CircusRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 12, 128, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_circus), SET_FIELD(RatingsMultipliers, { 20, 10, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/CrookedHouse.h b/src/openrct2/ride/gentle/meta/CrookedHouse.h index fc358d5a0f..a5b2bd3ac5 100644 --- a/src/openrct2/ride/gentle/meta/CrookedHouse.h +++ b/src/openrct2/ride/gentle/meta/CrookedHouse.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor CrookedHouseRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 16, 96, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_crooked_house), SET_FIELD(RatingsMultipliers, { 15, 8, 0 }), SET_FIELD(UpkeepCosts, { 30, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/Dodgems.h b/src/openrct2/ride/gentle/meta/Dodgems.h index 82db9a64ea..77e174dcc8 100644 --- a/src/openrct2/ride/gentle/meta/Dodgems.h +++ b/src/openrct2/ride/gentle/meta/Dodgems.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor DodgemsRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 9, 48, 2, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_dodgems), SET_FIELD(RatingsMultipliers, { 40, 20, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 5, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/FerrisWheel.h b/src/openrct2/ride/gentle/meta/FerrisWheel.h index 538639dfde..09ac381baf 100644 --- a/src/openrct2/ride/gentle/meta/FerrisWheel.h +++ b/src/openrct2/ride/gentle/meta/FerrisWheel.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor FerrisWheelRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 16, 176, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_ferris_wheel), SET_FIELD(RatingsMultipliers, { 60, 20, 10 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/FlyingSaucers.h b/src/openrct2/ride/gentle/meta/FlyingSaucers.h index 801e3a819f..536a644231 100644 --- a/src/openrct2/ride/gentle/meta/FlyingSaucers.h +++ b/src/openrct2/ride/gentle/meta/FlyingSaucers.h @@ -38,7 +38,7 @@ constexpr const RideTypeDescriptor FlyingSaucersRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 9, 48, 2, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_flying_saucers), SET_FIELD(RatingsMultipliers, { 50, 25, 0 }), SET_FIELD(UpkeepCosts, { 90, 1, 0, 5, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/GhostTrain.h b/src/openrct2/ride/gentle/meta/GhostTrain.h index 3c266bb466..00ce7e58f3 100644 --- a/src/openrct2/ride/gentle/meta/GhostTrain.h +++ b/src/openrct2/ride/gentle/meta/GhostTrain.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor GhostTrainRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 8, 24, 6, 7, }), SET_FIELD(MaxMass, 2), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_ghost_train), SET_FIELD(RatingsMultipliers, { 70, 10, 10 }), SET_FIELD(UpkeepCosts, { 80, 20, 0, 8, 3, 5 }), diff --git a/src/openrct2/ride/gentle/meta/HauntedHouse.h b/src/openrct2/ride/gentle/meta/HauntedHouse.h index 8324d15279..28321c2320 100644 --- a/src/openrct2/ride/gentle/meta/HauntedHouse.h +++ b/src/openrct2/ride/gentle/meta/HauntedHouse.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor HauntedHouseRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 16, 160, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_haunted_house), SET_FIELD(RatingsMultipliers, { 20, 10, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/Maze.h b/src/openrct2/ride/gentle/meta/Maze.h index 2657ac96a9..26c57ccf0c 100644 --- a/src/openrct2/ride/gentle/meta/Maze.h +++ b/src/openrct2/ride/gentle/meta/Maze.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor MazeRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 6, 24, 0, 1, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_maze), SET_FIELD(RatingsMultipliers, { 50, 0, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/MerryGoRound.h b/src/openrct2/ride/gentle/meta/MerryGoRound.h index b14c1eda61..aadb335ef8 100644 --- a/src/openrct2/ride/gentle/meta/MerryGoRound.h +++ b/src/openrct2/ride/gentle/meta/MerryGoRound.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor MerryGoRoundRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_CONTROL_FAILURE)), SET_FIELD(Heights, { 12, 64, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_merry_go_round), SET_FIELD(RatingsMultipliers, { 50, 10, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/MiniGolf.h b/src/openrct2/ride/gentle/meta/MiniGolf.h index 5cfa220801..b73a3539a6 100644 --- a/src/openrct2/ride/gentle/meta/MiniGolf.h +++ b/src/openrct2/ride/gentle/meta/MiniGolf.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor MiniGolfRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 7, 32, 2, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_mini_golf), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 30, 20, 80, 11, 3, 10 }), diff --git a/src/openrct2/ride/gentle/meta/MiniHelicopters.h b/src/openrct2/ride/gentle/meta/MiniHelicopters.h index f1002d836d..90905dc6b6 100644 --- a/src/openrct2/ride/gentle/meta/MiniHelicopters.h +++ b/src/openrct2/ride/gentle/meta/MiniHelicopters.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor MiniHelicoptersRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 7, 24, 4, 7, }), SET_FIELD(MaxMass, 2), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_mini_helicopters), SET_FIELD(RatingsMultipliers, { 70, 10, 10 }), SET_FIELD(UpkeepCosts, { 70, 20, 0, 8, 3, 5 }), diff --git a/src/openrct2/ride/gentle/meta/MonorailCycles.h b/src/openrct2/ride/gentle/meta/MonorailCycles.h index f8cc969e78..75f1f53247 100644 --- a/src/openrct2/ride/gentle/meta/MonorailCycles.h +++ b/src/openrct2/ride/gentle/meta/MonorailCycles.h @@ -38,7 +38,7 @@ constexpr const RideTypeDescriptor MonorailCyclesRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 5, 24, 8, 7, }), SET_FIELD(MaxMass, 2), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_monorail_cycles), SET_FIELD(RatingsMultipliers, { 50, 10, 10 }), SET_FIELD(UpkeepCosts, { 47, 20, 0, 8, 3, 5 }), diff --git a/src/openrct2/ride/gentle/meta/MonsterTrucks.h b/src/openrct2/ride/gentle/meta/MonsterTrucks.h index 7a77de871d..87cf94280a 100644 --- a/src/openrct2/ride/gentle/meta/MonsterTrucks.h +++ b/src/openrct2/ride/gentle/meta/MonsterTrucks.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor MonsterTrucksRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 18, 24, 4, 7, }), SET_FIELD(MaxMass, 2), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_car_ride), SET_FIELD(RatingsMultipliers, { 70, 10, 10 }), SET_FIELD(UpkeepCosts, { 70, 20, 0, 8, 3, 5 }), diff --git a/src/openrct2/ride/gentle/meta/ObservationTower.h b/src/openrct2/ride/gentle/meta/ObservationTower.h index 76ac530101..fce0e6bf32 100644 --- a/src/openrct2/ride/gentle/meta/ObservationTower.h +++ b/src/openrct2/ride/gentle/meta/ObservationTower.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor ObservationTowerRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 255, 32, 3, 2, }), SET_FIELD(MaxMass, 15), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_observation_tower), SET_FIELD(RatingsMultipliers, { 80, 10, 0 }), SET_FIELD(UpkeepCosts, { 50, 20, 0, 10, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/SpaceRings.h b/src/openrct2/ride/gentle/meta/SpaceRings.h index 30fdfff9be..b679789b91 100644 --- a/src/openrct2/ride/gentle/meta/SpaceRings.h +++ b/src/openrct2/ride/gentle/meta/SpaceRings.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor SpaceRingsRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 16, 48, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_space_rings), SET_FIELD(RatingsMultipliers, { 12, 4, 4 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/gentle/meta/SpiralSlide.h b/src/openrct2/ride/gentle/meta/SpiralSlide.h index fc53b92960..a2c891c5b2 100644 --- a/src/openrct2/ride/gentle/meta/SpiralSlide.h +++ b/src/openrct2/ride/gentle/meta/SpiralSlide.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor SpiralSlideRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 15, 128, 0, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_spiral_slide), SET_FIELD(RatingsMultipliers, { 50, 10, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/shops/meta/CashMachine.h b/src/openrct2/ride/shops/meta/CashMachine.h index 9b0ff00b90..ec3226612d 100644 --- a/src/openrct2/ride/shops/meta/CashMachine.h +++ b/src/openrct2/ride/shops/meta/CashMachine.h @@ -34,7 +34,7 @@ constexpr const RideTypeDescriptor CashMachineRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 12, 32, 0, 0, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_cash_machine), SET_FIELD(RatingsMultipliers, { 0, 0, 0 }), SET_FIELD(UpkeepCosts, { 40, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/shops/meta/DrinkStall.h b/src/openrct2/ride/shops/meta/DrinkStall.h index 0ad837cae8..9487eb2020 100644 --- a/src/openrct2/ride/shops/meta/DrinkStall.h +++ b/src/openrct2/ride/shops/meta/DrinkStall.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor DrinkStallRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 12, 64, 0, 0, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_drink_stall), SET_FIELD(RatingsMultipliers, { 0, 0, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/shops/meta/FirstAid.h b/src/openrct2/ride/shops/meta/FirstAid.h index 041fa6be68..24cffe81c8 100644 --- a/src/openrct2/ride/shops/meta/FirstAid.h +++ b/src/openrct2/ride/shops/meta/FirstAid.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor FirstAidRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 12, 48, 0, 0, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_first_aid), SET_FIELD(RatingsMultipliers, { 0, 0, 0 }), SET_FIELD(UpkeepCosts, { 45, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/shops/meta/FoodStall.h b/src/openrct2/ride/shops/meta/FoodStall.h index f3a5231f43..136a0bfa29 100644 --- a/src/openrct2/ride/shops/meta/FoodStall.h +++ b/src/openrct2/ride/shops/meta/FoodStall.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor FoodStallRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 12, 64, 0, 0, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_food_stall), SET_FIELD(RatingsMultipliers, { 0, 0, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/shops/meta/InformationKiosk.h b/src/openrct2/ride/shops/meta/InformationKiosk.h index 6487e4fed4..e666b8377f 100644 --- a/src/openrct2/ride/shops/meta/InformationKiosk.h +++ b/src/openrct2/ride/shops/meta/InformationKiosk.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor InformationKioskRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 12, 48, 0, 0, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_information_kiosk), SET_FIELD(RatingsMultipliers, { 0, 0, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/shops/meta/Shop.h b/src/openrct2/ride/shops/meta/Shop.h index dc7ffa1118..0927e59f89 100644 --- a/src/openrct2/ride/shops/meta/Shop.h +++ b/src/openrct2/ride/shops/meta/Shop.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor ShopRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 12, 64, 0, 0, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_shop), SET_FIELD(RatingsMultipliers, { 0, 0, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/shops/meta/Toilets.h b/src/openrct2/ride/shops/meta/Toilets.h index fe0e6273ba..58990ab8d4 100644 --- a/src/openrct2/ride/shops/meta/Toilets.h +++ b/src/openrct2/ride/shops/meta/Toilets.h @@ -35,7 +35,7 @@ constexpr const RideTypeDescriptor ToiletsRTD = SET_FIELD(AvailableBreakdowns, 0), SET_FIELD(Heights, { 12, 32, 0, 0, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_toilets), SET_FIELD(RatingsMultipliers, { 0, 0, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/3DCinema.h b/src/openrct2/ride/thrill/meta/3DCinema.h index 00821da389..2ad4b33428 100644 --- a/src/openrct2/ride/thrill/meta/3DCinema.h +++ b/src/openrct2/ride/thrill/meta/3DCinema.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor CinemaRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 12, 128, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_3d_cinema), SET_FIELD(RatingsMultipliers, { 20, 10, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/Enterprise.h b/src/openrct2/ride/thrill/meta/Enterprise.h index 804ba34d64..da0d0f4228 100644 --- a/src/openrct2/ride/thrill/meta/Enterprise.h +++ b/src/openrct2/ride/thrill/meta/Enterprise.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor EnterpriseRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 16, 160, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_enterprise), SET_FIELD(RatingsMultipliers, { 50, 10, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/GoKarts.h b/src/openrct2/ride/thrill/meta/GoKarts.h index 9beb5adc8f..037a70fcbc 100644 --- a/src/openrct2/ride/thrill/meta/GoKarts.h +++ b/src/openrct2/ride/thrill/meta/GoKarts.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor GoKartsRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 7, 24, 2, 1, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_go_karts), SET_FIELD(RatingsMultipliers, { 120, 20, 0 }), SET_FIELD(UpkeepCosts, { 50, 20, 0, 8, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/LaunchedFreefall.h b/src/openrct2/ride/thrill/meta/LaunchedFreefall.h index eedc4f50a9..5f0708fda3 100644 --- a/src/openrct2/ride/thrill/meta/LaunchedFreefall.h +++ b/src/openrct2/ride/thrill/meta/LaunchedFreefall.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor LaunchedFreefallRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 255, 32, 3, 2, }), SET_FIELD(MaxMass, 15), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_launched_freefall), SET_FIELD(RatingsMultipliers, { 50, 50, 10 }), SET_FIELD(UpkeepCosts, { 50, 20, 0, 10, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/MagicCarpet.h b/src/openrct2/ride/thrill/meta/MagicCarpet.h index 3ad5fd79ec..4b0ac8afc0 100644 --- a/src/openrct2/ride/thrill/meta/MagicCarpet.h +++ b/src/openrct2/ride/thrill/meta/MagicCarpet.h @@ -38,7 +38,7 @@ constexpr const RideTypeDescriptor MagicCarpetRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 15, 176, 7, 11, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_magic_carpet), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/MotionSimulator.h b/src/openrct2/ride/thrill/meta/MotionSimulator.h index 20d63948da..6c2699612e 100644 --- a/src/openrct2/ride/thrill/meta/MotionSimulator.h +++ b/src/openrct2/ride/thrill/meta/MotionSimulator.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor MotionSimulatorRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 12, 64, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_motion_simulator), SET_FIELD(RatingsMultipliers, { 24, 20, 10 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/RotoDrop.h b/src/openrct2/ride/thrill/meta/RotoDrop.h index d7daa5f47d..ef05b11595 100644 --- a/src/openrct2/ride/thrill/meta/RotoDrop.h +++ b/src/openrct2/ride/thrill/meta/RotoDrop.h @@ -38,7 +38,7 @@ constexpr const RideTypeDescriptor RotoDropRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 255, 32, 3, 2, }), SET_FIELD(MaxMass, 15), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_roto_drop), SET_FIELD(RatingsMultipliers, { 50, 50, 10 }), SET_FIELD(UpkeepCosts, { 50, 20, 0, 10, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/SwingingInverterShip.h b/src/openrct2/ride/thrill/meta/SwingingInverterShip.h index 861db0df68..54fc834655 100644 --- a/src/openrct2/ride/thrill/meta/SwingingInverterShip.h +++ b/src/openrct2/ride/thrill/meta/SwingingInverterShip.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor SwingingInverterShipRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 15, 176, 7, 11, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_inverter_ship), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/SwingingShip.h b/src/openrct2/ride/thrill/meta/SwingingShip.h index 625ae249e5..4d2e91ace6 100644 --- a/src/openrct2/ride/thrill/meta/SwingingShip.h +++ b/src/openrct2/ride/thrill/meta/SwingingShip.h @@ -38,7 +38,7 @@ constexpr const RideTypeDescriptor SwingingShipRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 12, 112, 7, 11, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_swinging_ship), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/TopSpin.h b/src/openrct2/ride/thrill/meta/TopSpin.h index 2260fd90bf..43963804ca 100644 --- a/src/openrct2/ride/thrill/meta/TopSpin.h +++ b/src/openrct2/ride/thrill/meta/TopSpin.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor TopSpinRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 16, 112, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_top_spin), SET_FIELD(RatingsMultipliers, { 24, 20, 10 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/thrill/meta/Twist.h b/src/openrct2/ride/thrill/meta/Twist.h index 4e5bf9539f..da870d5ef9 100644 --- a/src/openrct2/ride/thrill/meta/Twist.h +++ b/src/openrct2/ride/thrill/meta/Twist.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor TwistRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 12, 64, 3, 2, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_twist), SET_FIELD(RatingsMultipliers, { 40, 20, 10 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 0, 0, 0 }), diff --git a/src/openrct2/ride/transport/meta/Chairlift.h b/src/openrct2/ride/transport/meta/Chairlift.h index 1bea4ef087..65cf6a3f32 100644 --- a/src/openrct2/ride/transport/meta/Chairlift.h +++ b/src/openrct2/ride/transport/meta/Chairlift.h @@ -38,7 +38,7 @@ constexpr const RideTypeDescriptor ChairliftRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 40, 32, 28, 2, }), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_chairlift), SET_FIELD(RatingsMultipliers, { 70, 10, 0 }), SET_FIELD(UpkeepCosts, { 60, 20, 0, 4, 3, 10 }), diff --git a/src/openrct2/ride/transport/meta/Lift.h b/src/openrct2/ride/transport/meta/Lift.h index e5f2c37a66..30c0ef82ed 100644 --- a/src/openrct2/ride/transport/meta/Lift.h +++ b/src/openrct2/ride/transport/meta/Lift.h @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor LiftRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_DOORS_STUCK_CLOSED) | (1 << BREAKDOWN_DOORS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 255, 32, 3, 2, }), SET_FIELD(MaxMass, 15), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_lift), SET_FIELD(RatingsMultipliers, { 80, 10, 0 }), SET_FIELD(UpkeepCosts, { 50, 20, 0, 10, 0, 0 }), diff --git a/src/openrct2/ride/transport/meta/MiniatureRailway.h b/src/openrct2/ride/transport/meta/MiniatureRailway.h index f4843fdb3a..835efec66f 100644 --- a/src/openrct2/ride/transport/meta/MiniatureRailway.h +++ b/src/openrct2/ride/transport/meta/MiniatureRailway.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor MiniatureRailwayRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 7, 32, 5, 9, }), SET_FIELD(MaxMass, 39), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_miniature_railway), SET_FIELD(RatingsMultipliers, { 70, 6, -10 }), SET_FIELD(UpkeepCosts, { 60, 20, 0, 10, 3, 5 }), diff --git a/src/openrct2/ride/transport/meta/Monorail.h b/src/openrct2/ride/transport/meta/Monorail.h index 34e1d8bf62..cb053d76d2 100644 --- a/src/openrct2/ride/transport/meta/Monorail.h +++ b/src/openrct2/ride/transport/meta/Monorail.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor MonorailRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_DOORS_STUCK_CLOSED) | (1 << BREAKDOWN_DOORS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 8, 32, 8, 9, }), SET_FIELD(MaxMass, 78), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_monorail), SET_FIELD(RatingsMultipliers, { 70, 6, -10 }), SET_FIELD(UpkeepCosts, { 65, 20, 0, 10, 3, 10 }), diff --git a/src/openrct2/ride/transport/meta/SuspendedMonorail.h b/src/openrct2/ride/transport/meta/SuspendedMonorail.h index 04f159bb48..2f92cbed79 100644 --- a/src/openrct2/ride/transport/meta/SuspendedMonorail.h +++ b/src/openrct2/ride/transport/meta/SuspendedMonorail.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor SuspendedMonorailRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_DOORS_STUCK_CLOSED) | (1 << BREAKDOWN_DOORS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 12, 40, 32, 8, }), SET_FIELD(MaxMass, 78), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_suspended_monorail), SET_FIELD(RatingsMultipliers, { 70, 6, -10 }), SET_FIELD(UpkeepCosts, { 70, 20, 0, 10, 3, 10 }), diff --git a/src/openrct2/ride/water/meta/BoatHire.h b/src/openrct2/ride/water/meta/BoatHire.h index b6fe6a9fad..a24bd51656 100644 --- a/src/openrct2/ride/water/meta/BoatHire.h +++ b/src/openrct2/ride/water/meta/BoatHire.h @@ -36,7 +36,7 @@ constexpr const RideTypeDescriptor BoatHireRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 255, 16, 0, 3, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_boat_hire), SET_FIELD(RatingsMultipliers, { 70, 6, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 4, 0, 0 }), diff --git a/src/openrct2/ride/water/meta/DinghySlide.h b/src/openrct2/ride/water/meta/DinghySlide.h index 8f64436ce1..51f9b60ae7 100644 --- a/src/openrct2/ride/water/meta/DinghySlide.h +++ b/src/openrct2/ride/water/meta/DinghySlide.h @@ -48,7 +48,7 @@ constexpr const RideTypeDescriptor DinghySlideRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 15, 24, 5, 7, }), SET_FIELD(MaxMass, 5), - SET_FIELD(LiftData, { SoundId::LiftFrictionWheels, 4, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftFrictionWheels, 4, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_dinghy_slide), SET_FIELD(RatingsMultipliers, { 50, 30, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 4, 3, 10 }), diff --git a/src/openrct2/ride/water/meta/LogFlume.h b/src/openrct2/ride/water/meta/LogFlume.h index 3d2a6f3e6e..fa1b471e8a 100644 --- a/src/openrct2/ride/water/meta/LogFlume.h +++ b/src/openrct2/ride/water/meta/LogFlume.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor LogFlumeRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_CONTROL_FAILURE)), SET_FIELD(Heights, { 9, 24, 7, 9, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_log_flume), SET_FIELD(RatingsMultipliers, { 80, 34, 6 }), SET_FIELD(UpkeepCosts, { 80, 20, 0, 9, 0, 10 }), diff --git a/src/openrct2/ride/water/meta/RiverRafts.h b/src/openrct2/ride/water/meta/RiverRafts.h index 5cb1f7a056..ce7d569098 100644 --- a/src/openrct2/ride/water/meta/RiverRafts.h +++ b/src/openrct2/ride/water/meta/RiverRafts.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor RiverRaftsRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT)), SET_FIELD(Heights, { 12, 24, 7, 11, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_river_rafts), SET_FIELD(RatingsMultipliers, { 80, 34, 6 }), SET_FIELD(UpkeepCosts, { 50, 20, 0, 9, 0, 10 }), diff --git a/src/openrct2/ride/water/meta/RiverRapids.h b/src/openrct2/ride/water/meta/RiverRapids.h index a9ffa2866e..bd0c41b27b 100644 --- a/src/openrct2/ride/water/meta/RiverRapids.h +++ b/src/openrct2/ride/water/meta/RiverRapids.h @@ -40,7 +40,7 @@ constexpr const RideTypeDescriptor RiverRapidsRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_CONTROL_FAILURE)), SET_FIELD(Heights, { 9, 32, 14, 15, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_river_rapids), SET_FIELD(RatingsMultipliers, { 72, 26, 6 }), SET_FIELD(UpkeepCosts, { 82, 20, 0, 10, 0, 10 }), diff --git a/src/openrct2/ride/water/meta/SplashBoats.h b/src/openrct2/ride/water/meta/SplashBoats.h index 6fb0da18b6..de2ec34006 100644 --- a/src/openrct2/ride/water/meta/SplashBoats.h +++ b/src/openrct2/ride/water/meta/SplashBoats.h @@ -39,7 +39,7 @@ constexpr const RideTypeDescriptor SplashBoatsRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_CONTROL_FAILURE)), SET_FIELD(Heights, { 16, 24, 7, 11, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_splash_boats), SET_FIELD(RatingsMultipliers, { 80, 34, 6 }), SET_FIELD(UpkeepCosts, { 70, 20, 0, 9, 0, 10 }), diff --git a/src/openrct2/ride/water/meta/SubmarineRide.h b/src/openrct2/ride/water/meta/SubmarineRide.h index 90e5e79a4c..ab00b38cd6 100644 --- a/src/openrct2/ride/water/meta/SubmarineRide.h +++ b/src/openrct2/ride/water/meta/SubmarineRide.h @@ -38,7 +38,7 @@ constexpr const RideTypeDescriptor SubmarineRideRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION)), SET_FIELD(Heights, { 255, 16, 0, 3, }), SET_FIELD(MaxMass, 255), - SET_FIELD(LiftData, { SoundId::Null, 5, 5 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_submarine_ride), SET_FIELD(RatingsMultipliers, { 70, 6, 0 }), SET_FIELD(UpkeepCosts, { 50, 1, 0, 4, 0, 0 }), diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index 0a03683455..20be3b9ecf 100644 --- a/src/openrct2/title/TitleScreen.cpp +++ b/src/openrct2/title/TitleScreen.cpp @@ -125,13 +125,13 @@ void TitleScreen::Load() gCurrentLoadedPath = ""; network_close(); - audio_stop_all_music_and_sounds(); + OpenRCT2::Audio::StopAll(); GetContext()->GetGameState()->InitAll(150); viewport_init_all(); context_open_window(WC_MAIN_WINDOW); CreateWindows(); TitleInitialise(); - audio_start_title_music(); + OpenRCT2::Audio::PlayTitleMusic(); if (gOpenRCT2ShowChangelog) { diff --git a/src/openrct2/world/Balloon.cpp b/src/openrct2/world/Balloon.cpp index 7ab7f75d94..edcceb1522 100644 --- a/src/openrct2/world/Balloon.cpp +++ b/src/openrct2/world/Balloon.cpp @@ -76,7 +76,7 @@ void Balloon::Pop() { popped = 1; frame = 0; - audio_play_sound_at_location(SoundId::BalloonPop, { x, y, z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::BalloonPop, { x, y, z }); } void create_balloon(const CoordsXYZ& balloonPos, int32_t colour, bool isPopped) diff --git a/src/openrct2/world/Climate.cpp b/src/openrct2/world/Climate.cpp index ccf75924e9..b9e2a0549e 100644 --- a/src/openrct2/world/Climate.cpp +++ b/src/openrct2/world/Climate.cpp @@ -59,7 +59,7 @@ static uint32_t _lightningTimer; static uint32_t _thunderTimer; static void* _thunderSoundChannels[MAX_THUNDER_INSTANCES]; static THUNDER_STATUS _thunderStatus[MAX_THUNDER_INSTANCES] = { THUNDER_STATUS::NONE, THUNDER_STATUS::NONE }; -static SoundId _thunderSoundId; +static OpenRCT2::Audio::SoundId _thunderSoundId; static int32_t _thunderVolume; static int32_t _thunderStereoEcho = 0; @@ -69,7 +69,7 @@ static void climate_update_weather_sound(); static void climate_update_thunder_sound(); static void climate_update_lightning(); static void climate_update_thunder(); -static void climate_play_thunder(int32_t instanceIndex, SoundId soundId, int32_t volume, int32_t pan); +static void climate_play_thunder(int32_t instanceIndex, OpenRCT2::Audio::SoundId soundId, int32_t volume, int32_t pan); int32_t climate_celsius_to_fahrenheit(int32_t celsius) { @@ -97,7 +97,7 @@ void climate_reset(ClimateType climate) _thunderTimer = 0; if (_weatherVolume != 1) { - audio_stop_weather_sound(); + OpenRCT2::Audio::StopWeatherSound(); _weatherVolume = 1; } @@ -205,7 +205,7 @@ void climate_force_weather(uint8_t weather) void climate_update_sound() { - if (!audio_is_available()) + if (!OpenRCT2::Audio::IsAvailable()) return; if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) @@ -304,9 +304,10 @@ static void climate_update_weather_sound() if (gClimateCurrent.WeatherEffect == WeatherEffectType::Rain || gClimateCurrent.WeatherEffect == WeatherEffectType::Storm) { // Start playing the weather sound - if (gWeatherSoundChannel == nullptr) + if (OpenRCT2::Audio::gWeatherSoundChannel == nullptr) { - gWeatherSoundChannel = Mixer_Play_Effect(SoundId::Rain, MIXER_LOOP_INFINITE, DStoMixerVolume(-4000), 0.5f, 1, 0); + OpenRCT2::Audio::gWeatherSoundChannel = Mixer_Play_Effect( + OpenRCT2::Audio::SoundId::Rain, MIXER_LOOP_INFINITE, DStoMixerVolume(-4000), 0.5f, 1, 0); } if (_weatherVolume == 1) { @@ -316,9 +317,9 @@ static void climate_update_weather_sound() { // Increase weather sound _weatherVolume = std::min(-1400, _weatherVolume + 80); - if (gWeatherSoundChannel != nullptr) + if (OpenRCT2::Audio::gWeatherSoundChannel != nullptr) { - Mixer_Channel_Volume(gWeatherSoundChannel, DStoMixerVolume(_weatherVolume)); + Mixer_Channel_Volume(OpenRCT2::Audio::gWeatherSoundChannel, DStoMixerVolume(_weatherVolume)); } } } @@ -328,14 +329,14 @@ static void climate_update_weather_sound() _weatherVolume -= 80; if (_weatherVolume > -4000) { - if (gWeatherSoundChannel != nullptr) + if (OpenRCT2::Audio::gWeatherSoundChannel != nullptr) { - Mixer_Channel_Volume(gWeatherSoundChannel, DStoMixerVolume(_weatherVolume)); + Mixer_Channel_Volume(OpenRCT2::Audio::gWeatherSoundChannel, DStoMixerVolume(_weatherVolume)); } } else { - audio_stop_weather_sound(); + OpenRCT2::Audio::StopWeatherSound(); _weatherVolume = 1; } } @@ -395,7 +396,8 @@ static void climate_update_thunder() if (_thunderStatus[0] == THUNDER_STATUS::NONE && _thunderStatus[1] == THUNDER_STATUS::NONE) { // Play thunder on left side - _thunderSoundId = (randomNumber & 0x20000) ? SoundId::Thunder1 : SoundId::Thunder2; + _thunderSoundId = (randomNumber & 0x20000) ? OpenRCT2::Audio::SoundId::Thunder1 + : OpenRCT2::Audio::SoundId::Thunder2; _thunderVolume = (-(static_cast((randomNumber >> 18) & 0xFF))) * 8; climate_play_thunder(0, _thunderSoundId, _thunderVolume, -10000); @@ -407,7 +409,8 @@ static void climate_update_thunder() { if (_thunderStatus[0] == THUNDER_STATUS::NONE) { - _thunderSoundId = (randomNumber & 0x20000) ? SoundId::Thunder1 : SoundId::Thunder2; + _thunderSoundId = (randomNumber & 0x20000) ? OpenRCT2::Audio::SoundId::Thunder1 + : OpenRCT2::Audio::SoundId::Thunder2; int32_t pan = (((randomNumber >> 18) & 0xFF) - 128) * 16; climate_play_thunder(0, _thunderSoundId, 0, pan); } @@ -415,7 +418,7 @@ static void climate_update_thunder() } } -static void climate_play_thunder(int32_t instanceIndex, SoundId soundId, int32_t volume, int32_t pan) +static void climate_play_thunder(int32_t instanceIndex, OpenRCT2::Audio::SoundId soundId, int32_t volume, int32_t pan) { _thunderSoundChannels[instanceIndex] = Mixer_Play_Effect( soundId, MIXER_LOOP_NONE, DStoMixerVolume(volume), DStoMixerPan(pan), 1, 0); diff --git a/src/openrct2/world/Duck.cpp b/src/openrct2/world/Duck.cpp index a0fa933228..6a67a9c6e2 100644 --- a/src/openrct2/world/Duck.cpp +++ b/src/openrct2/world/Duck.cpp @@ -361,7 +361,7 @@ void Duck::Update() void duck_press(Duck* duck) { - audio_play_sound_at_location(SoundId::Quack, { duck->x, duck->y, duck->z }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Quack, { duck->x, duck->y, duck->z }); } void duck_remove_all() diff --git a/src/openrct2/world/Particle.cpp b/src/openrct2/world/Particle.cpp index 2aa7ef82d7..129f030991 100644 --- a/src/openrct2/world/Particle.cpp +++ b/src/openrct2/world/Particle.cpp @@ -93,7 +93,7 @@ void VehicleCrashParticle::Update() if (waterZ != 0 && z >= waterZ && newLoc.z <= waterZ) { // Splash - audio_play_sound_at_location(SoundId::Water2, { x, y, waterZ }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Water2, { x, y, waterZ }); crash_splash_create({ x, y, waterZ }); sprite_remove(this); return;