mirror of https://github.com/OpenRCT2/OpenRCT2.git
Move the audio code into OpenRCT2 namespace
This commit is contained in:
parent
86b1c0dbe1
commit
091145037e
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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<int32_t>(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<uintptr_t>(audio_get_device_name(i).c_str());
|
||||
gDropdownItemsArgs[i] = reinterpret_cast<uintptr_t>(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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -30,430 +30,432 @@
|
|||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
using namespace OpenRCT2::Audio;
|
||||
|
||||
struct AudioParams
|
||||
namespace OpenRCT2::Audio
|
||||
{
|
||||
bool in_range;
|
||||
int32_t volume;
|
||||
int32_t pan;
|
||||
};
|
||||
|
||||
static std::vector<std::string> _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<std::string> _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<std::string> 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<std::string> 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<uint8_t>(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<int32_t>(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<uint8_t>(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<int32_t>(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<int32_t>(_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<int32_t>(_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<uint32_t>();
|
||||
if (head == 0x78787878)
|
||||
try
|
||||
{
|
||||
rideMusicInfo.length = 0;
|
||||
auto fs = OpenRCT2::FileStream(path, OpenRCT2::FILE_MODE_OPEN);
|
||||
uint32_t head = fs.ReadValue<uint32_t>();
|
||||
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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<uint32_t>(SoundId::Portcullis) + 1;
|
||||
constexpr uint8_t RCT2SoundCount = static_cast<uint32_t>(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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -439,7 +439,7 @@ void RideObject::ReadLegacyVehicle(
|
|||
vehicle->no_seating_rows = stream->ReadValue<uint8_t>();
|
||||
vehicle->spinning_inertia = stream->ReadValue<uint8_t>();
|
||||
vehicle->spinning_friction = stream->ReadValue<uint8_t>();
|
||||
vehicle->friction_sound_id = stream->ReadValue<SoundId>();
|
||||
vehicle->friction_sound_id = stream->ReadValue<OpenRCT2::Audio::SoundId>();
|
||||
vehicle->log_flume_reverser_vehicle_type = stream->ReadValue<uint8_t>();
|
||||
vehicle->sound_range = stream->ReadValue<uint8_t>();
|
||||
vehicle->double_sound_frequency = stream->ReadValue<uint8_t>();
|
||||
|
@ -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<uint8_t>(jCar["numSeatRows"]);
|
||||
car.spinning_inertia = Json::GetNumber<uint8_t>(jCar["spinningInertia"]);
|
||||
car.spinning_friction = Json::GetNumber<uint8_t>(jCar["spinningFriction"]);
|
||||
car.friction_sound_id = Json::GetEnum<SoundId>(jCar["frictionSoundId"], SoundId::Null);
|
||||
car.friction_sound_id = Json::GetEnum<OpenRCT2::Audio::SoundId>(jCar["frictionSoundId"], OpenRCT2::Audio::SoundId::Null);
|
||||
car.log_flume_reverser_vehicle_type = Json::GetNumber<uint8_t>(jCar["logFlumeReverserVehicleType"]);
|
||||
car.sound_range = Json::GetNumber<uint8_t>(jCar["soundRange"], 255);
|
||||
car.double_sound_frequency = Json::GetNumber<uint8_t>(jCar["doubleSoundFrequency"]);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -641,9 +641,11 @@ std::optional<CoordsXY> 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<SoundId>(src->sound1_id);
|
||||
dst->sound1_id = static_cast<OpenRCT2::Audio::SoundId>(src->sound1_id);
|
||||
dst->sound1_volume = src->sound1_volume;
|
||||
dst->sound2_id = static_cast<SoundId>(src->sound2_id);
|
||||
dst->sound2_id = static_cast<OpenRCT2::Audio::SoundId>(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<SoundId>(src->scream_sound_id);
|
||||
dst->scream_sound_id = static_cast<OpenRCT2::Audio::SoundId>(src->scream_sound_id);
|
||||
dst->TrackSubposition = VehicleTrackSubposition{ src->TrackSubposition };
|
||||
dst->var_CE = src->var_CE;
|
||||
dst->var_CF = src->var_CF;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -13,99 +13,103 @@
|
|||
#include "../audio/audio.h"
|
||||
#include "../common.h"
|
||||
|
||||
namespace OpenRCT2::Audio
|
||||
{
|
||||
#define MAKE_TUNEID_LIST(...) std::vector<uint8_t>({ __VA_ARGS__ })
|
||||
|
||||
// 0x009AEF28
|
||||
std::vector<uint8_t> 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<uint8_t> 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
|
||||
|
|
|
@ -14,54 +14,58 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
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<uint8_t> gRideMusicStyleTuneIds[];
|
||||
extern std::vector<uint8_t> gRideMusicStyleTuneIds[];
|
||||
|
||||
} // namespace OpenRCT2::Audio
|
||||
|
|
|
@ -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<uint8_t>(-vol1 - 1) * static_cast<uint8_t>(-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<uint32_t>(Mixer_Channel_GetOffset(gRideMusicList[channel].sound_channel));
|
||||
a1 = static_cast<uint32_t>(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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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<rct_vehicle_sound_params>& vehicleSoundParamsList) const
|
||||
void Vehicle::UpdateSoundParams(std::vector<OpenRCT2::Audio::VehicleSoundParams>& vehicleSoundParamsList) const
|
||||
{
|
||||
if (!SoundCanPlay())
|
||||
return;
|
||||
|
@ -1045,7 +1053,7 @@ void Vehicle::UpdateSoundParams(std::vector<rct_vehicle_sound_params>& 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<SoundType type> static uint16_t SoundFrequency(const SoundId id, uint16_t baseFrequency)
|
||||
template<SoundType type> static uint16_t SoundFrequency(const OpenRCT2::Audio::SoundId id, uint16_t baseFrequency)
|
||||
{
|
||||
if constexpr (type == SoundType::TrackNoises)
|
||||
{
|
||||
|
@ -1200,34 +1208,36 @@ template<SoundType type> static uint16_t SoundFrequency(const SoundId id, uint16
|
|||
}
|
||||
}
|
||||
|
||||
template<SoundType type> static bool ShouldUpdateChannelRate(const SoundId id)
|
||||
template<SoundType type> static bool ShouldUpdateChannelRate(const OpenRCT2::Audio::SoundId id)
|
||||
{
|
||||
return type == SoundType::TrackNoises || !(_soundParams[static_cast<uint8_t>(id)][1] & 1);
|
||||
}
|
||||
|
||||
template<SoundType type>
|
||||
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<rct_vehicle_sound_params> vehicleSoundParamsList;
|
||||
std::vector<OpenRCT2::Audio::VehicleSoundParams> 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<Vehicle>(sprite_index); vehicle2 != nullptr;
|
||||
vehicle2 = GetEntity<Vehicle>(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<Vehicle>(sprite_index); vehicle2 != nullptr;
|
||||
vehicle2 = GetEntity<Vehicle>(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<int32_t>(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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
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<rct_vehicle_sound_params>& vehicleSoundParamsList) const;
|
||||
void UpdateSoundParams(std::vector<OpenRCT2::Audio::VehicleSoundParams>& 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();
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
|
@ -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 }),
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue