From 3a8b25a0eeab28349623ceeb9207e2f4c3f5ff3e Mon Sep 17 00:00:00 2001 From: Dom Light Date: Mon, 16 Nov 2015 22:39:40 +0000 Subject: [PATCH] Sanitize audio.h --- src/audio/audio.c | 50 +++++------ src/audio/audio.h | 117 +++++++++++++------------- src/audio/mixer.cpp | 20 ++--- src/audio/mixer.h | 2 +- src/editor.c | 4 +- src/game.c | 20 ++--- src/input.c | 4 +- src/interface/window.c | 2 +- src/management/news_item.c | 2 +- src/openrct2.c | 16 ++-- src/peep/peep.c | 14 +-- src/rct2.c | 4 +- src/ride/ride.c | 78 ++++++++--------- src/ride/track.c | 4 +- src/ride/vehicle.c | 88 +++++++++---------- src/title.c | 6 +- src/windows/editor_bottom_toolbar.c | 4 +- src/windows/editor_object_selection.c | 2 +- src/windows/error.c | 2 +- src/windows/footpath.c | 4 +- src/windows/install_track.c | 2 +- src/windows/map.c | 2 +- src/windows/maze_construction.c | 4 +- src/windows/new_ride.c | 2 +- src/windows/news.c | 4 +- src/windows/options.c | 8 +- src/windows/ride.c | 8 +- src/windows/ride_construction.c | 10 +-- src/windows/save_prompt.c | 4 +- src/windows/scenery.c | 2 +- src/windows/title_scenarioselect.c | 2 +- src/windows/top_toolbar.c | 16 ++-- src/windows/track_list.c | 2 +- src/windows/track_place.c | 4 +- src/world/balloon.c | 2 +- src/world/duck.c | 2 +- src/world/map.c | 12 +-- src/world/particle.c | 2 +- 38 files changed, 264 insertions(+), 267 deletions(-) diff --git a/src/audio/audio.c b/src/audio/audio.c index 02f67c061e..d6721f347f 100644 --- a/src/audio/audio.c +++ b/src/audio/audio.c @@ -94,7 +94,7 @@ void audio_get_devices() * @param y (dx) * @param z (bp) */ -int sound_play_panned(int sound_id, int ebx, sint16 x, sint16 y, sint16 z) +int audio_sound_play_panned(int sound_id, int ebx, sint16 x, sint16 y, sint16 z) { if (!gGameSoundsOff) { int volumedown = 0; @@ -164,7 +164,7 @@ int sound_play_panned(int sound_id, int ebx, sint16 x, sint16 y, sint16 z) * * rct2: 0x006BD0F8 */ -void start_title_music() +void audio_start_title_music() { int musicPathId; switch (gConfigSound.title_music) { @@ -189,7 +189,7 @@ void start_title_music() gTitleMusicChannel = Mixer_Play_Music(musicPathId, MIXER_LOOP_INFINITE, true); } } else { - stop_title_music(); + audio_stop_title_music(); } } @@ -197,15 +197,15 @@ void start_title_music() * * rct2: 0x006BCA9F */ -void stop_ride_music() +void audio_stop_ride_music() { for (int i = 0; i < AUDIO_MAX_RIDE_MUSIC; i++) { rct_ride_music* ride_music = &gRideMusicList[i]; - if (ride_music->rideid != (uint8)-1) { + if (ride_music->ride_id != (uint8)-1) { if (ride_music->sound_channel) { Mixer_Stop_Channel(ride_music->sound_channel); } - ride_music->rideid = -1; + ride_music->ride_id = -1; } } } @@ -214,7 +214,7 @@ void stop_ride_music() * * rct2: 0x006BD07F */ -void stop_crowd_sound() +void audio_stop_crowd_sound() { if (gCrowdSoundChannel) { Mixer_Stop_Channel(gCrowdSoundChannel); @@ -226,7 +226,7 @@ void stop_crowd_sound() * * rct2: 0x006BD0BD */ -void stop_title_music() +void audio_stop_title_music() { if (gTitleMusicChannel) { Mixer_Stop_Channel(gTitleMusicChannel); @@ -251,9 +251,9 @@ void audio_init1() int devicenum = 0; audio_init2(devicenum); - for(int m = 0; m < countof(ride_music_info_list); m++) { - rct_ride_music_info* ride_music_info = ride_music_info_list[m]; - const utf8* path = get_file_path(ride_music_info->pathid); + for(int m = 0; m < countof(gRideMusicInfoList); m++) { + rct_ride_music_info* ride_music_info = gRideMusicInfoList[m]; + const utf8* path = get_file_path(ride_music_info->path_id); SDL_RWops *file = SDL_RWFromFile(path, "rb"); if (file != NULL) { uint32 head; @@ -282,7 +282,7 @@ void audio_init2(int device) config_save_default(); for (int i = 0; i < AUDIO_MAX_RIDE_MUSIC; i++) { rct_ride_music* ride_music = &gRideMusicList[i]; - ride_music->rideid = -1; + ride_music->ride_id = -1; } } @@ -292,21 +292,21 @@ void audio_init2(int device) */ void audio_close() { - stop_crowd_sound(); - stop_title_music(); - stop_ride_music(); + audio_stop_crowd_sound(); + audio_stop_title_music(); + audio_stop_ride_music(); stop_rain_sound(); RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SOUND_DEVICE, uint32) = -1; } /* rct2: 0x006BAB8A */ -void toggle_all_sounds(){ +void audio_toggle_all_sounds(){ gConfigSound.sound = !gConfigSound.sound; if (!gConfigSound.sound) { - stop_title_music(); - pause_sounds(); + audio_stop_title_music(); + audio_pause_sounds(); } else { - unpause_sounds(); + audio_unpause_sounds(); } } @@ -314,12 +314,12 @@ void toggle_all_sounds(){ * * rct2: 0x006BABB4 */ -void pause_sounds() +void audio_pause_sounds() { gGameSoundsOff = true; - stop_vehicle_sounds(); - stop_ride_music(); - stop_crowd_sound(); + audio_stop_vehicle_sounds(); + audio_stop_ride_music(); + audio_stop_crowd_sound(); stop_rain_sound(); } @@ -327,7 +327,7 @@ void pause_sounds() * * rct2: 0x006BABD8 */ -void unpause_sounds() +void audio_unpause_sounds() { gGameSoundsOff = false; } @@ -336,7 +336,7 @@ void unpause_sounds() * * rct2: 0x006BABDF */ -void stop_vehicle_sounds() +void audio_stop_vehicle_sounds() { if (!gOpenRCT2Headless && RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SOUND_DEVICE, sint32) != -1) { for (int i = 0; i < countof(gVehicleSoundList); i++) { diff --git a/src/audio/audio.h b/src/audio/audio.h index 7c3030903a..6ec60fc572 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -25,20 +25,38 @@ #include "../world/sprite.h" #define AUDIO_DEVICE_NAME_SIZE 256 +#define AUDIO_MAX_RIDE_MUSIC 2 +#define AUDIO_MAX_VEHICLE_SOUNDS 14 +#define NUM_DEFAULT_MUSIC_TRACKS 46 typedef struct { char name[AUDIO_DEVICE_NAME_SIZE]; } audio_device; -extern int gAudioDeviceCount; -extern audio_device *gAudioDevices; +typedef struct { + uint8 ride_id; + uint8 tune_id; + sint16 volume; + sint16 pan; + uint16 frequency; + void* sound_channel; +} rct_ride_music; -#define AUDIO_MAX_VEHICLE_SOUNDS 14 -#define AUDIO_MAX_RIDE_MUSIC 2 +typedef struct { + uint32 length; + uint32 offset; + uint8 path_id; + uint8 var_9; +} rct_ride_music_info; -void audio_init(); -void audio_quit(); -void audio_get_devices(); +typedef struct { + uint8 ride_id; + uint8 tune_id; + sint32 offset; + sint16 volume; + sint16 pan; + uint16 frequency; +} rct_ride_music_params; typedef struct { uint16 id; @@ -57,64 +75,13 @@ typedef struct { typedef struct { uint16 id; - sint16 panx; - sint16 pany; + sint16 pan_x; + sint16 pan_y; uint16 frequency; sint16 volume; uint16 var_A; } rct_vehicle_sound_params; -typedef struct { - uint8 rideid; - uint8 tuneid; - sint32 offset; - sint16 volume; - sint16 pan; - uint16 freq; -} rct_ride_music_params; - -typedef struct { - uint8 rideid; - uint8 tuneid; - sint16 volume; - sint16 pan; - uint16 freq; - void* sound_channel; -} rct_ride_music; - -typedef struct { - uint32 length; - uint32 offset; - uint8 pathid; - uint8 var_9; -} rct_ride_music_info; - -#define NUM_DEFAULT_MUSIC_TRACKS 46 -extern rct_ride_music_info* ride_music_info_list[NUM_DEFAULT_MUSIC_TRACKS]; -extern rct_vehicle_sound gVehicleSoundList[AUDIO_MAX_VEHICLE_SOUNDS]; -extern rct_vehicle_sound_params gVehicleSoundParamsList[AUDIO_MAX_VEHICLE_SOUNDS]; -extern rct_vehicle_sound_params *gVehicleSoundParamsListEnd; -extern rct_ride_music gRideMusicList[AUDIO_MAX_RIDE_MUSIC]; -extern rct_ride_music_params gRideMusicParamsList[AUDIO_MAX_RIDE_MUSIC]; -extern rct_ride_music_params *gRideMusicParamsListEnd; -extern void *gCrowdSoundChannel; -extern void *gTitleMusicChannel; -extern void *gRainSoundChannel; -extern bool gGameSoundsOff; - -int sound_play_panned(int sound_id, int ebx, sint16 x, sint16 y, sint16 z); -void start_title_music(); -void stop_ride_music(); -void stop_crowd_sound(); -void stop_title_music(); -void audio_init1(); -void audio_init2(int device); -void audio_close(); -void pause_sounds(); -void toggle_all_sounds(); -void unpause_sounds(); -void stop_vehicle_sounds(); - typedef enum { SOUND_LIFT_1 = 0, SOUND_TRACK_FRICTION_1 = 1, @@ -182,4 +149,34 @@ typedef enum { SOUND_MAXID } RCT2_SOUND; +extern audio_device *gAudioDevices; +extern int gAudioDeviceCount; +extern void *gCrowdSoundChannel; +extern bool gGameSoundsOff; +extern void *gRainSoundChannel; +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 void *gTitleMusicChannel; +extern rct_vehicle_sound gVehicleSoundList[AUDIO_MAX_VEHICLE_SOUNDS]; +extern rct_vehicle_sound_params gVehicleSoundParamsList[AUDIO_MAX_VEHICLE_SOUNDS]; +extern rct_vehicle_sound_params *gVehicleSoundParamsListEnd; + +void audio_close(); +void audio_get_devices(); +void audio_init(); +void audio_init1(); +void audio_init2(int device); +void audio_pause_sounds(); +void audio_quit(); +int audio_sound_play_panned(int soundId, int ebx, sint16 x, sint16 y, sint16 z); +void audio_start_title_music(); +void audio_stop_crowd_sound(); +void audio_stop_ride_music(); +void audio_stop_title_music(); +void audio_stop_vehicle_sounds(); +void audio_toggle_all_sounds(); +void audio_unpause_sounds(); + #endif diff --git a/src/audio/mixer.cpp b/src/audio/mixer.cpp index d8c4bcfb19..1edda91bc7 100644 --- a/src/audio/mixer.cpp +++ b/src/audio/mixer.cpp @@ -530,20 +530,20 @@ void Mixer::Stop(Channel& channel) Unlock(); } -bool Mixer::LoadMusic(int pathid) +bool Mixer::LoadMusic(int pathId) { - if (pathid >= countof(musicsources)) { + if (pathId >= countof(musicsources)) { return false; } - if (!musicsources[pathid]) { - const char* filename = get_file_path(pathid); + if (!musicsources[pathId]) { + const char* filename = get_file_path(pathId); Source_Sample* source_sample = new Source_Sample; if (source_sample->LoadWAV(filename)) { - musicsources[pathid] = source_sample; + musicsources[pathId] = source_sample; return true; } else { delete source_sample; - musicsources[pathid] = &source_null; + musicsources[pathId] = &source_null; return false; } } else { @@ -880,7 +880,7 @@ void Mixer_Channel_SetGroup(void* channel, int group) ((Channel*)channel)->SetGroup(group); } -void* Mixer_Play_Music(int pathid, int loop, int streaming) +void* Mixer_Play_Music(int pathId, int loop, int streaming) { if (gOpenRCT2Headless) return 0; @@ -888,7 +888,7 @@ void* Mixer_Play_Music(int pathid, int loop, int streaming) return 0; } if (streaming) { - const utf8 *filename = get_file_path(pathid); + const utf8 *filename = get_file_path(pathId); SDL_RWops* rw = SDL_RWFromFile(filename, "rb"); if (rw == NULL) { @@ -908,8 +908,8 @@ void* Mixer_Play_Music(int pathid, int loop, int streaming) return 0; } } else { - if (gMixer.LoadMusic(pathid)) { - Channel* channel = gMixer.Play(*gMixer.musicsources[pathid], MIXER_LOOP_INFINITE, false, false); + if (gMixer.LoadMusic(pathId)) { + Channel* channel = gMixer.Play(*gMixer.musicsources[pathId], MIXER_LOOP_INFINITE, false, false); if (channel) { channel->SetGroup(MIXER_GROUP_MUSIC); } diff --git a/src/audio/mixer.h b/src/audio/mixer.h index 3fe66b4816..4b2aeccbac 100644 --- a/src/audio/mixer.h +++ b/src/audio/mixer.h @@ -210,7 +210,7 @@ int Mixer_Channel_IsPlaying(void* channel); unsigned long Mixer_Channel_GetOffset(void* channel); int Mixer_Channel_SetOffset(void* channel, unsigned long offset); void Mixer_Channel_SetGroup(void* channel, int group); -void* Mixer_Play_Music(int pathid, int loop, int streaming); +void* Mixer_Play_Music(int pathId, int loop, int streaming); void Mixer_SetVolume(float volume); static int DStoMixerVolume(int volume) { return (int)(SDL_MIX_MAXVOLUME * (SDL_pow(10, (float)volume / 2000))); }; diff --git a/src/editor.c b/src/editor.c index 7b4b98e3cd..7b566001ca 100644 --- a/src/editor.c +++ b/src/editor.c @@ -60,8 +60,8 @@ void editor_load() { rct_window *mainWindow; - pause_sounds(); - unpause_sounds(); + audio_pause_sounds(); + audio_unpause_sounds(); object_unload_all(); map_init(150); banner_init(); diff --git a/src/game.c b/src/game.c index 10c4c61466..26b21f0956 100644 --- a/src/game.c +++ b/src/game.c @@ -275,7 +275,7 @@ void game_update() // Update the game one or more times for (i = 0; i < numUpdates; i++) { game_logic_update(); - start_title_music(); + audio_start_title_music(); if (gGameSpeed > 1) continue; @@ -549,10 +549,10 @@ void pause_toggle() RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32) ^= 1; window_invalidate_by_class(WC_TOP_TOOLBAR); if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32) & 1) { - pause_sounds(); - unpause_sounds(); + audio_pause_sounds(); + audio_unpause_sounds(); } else { - unpause_sounds(); + audio_unpause_sounds(); } } @@ -601,9 +601,9 @@ static int open_landscape_file_dialog() format_string((char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, STR_LOAD_LANDSCAPE_DIALOG_TITLE, 0); safe_strncpy((char*)0x0141EF68, (char*)RCT2_ADDRESS_LANDSCAPES_PATH, MAX_PATH); format_string((char*)0x0141EE68, STR_RCT2_LANDSCAPE_FILE, 0); - pause_sounds(); + audio_pause_sounds(); result = platform_open_common_file_dialog(1, (char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, (char*)0x0141EF68, "*.SV6;*.SV4;*.SC6", (char*)0x0141EE68); - unpause_sounds(); + audio_unpause_sounds(); // window_proc return result; } @@ -618,9 +618,9 @@ static int open_load_game_dialog() format_string((char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, STR_LOAD_GAME_DIALOG_TITLE, 0); safe_strncpy((char*)0x0141EF68, (char*)RCT2_ADDRESS_SAVED_GAMES_PATH, MAX_PATH); format_string((char*)0x0141EE68, STR_RCT2_SAVED_GAME, 0); - pause_sounds(); + audio_pause_sounds(); result = platform_open_common_file_dialog(1, (char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, (char*)0x0141EF68, "*.SV6", (char*)0x0141EE68); - unpause_sounds(); + audio_unpause_sounds(); // window_proc return result; } @@ -1020,9 +1020,9 @@ static int show_save_game_dialog(char *resultPath) safe_strncpy(filename, RCT2_ADDRESS(RCT2_ADDRESS_SAVED_GAMES_PATH_2, char), MAX_PATH); format_string(filterName, STR_RCT2_SAVED_GAME, NULL); - pause_sounds(); + audio_pause_sounds(); result = platform_open_common_file_dialog(0, title, filename, "*.SV6", filterName); - unpause_sounds(); + audio_unpause_sounds(); if (result) safe_strncpy(resultPath, filename, MAX_PATH); diff --git a/src/input.c b/src/input.c index 6a8706a3e2..c68a1562e4 100644 --- a/src/input.c +++ b/src/input.c @@ -1021,7 +1021,7 @@ static void input_widget_left(int x, int y, rct_window *w, int widgetIndex) break; default: if (widget_is_enabled(w, widgetIndex) && !widget_is_disabled(w, widgetIndex)) { - sound_play_panned(SOUND_CLICK_1, w->x + (widget->left + widget->right) / 2, 0, 0, 0); + audio_sound_play_panned(SOUND_CLICK_1, w->x + (widget->left + widget->right) / 2, 0, 0, 0); // Set new cursor down widget RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS, rct_windowclass) = windowClass; @@ -1267,7 +1267,7 @@ void input_state_widget_pressed(int x, int y, int state, int widgetIndex, rct_wi break; int mid_point_x = (widget->left + widget->right) / 2 + w->x; - sound_play_panned(5, mid_point_x, 0, 0, 0); + audio_sound_play_panned(5, mid_point_x, 0, 0, 0); if (cursor_w_class != w->classification || cursor_w_number != w->number || widgetIndex != cursor_widgetIndex) break; diff --git a/src/interface/window.c b/src/interface/window.c index 8a4ad7831a..8bf9e8efe1 100644 --- a/src/interface/window.c +++ b/src/interface/window.c @@ -397,7 +397,7 @@ rct_window *window_create(int x, int y, int width, int height, rct_window_event_ // Play sounds and flash the window if (!(flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))){ w->flags |= WF_WHITE_BORDER_MASK; - sound_play_panned(SOUND_WINDOW_OPEN, x + (width / 2), 0, 0, 0); + audio_sound_play_panned(SOUND_WINDOW_OPEN, x + (width / 2), 0, 0, 0); } w->number = 0; diff --git a/src/management/news_item.c b/src/management/news_item.c index c3e059c761..f83f5d2ca1 100644 --- a/src/management/news_item.c +++ b/src/management/news_item.c @@ -85,7 +85,7 @@ static void news_item_tick_current() // Only play news item sound when in normal playing mode if (ticks == 1 && (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) == SCREEN_FLAGS_PLAYING)) { // Play sound - sound_play_panned(SOUND_NEWS_ITEM, RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16) / 2, 0, 0, 0); + audio_sound_play_panned(SOUND_NEWS_ITEM, RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16) / 2, 0, 0, 0); } } diff --git a/src/openrct2.c b/src/openrct2.c index b3833ac573..8c920fcb0a 100644 --- a/src/openrct2.c +++ b/src/openrct2.c @@ -635,14 +635,14 @@ static bool openrct2_release_rct2_segment() */ static void openrct2_setup_rct2_hooks() { - addhook(0x006E732D, (int)gfx_set_dirty_blocks, 0, (int[]){ EAX, EBX, EDX, EBP, END }, 0, 0); // remove when all callers are decompiled - addhook(0x006E7499, (int)gfx_redraw_screen_rect, 0, (int[]){ EAX, EBX, EDX, EBP, END }, 0, 0); // remove when 0x6E7FF3 is decompiled - addhook(0x006B752C, (int)ride_crash, 0, (int[]){ EDX, EBX, END }, 0, 0); // remove when all callers are decompiled - addhook(0x0069A42F, (int)peep_window_state_update, 0, (int[]){ ESI, END }, 0, 0); // remove when all callers are decompiled - addhook(0x006BB76E, (int)sound_play_panned, 0, (int[]){EAX, EBX, ECX, EDX, EBP, END}, EAX, 0); // remove when all callers are decompiled - addhook(0x006C42D9, (int)scrolling_text_setup, 0, (int[]){EAX, ECX, EBP, END}, 0, EBX); // remove when all callers are decompiled - addhook(0x006C2321, (int)gfx_get_string_width, 0, (int[]){ESI, END}, 0, ECX); // remove when all callers are decompiled - addhook(0x006C2555, (int)format_string, 0, (int[]){EDI, EAX, ECX, END}, 0, 0); // remove when all callers are decompiled + addhook(0x006E732D, (int)gfx_set_dirty_blocks, 0, (int[]){ EAX, EBX, EDX, EBP, END }, 0, 0); // remove when all callers are decompiled + addhook(0x006E7499, (int)gfx_redraw_screen_rect, 0, (int[]){ EAX, EBX, EDX, EBP, END }, 0, 0); // remove when 0x6E7FF3 is decompiled + addhook(0x006B752C, (int)ride_crash, 0, (int[]){ EDX, EBX, END }, 0, 0); // remove when all callers are decompiled + addhook(0x0069A42F, (int)peep_window_state_update, 0, (int[]){ ESI, END }, 0, 0); // remove when all callers are decompiled + addhook(0x006BB76E, (int)audio_sound_play_panned, 0, (int[]){EAX, EBX, ECX, EDX, EBP, END}, EAX, 0); // remove when all callers are decompiled + addhook(0x006C42D9, (int)scrolling_text_setup, 0, (int[]){EAX, ECX, EBP, END}, 0, EBX); // remove when all callers are decompiled + addhook(0x006C2321, (int)gfx_get_string_width, 0, (int[]){ESI, END}, 0, ECX); // remove when all callers are decompiled + addhook(0x006C2555, (int)format_string, 0, (int[]){EDI, EAX, ECX, END}, 0, 0); // remove when all callers are decompiled } #if _MSC_VER >= 1900 diff --git a/src/peep/peep.c b/src/peep/peep.c index e714c8de93..2cc1bf15dc 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -392,7 +392,7 @@ static void sub_68F41A(rct_peep *peep, int index) } if (peep->flags & PEEP_FLAGS_EXPLODE && peep->x != (sint16)0x8000){ - sound_play_panned(SOUND_CRASH, 0x8001, peep->x, peep->y, peep->z); + audio_sound_play_panned(SOUND_CRASH, 0x8001, peep->x, peep->y, peep->z); sprite_misc_3_create(peep->x, peep->y, peep->z + 16); sprite_misc_5_create(peep->x, peep->y, peep->z + 16); @@ -1029,7 +1029,7 @@ int peep_update_action(sint16* x, sint16* y, sint16* xy_distance, rct_peep* peep litter_create(peep->x, peep->y, peep->z, peep->sprite_direction, peep->sprite_index & 1); int sound_id = SOUND_COUGH_1 + (scenario_rand() & 3); - sound_play_panned(sound_id, 0x8001, peep->x, peep->y, peep->z); + audio_sound_play_panned(sound_id, 0x8001, peep->x, peep->y, peep->z); invalidate_sprite_2((rct_sprite*)peep); *x = peep->x; @@ -1141,7 +1141,7 @@ void peep_update_sprite_type(rct_peep* peep) ) { bl = 1; - sound_play_panned(SOUND_BALLOON_POP, 0x8001, peep->x, peep->y, peep->z); + audio_sound_play_panned(SOUND_BALLOON_POP, 0x8001, peep->x, peep->y, peep->z); } if (peep->x != SPRITE_LOCATION_NULL) { @@ -3161,7 +3161,7 @@ static void peep_update_ride_sub_state_20(rct_peep* peep){ return; } - sound_play_panned(SOUND_TOILET_FLUSH, 0x8001, peep->x, peep->y, peep->z); + audio_sound_play_panned(SOUND_TOILET_FLUSH, 0x8001, peep->x, peep->y, peep->z); peep->sub_state++; @@ -5265,7 +5265,7 @@ void peep_applause() } // Play applause noise - sound_play_panned(SOUND_APPLAUSE, RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16) / 2, 0, 0, 0); + audio_sound_play_panned(SOUND_APPLAUSE, RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16) / 2, 0, 0, 0); } /** @@ -7523,7 +7523,7 @@ static void peep_spend_money(rct_peep *peep, money16 *peep_expend_type, money32 RCT2_GLOBAL(0x00141F568, uint8) = RCT2_GLOBAL(0x0013CA740, uint8); finance_payment(-amount, RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) / 4); - sound_play_panned(SOUND_PURCHASE, 0x8001, peep->x, peep->y, peep->z); + audio_sound_play_panned(SOUND_PURCHASE, 0x8001, peep->x, peep->y, peep->z); } static void peep_set_has_ridden(rct_peep *peep, int rideIndex) @@ -7851,7 +7851,7 @@ static void peep_on_exit_ride(rct_peep *peep, int rideIndex) int laugh = scenario_rand() & 7; if (laugh < 3) { - sound_play_panned(SOUND_LAUGH_1 + laugh, 0x8001, peep->x, peep->y, peep->z); + audio_sound_play_panned(SOUND_LAUGH_1 + laugh, 0x8001, peep->x, peep->y, peep->z); } } diff --git a/src/rct2.c b/src/rct2.c index 560db3ab9a..80ce5c8ba1 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -326,12 +326,12 @@ int check_file_path(int pathId) case PATH_ID_CUSTOM1: if (file != NULL) - ride_music_info_list[36]->length = (uint32)SDL_RWsize(file); // Store file size in music_custom1_size @ 0x009AF164 + gRideMusicInfoList[36]->length = (uint32)SDL_RWsize(file); // Store file size in music_custom1_size @ 0x009AF164 break; case PATH_ID_CUSTOM2: if (file != NULL) - ride_music_info_list[37]->length = (uint32)SDL_RWsize(file); // Store file size in music_custom2_size @ 0x009AF16E + gRideMusicInfoList[37]->length = (uint32)SDL_RWsize(file); // Store file size in music_custom2_size @ 0x009AF16E break; } diff --git a/src/ride/ride.c b/src/ride/ride.c index 573251d0d1..a0afb3d27f 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -3278,7 +3278,7 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint if (screenwidth < 64) { screenwidth = 64; } - int panx = ((x2 / screenwidth) - 0x8000) >> 4; + int pan_x = ((x2 / screenwidth) - 0x8000) >> 4; int y2 = RCT2_GLOBAL(0x00F438A4, rct_viewport*)->y + ((RCT2_GLOBAL(0x009AF5A2, sint16) - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_y) >> RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom); y2 <<= 16; @@ -3286,12 +3286,12 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint if (screenheight < 64) { screenheight = 64; } - int pany = ((y2 / screenheight) - 0x8000) >> 4; + int pan_y = ((y2 / screenheight) - 0x8000) >> 4; uint8 vol1 = -1; uint8 vol2 = -1; - int panx2 = panx; - int pany2 = pany; + int panx2 = pan_x; + int pany2 = pan_y; if (pany2 < 0) { pany2 = -pany2; } @@ -3331,20 +3331,20 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint } int v32 = -(((uint8)(-vol1 - 1) * (uint8)(-vol1 - 1)) / 16) - 700; if (vol1 && v32 >= -4000) { - if (panx > 10000) { - panx = 10000; + if (pan_x > 10000) { + pan_x = 10000; } - if (panx < -10000) { - panx = -10000; + if (pan_x < -10000) { + pan_x = -10000; } rct_ride_music* ride_music = &gRideMusicList[0]; int channel = 0; uint32 a1; - while (ride_music->rideid != rideIndex || ride_music->tuneid != *tuneId) { + while (ride_music->ride_id != rideIndex || ride_music->tune_id != *tuneId) { ride_music++; channel++; if (channel >= AUDIO_MAX_RIDE_MUSIC) { - rct_ride_music_info* ride_music_info = ride_music_info_list[*tuneId]; + rct_ride_music_info* ride_music_info = gRideMusicInfoList[*tuneId]; a1 = position + ride_music_info->offset; goto label51; } @@ -3356,16 +3356,16 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint } a1 = Mixer_Channel_GetOffset(gRideMusicList[channel].sound_channel); label51: - if (a1 < ride_music_info_list[*tuneId]->length) { + if (a1 < gRideMusicInfoList[*tuneId]->length) { position = a1; rct_ride_music_params* ride_music_params = gRideMusicParamsListEnd; if (ride_music_params < &gRideMusicParamsList[AUDIO_MAX_RIDE_MUSIC]) { - ride_music_params->rideid = rideIndex; - ride_music_params->tuneid = *tuneId; + ride_music_params->ride_id = rideIndex; + ride_music_params->tune_id = *tuneId; ride_music_params->offset = a1; ride_music_params->volume = v32; - ride_music_params->pan = panx; - ride_music_params->freq = RCT2_GLOBAL(0x009AF47C, uint16); + ride_music_params->pan = pan_x; + ride_music_params->frequency = RCT2_GLOBAL(0x009AF47C, uint16); gRideMusicParamsListEnd++; } } else { @@ -3375,7 +3375,7 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint } else { label58: ; - rct_ride_music_info* ride_music_info = ride_music_info_list[*tuneId]; + rct_ride_music_info* ride_music_info = gRideMusicInfoList[*tuneId]; position += ride_music_info->offset; if (position < ride_music_info->length) { return position; @@ -3388,10 +3388,10 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint return position; } -#define INIT_MUSIC_INFO(pathid, offset, length, unknown) (rct_ride_music_info[]){length, offset, pathid, unknown} +#define INIT_MUSIC_INFO(path_id, offset, length, unknown) (rct_ride_music_info[]){length, offset, path_id, unknown} //0x009AF1C8 -rct_ride_music_info* ride_music_info_list[NUM_DEFAULT_MUSIC_TRACKS] = { +rct_ride_music_info* gRideMusicInfoList[NUM_DEFAULT_MUSIC_TRACKS] = { INIT_MUSIC_INFO(PATH_ID_CSS4, 1378, 8139054, 0), INIT_MUSIC_INFO(PATH_ID_CSS5, 1378, 7796656, 0), INIT_MUSIC_INFO(PATH_ID_CSS6, 1378, 15787850, 0), @@ -3456,9 +3456,9 @@ void ride_music_update_final() int v9 = 1; rct_ride_music_params* ride_music_params = &gRideMusicParamsList[0]; while (ride_music_params < gRideMusicParamsListEnd) { - if (ride_music_params->rideid != (uint8)-1) { - rct_ride_music_info* ride_music_info = ride_music_info_list[ride_music_params->tuneid]; - if (RCT2_ADDRESS(0x009AA0B1, uint8*)[ride_music_info->pathid]) { // file_on_cdrom[] + if (ride_music_params->ride_id != (uint8)-1) { + rct_ride_music_info* ride_music_info = gRideMusicInfoList[ride_music_params->tune_id]; + if (RCT2_ADDRESS(0x009AA0B1, uint8*)[ride_music_info->path_id]) { // file_on_cdrom[] v8++; if (v9 >= ride_music_params->volume) { v9 = ride_music_params->volume; @@ -3471,14 +3471,14 @@ void ride_music_update_final() if (v8 <= 1) { break; } - edi->rideid = -1; + edi->ride_id = -1; } while (1) { int v8 = 0; int v9 = 1; rct_ride_music_params* ride_music_params = &gRideMusicParamsList[0]; while (ride_music_params < gRideMusicParamsListEnd) { - if (ride_music_params->rideid != (uint8)-1) { + if (ride_music_params->ride_id != (uint8)-1) { v8++; if (v9 >= ride_music_params->volume) { v9 = ride_music_params->volume; @@ -3490,17 +3490,17 @@ void ride_music_update_final() if (v8 <= 2) { break; } - edi->rideid = -1; + edi->ride_id = -1; } // stop currently playing music that is not in music params list or not playing? rct_ride_music* ride_music = &gRideMusicList[0]; int channel = 0; do { - if (ride_music->rideid != (uint8)-1) { + if (ride_music->ride_id != (uint8)-1) { rct_ride_music_params* ride_music_params = &gRideMusicParamsList[0]; while (ride_music_params < gRideMusicParamsListEnd) { - if (ride_music_params->rideid == ride_music->rideid && ride_music_params->tuneid == ride_music->tuneid) { + if (ride_music_params->ride_id == ride_music->ride_id && ride_music_params->tune_id == ride_music->tune_id) { int isplaying = Mixer_Channel_IsPlaying(gRideMusicList[channel].sound_channel); if (isplaying) { goto label32; @@ -3510,7 +3510,7 @@ void ride_music_update_final() ride_music_params++; } Mixer_Stop_Channel(gRideMusicList[channel].sound_channel); - ride_music->rideid = -1; + ride_music->ride_id = -1; } label32: ride_music++; @@ -3518,28 +3518,28 @@ void ride_music_update_final() } while(channel < AUDIO_MAX_RIDE_MUSIC); for (rct_ride_music_params* ride_music_params = &gRideMusicParamsList[0]; ride_music_params < gRideMusicParamsListEnd; ride_music_params++) { - if (ride_music_params->rideid != (uint8)-1) { + if (ride_music_params->ride_id != (uint8)-1) { rct_ride_music* ride_music = &gRideMusicList[0]; int channel = 0; - while (ride_music_params->rideid != ride_music->rideid || ride_music_params->tuneid != ride_music->tuneid) { - if (ride_music->rideid == (uint8)-1) { + while (ride_music_params->ride_id != ride_music->ride_id || ride_music_params->tune_id != ride_music->tune_id) { + if (ride_music->ride_id == (uint8)-1) { ebx = channel; } ride_music++; channel++; if (channel >= AUDIO_MAX_RIDE_MUSIC) { - rct_ride_music_info* ride_music_info = ride_music_info_list[ride_music_params->tuneid]; + rct_ride_music_info* ride_music_info = gRideMusicInfoList[ride_music_params->tune_id]; rct_ride_music* ride_music = &gRideMusicList[ebx]; - ride_music->sound_channel = Mixer_Play_Music(ride_music_info->pathid, MIXER_LOOP_NONE, true); + ride_music->sound_channel = Mixer_Play_Music(ride_music_info->path_id, MIXER_LOOP_NONE, true); if (ride_music->sound_channel) { ride_music->volume = ride_music_params->volume; ride_music->pan = ride_music_params->pan; - ride_music->freq = ride_music_params->freq; - ride_music->rideid = ride_music_params->rideid; - ride_music->tuneid = ride_music_params->tuneid; + ride_music->frequency = ride_music_params->frequency; + ride_music->ride_id = ride_music_params->ride_id; + ride_music->tune_id = ride_music_params->tune_id; Mixer_Channel_Volume(ride_music->sound_channel, DStoMixerVolume(ride_music->volume)); Mixer_Channel_Pan(ride_music->sound_channel, DStoMixerPan(ride_music->pan)); - Mixer_Channel_Rate(ride_music->sound_channel, DStoMixerRate(ride_music->freq)); + Mixer_Channel_Rate(ride_music->sound_channel, DStoMixerRate(ride_music->frequency)); int offset = ride_music_params->offset - 10000; if (offset < 0) { offset = 0; @@ -3558,9 +3558,9 @@ void ride_music_update_final() ride_music->pan = ride_music_params->pan; Mixer_Channel_Pan(ride_music->sound_channel, DStoMixerPan(ride_music->pan)); } - if (ride_music_params->freq != ride_music->freq) { - ride_music->freq = ride_music_params->freq; - Mixer_Channel_Rate(ride_music->sound_channel, DStoMixerRate(ride_music->freq)); + if (ride_music_params->frequency != ride_music->frequency) { + ride_music->frequency = ride_music_params->frequency; + Mixer_Channel_Rate(ride_music->sound_channel, DStoMixerRate(ride_music->frequency)); } } diff --git a/src/ride/track.c b/src/ride/track.c index d6f5af362a..ff7bf11948 100644 --- a/src/ride/track.c +++ b/src/ride/track.c @@ -3047,7 +3047,7 @@ int save_track_design(uint8 rideIndex){ // Track design files format_string(RCT2_ADDRESS(0x141EE68, char), 2305, NULL); - pause_sounds(); + audio_pause_sounds(); int result = platform_open_common_file_dialog( 0, @@ -3056,7 +3056,7 @@ int save_track_design(uint8 rideIndex){ "*.TD?", RCT2_ADDRESS(0x141EE68, char)); - unpause_sounds(); + audio_unpause_sounds(); if (result == 0){ ride_list_item item = { .type = 0xFD, .entry_index = 0 }; diff --git a/src/ride/vehicle.c b/src/ride/vehicle.c index 62edd5903f..4f66083e0b 100644 --- a/src/ride/vehicle.c +++ b/src/ride/vehicle.c @@ -75,25 +75,25 @@ void vehicle_update_sound_params(rct_vehicle* vehicle) *(j + 1) = *j; } i->var_A = v9; - int panx = (RCT2_GLOBAL(0x009AF5A0, sint16) / 2) + (RCT2_GLOBAL(0x009AF5A4, sint16) / 2) - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_x; - panx >>= RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom; - panx += RCT2_GLOBAL(0x00F438A4, rct_viewport*)->x; + int pan_x = (RCT2_GLOBAL(0x009AF5A0, sint16) / 2) + (RCT2_GLOBAL(0x009AF5A4, sint16) / 2) - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_x; + pan_x >>= RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom; + pan_x += RCT2_GLOBAL(0x00F438A4, rct_viewport*)->x; uint16 screenwidth = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16); if (screenwidth < 64) { screenwidth = 64; } - i->panx = ((((panx << 16) / screenwidth) - 0x8000) >> 4); + i->pan_x = ((((pan_x << 16) / screenwidth) - 0x8000) >> 4); - int pany = (RCT2_GLOBAL(0x009AF5A2, sint16) / 2) + (RCT2_GLOBAL(0x009AF5A6, sint16) / 2) - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_y; - pany >>= RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom; - pany += RCT2_GLOBAL(0x00F438A4, rct_viewport*)->y; + int pan_y = (RCT2_GLOBAL(0x009AF5A2, sint16) / 2) + (RCT2_GLOBAL(0x009AF5A6, sint16) / 2) - RCT2_GLOBAL(0x00F438A4, rct_viewport*)->view_y; + pan_y >>= RCT2_GLOBAL(0x00F438A4, rct_viewport*)->zoom; + pan_y += RCT2_GLOBAL(0x00F438A4, rct_viewport*)->y; uint16 screenheight = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, uint16); if (screenheight < 64) { screenheight = 64; } - i->pany = ((((pany << 16) / screenheight) - 0x8000) >> 4); + i->pan_y = ((((pan_y << 16) / screenheight) - 0x8000) >> 4); sint32 v19 = vehicle->velocity; @@ -221,43 +221,43 @@ void vehicle_sounds_update() } uint8 vol1 = 0xFF; uint8 vol2 = 0xFF; - sint16 pany = vehicle_sound_params->pany; - if (pany < 0) { - pany = -pany; + sint16 pan_y = vehicle_sound_params->pan_y; + if (pan_y < 0) { + pan_y = -pan_y; } - if (pany > 0xFFF) { - pany = 0xFFF; + if (pan_y > 0xFFF) { + pan_y = 0xFFF; } - pany -= 0x800; - if (pany > 0) { - pany -= 0x400; - pany = -pany; - pany = pany / 4; - vol1 = LOBYTE(pany); - if ((sint8)HIBYTE(pany) != 0) { + pan_y -= 0x800; + if (pan_y > 0) { + pan_y -= 0x400; + pan_y = -pan_y; + pan_y = pan_y / 4; + vol1 = LOBYTE(pan_y); + if ((sint8)HIBYTE(pan_y) != 0) { vol1 = 0xFF; - if ((sint8)HIBYTE(pany) < 0) { + if ((sint8)HIBYTE(pan_y) < 0) { vol1 = 0; } } } - sint16 panx = vehicle_sound_params->panx; - if (panx < 0) { - panx = -panx; + sint16 pan_x = vehicle_sound_params->pan_x; + if (pan_x < 0) { + pan_x = -pan_x; } - if (panx > 0xFFF) { - panx = 0xFFF; + if (pan_x > 0xFFF) { + pan_x = 0xFFF; } - panx -= 0x800; - if (panx > 0) { - panx -= 0x400; - panx = -panx; - panx = panx / 4; - vol2 = LOBYTE(panx); - if ((sint8)HIBYTE(panx) != 0) { + pan_x -= 0x800; + if (pan_x > 0) { + pan_x -= 0x400; + pan_x = -pan_x; + pan_x = pan_x / 4; + vol2 = LOBYTE(pan_x); + if ((sint8)HIBYTE(pan_x) != 0) { vol2 = 0xFF; - if ((sint8)HIBYTE(panx) < 0) { + if ((sint8)HIBYTE(pan_x) < 0) { vol2 = 0; } } @@ -331,7 +331,7 @@ void vehicle_sounds_update() Mixer_Stop_Channel(vehicle_sound->sound1_channel); label69: vehicle_sound->sound1_id = sprite->vehicle.sound1_id; - vehicle_sound->sound1_pan = vehicle_sound_params->panx; + vehicle_sound->sound1_pan = vehicle_sound_params->pan_x; vehicle_sound->sound1_volume = volume; vehicle_sound->sound1_freq = vehicle_sound_params->frequency; uint16 frequency = vehicle_sound_params->frequency; @@ -339,7 +339,7 @@ void vehicle_sounds_update() frequency = (frequency / 2) + 4000; } uint8 looping = RCT2_ADDRESS(0x009AF51E, uint8)[2 * sprite->vehicle.sound1_id]; - int pan = vehicle_sound_params->panx; + int pan = vehicle_sound_params->pan_x; vehicle_sound->sound1_channel = Mixer_Play_Effect(sprite->vehicle.sound1_id, looping ? MIXER_LOOP_INFINITE : MIXER_LOOP_NONE, DStoMixerVolume(volume), DStoMixerPan(pan), DStoMixerRate(frequency), 0); goto label87; } @@ -347,9 +347,9 @@ void vehicle_sounds_update() vehicle_sound->sound1_volume = volume; Mixer_Channel_Volume(vehicle_sound->sound1_channel, DStoMixerVolume(volume)); } - if (vehicle_sound_params->panx != vehicle_sound->sound1_pan) { - vehicle_sound->sound1_pan = vehicle_sound_params->panx; - Mixer_Channel_Pan(vehicle_sound->sound1_channel, DStoMixerPan(vehicle_sound_params->panx)); + if (vehicle_sound_params->pan_x != vehicle_sound->sound1_pan) { + vehicle_sound->sound1_pan = vehicle_sound_params->pan_x; + Mixer_Channel_Pan(vehicle_sound->sound1_channel, DStoMixerPan(vehicle_sound_params->pan_x)); } if (!(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) & 3) && vehicle_sound_params->frequency != vehicle_sound->sound1_freq) { vehicle_sound->sound1_freq = vehicle_sound_params->frequency; @@ -382,7 +382,7 @@ void vehicle_sounds_update() Mixer_Stop_Channel(vehicle_sound->sound2_channel); label93: vehicle_sound->sound2_id = sprite->vehicle.sound2_id; - vehicle_sound->sound2_pan = vehicle_sound_params->panx; + vehicle_sound->sound2_pan = vehicle_sound_params->pan_x; vehicle_sound->sound2_volume = volume; vehicle_sound->sound2_freq = vehicle_sound_params->frequency; uint16 frequency = vehicle_sound_params->frequency; @@ -394,7 +394,7 @@ void vehicle_sounds_update() frequency = 25700; } uint8 looping = RCT2_ADDRESS(0x009AF51E, uint8)[2 * sprite->vehicle.sound2_id]; - int pan = vehicle_sound_params->panx; + int pan = vehicle_sound_params->pan_x; vehicle_sound->sound2_channel = Mixer_Play_Effect(sprite->vehicle.sound2_id, looping ? MIXER_LOOP_INFINITE : MIXER_LOOP_NONE, DStoMixerVolume(volume), DStoMixerPan(pan), DStoMixerRate(frequency), 0); goto label114; } @@ -402,9 +402,9 @@ void vehicle_sounds_update() Mixer_Channel_Volume(vehicle_sound->sound2_channel, DStoMixerVolume(volume)); vehicle_sound->sound2_volume = volume; } - if (vehicle_sound_params->panx != vehicle_sound->sound2_pan) { - vehicle_sound->sound2_pan = vehicle_sound_params->panx; - Mixer_Channel_Pan(vehicle_sound->sound2_channel, DStoMixerPan(vehicle_sound_params->panx)); + if (vehicle_sound_params->pan_x != vehicle_sound->sound2_pan) { + vehicle_sound->sound2_pan = vehicle_sound_params->pan_x; + Mixer_Channel_Pan(vehicle_sound->sound2_channel, DStoMixerPan(vehicle_sound_params->pan_x)); } if (!(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) & 3) && vehicle_sound_params->frequency != vehicle_sound->sound2_freq) { vehicle_sound->sound2_freq = vehicle_sound_params->frequency; diff --git a/src/title.c b/src/title.c index 1b8abc325a..bf2d8ff5a3 100644 --- a/src/title.c +++ b/src/title.c @@ -125,8 +125,8 @@ void title_load() window_staff_list_init_vars(); map_update_tile_pointers(); reset_0x69EBE4(); - stop_ride_music(); - stop_crowd_sound(); + audio_stop_ride_music(); + audio_stop_crowd_sound(); //stop_other_sounds(); viewport_init_all(); news_item_init_queue(); @@ -505,7 +505,7 @@ void title_update() for (i = 0; i < numUpdates; i++) { game_logic_update(); } - start_title_music(); + audio_start_title_music(); } RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) &= ~0x80; diff --git a/src/windows/editor_bottom_toolbar.c b/src/windows/editor_bottom_toolbar.c index 4416c40895..8e466117f9 100644 --- a/src/windows/editor_bottom_toolbar.c +++ b/src/windows/editor_bottom_toolbar.c @@ -336,9 +336,9 @@ static int show_save_scenario_dialog(char *resultPath) strcat(filename, ".SC6"); format_string(filterName, STR_RCT2_SCENARIO_FILE, NULL); - pause_sounds(); + audio_pause_sounds(); result = platform_open_common_file_dialog(0, title, filename, "*.SC6", filterName); - unpause_sounds(); + audio_unpause_sounds(); if (result) safe_strncpy(resultPath, filename, MAX_PATH); diff --git a/src/windows/editor_object_selection.c b/src/windows/editor_object_selection.c index f5eecca514..f9a00a06b9 100644 --- a/src/windows/editor_object_selection.c +++ b/src/windows/editor_object_selection.c @@ -973,7 +973,7 @@ static void window_editor_object_selection_scroll_mousedown(rct_window *w, int s window_invalidate(w); - sound_play_panned(SOUND_CLICK_1, RCT2_GLOBAL(0x142406C,uint32), 0, 0, 0); + audio_sound_play_panned(SOUND_CLICK_1, RCT2_GLOBAL(0x142406C,uint32), 0, 0, 0); if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER) { diff --git a/src/windows/error.c b/src/windows/error.c index b93d15da65..c6489d3651 100644 --- a/src/windows/error.c +++ b/src/windows/error.c @@ -138,7 +138,7 @@ void window_error_open(rct_string_id title, rct_string_id message) w->widgets = window_error_widgets; w->error.var_480 = 0; if (!(RCT2_GLOBAL(0x009A8C29, uint8) & 1)) - sound_play_panned(SOUND_ERROR, 0, w->x + (w->width / 2), 0, 0); + audio_sound_play_panned(SOUND_ERROR, 0, w->x + (w->width / 2), 0, 0); } /** diff --git a/src/windows/footpath.c b/src/windows/footpath.c index 3623eb99c2..0456bf11bf 100644 --- a/src/windows/footpath.c +++ b/src/windows/footpath.c @@ -768,7 +768,7 @@ static void window_footpath_place_path_at_point(int x, int y) // bp = RCT2_ADDRESS_COMMAND_MAP_Z // dx = RCT2_ADDRESS_COMMAND_MAP_Y // cx = RCT2_ADDRESS_COMMAND_MAP_X - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); } } @@ -852,7 +852,7 @@ static void window_footpath_construct() cost = footpath_place(type, x, y, z, slope, GAME_COMMAND_FLAG_APPLY); if (cost != MONEY32_UNDEFINED) { - sound_play_panned( + audio_sound_play_panned( SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_FROM_X, uint16), diff --git a/src/windows/install_track.c b/src/windows/install_track.c index a81bb58868..b549785c57 100644 --- a/src/windows/install_track.c +++ b/src/windows/install_track.c @@ -159,7 +159,7 @@ static void window_install_track_select(rct_window *w, int index) w->track_list.var_480 = index; - sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0); + audio_sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0); if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER) && index == 0) { window_close(w); ride_construct_new(_window_install_track_item); diff --git a/src/windows/map.c b/src/windows/map.c index 7c46d62645..29fbbb79a7 100644 --- a/src/windows/map.c +++ b/src/windows/map.c @@ -1289,7 +1289,7 @@ static void window_map_place_park_entrance_tool_down(int x, int y) if (price == MONEY32_UNDEFINED) return; - sound_play_panned( + audio_sound_play_panned( SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16), diff --git a/src/windows/maze_construction.c b/src/windows/maze_construction.c index f815181b43..3fd6efc81d 100644 --- a/src/windows/maze_construction.c +++ b/src/windows/maze_construction.c @@ -371,7 +371,7 @@ static void window_maze_construction_entrance_tooldown(int x, int y, rct_window* if (cost == MONEY32_UNDEFINED) return; - sound_play_panned( + audio_sound_play_panned( SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, sint16), @@ -509,6 +509,6 @@ static void window_maze_construction_construct(int direction) _currentTrackBeginX = x; _currentTrackBeginY = y; if (_rideConstructionState != 7) { - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); } } diff --git a/src/windows/new_ride.c b/src/windows/new_ride.c index 5fc5406d83..4fea00da60 100644 --- a/src/windows/new_ride.c +++ b/src/windows/new_ride.c @@ -688,7 +688,7 @@ static void window_new_ride_scrollmousedown(rct_window *w, int scrollIndex, int RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, ride_list_item)[_window_new_ride_current_tab] = item; w->new_ride.selected_ride_id = *((sint16*)&item); - sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0); + audio_sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0); w->new_ride.selected_ride_countdown = 8; window_invalidate(w); } diff --git a/src/windows/news.c b/src/windows/news.c index 25789b147d..623c6d579c 100644 --- a/src/windows/news.c +++ b/src/windows/news.c @@ -147,7 +147,7 @@ static void window_news_update(rct_window *w) return; window_invalidate(w); - sound_play_panned(SOUND_CLICK_2, w->x + (w->width / 2), 0, 0, 0); + audio_sound_play_panned(SOUND_CLICK_2, w->x + (w->width / 2), 0, 0, 0); j = w->news.var_480; w->news.var_480 = -1; @@ -239,7 +239,7 @@ static void window_news_scrollmousedown(rct_window *w, int scrollIndex, int x, i w->news.var_482 = buttonIndex; w->news.var_484 = 4; window_invalidate(w); - sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0); + audio_sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0); } } diff --git a/src/windows/options.c b/src/windows/options.c index 660d152380..ee607fbc48 100644 --- a/src/windows/options.c +++ b/src/windows/options.c @@ -552,14 +552,14 @@ static void window_options_mouseup(rct_window *w, int widgetIndex) case WINDOW_OPTIONS_PAGE_AUDIO: switch (widgetIndex) { case WIDX_SOUND_CHECKBOX: - toggle_all_sounds(); + audio_toggle_all_sounds(); config_save_default(); window_invalidate(w); break; case WIDX_MUSIC_CHECKBOX: gConfigSound.ride_music = !gConfigSound.ride_music; if (!gConfigSound.ride_music) { - stop_ride_music(); + audio_stop_ride_music(); } config_save_default(); window_invalidate(w); @@ -1095,9 +1095,9 @@ static void window_options_dropdown(rct_window *w, int widgetIndex, int dropdown window_invalidate(w); } - stop_title_music(); + audio_stop_title_music(); if (dropdownIndex != 0) - start_title_music(); + audio_start_title_music(); break; } break; diff --git a/src/windows/ride.c b/src/windows/ride.c index b6f44dde0b..88086e816a 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -4433,9 +4433,9 @@ static void window_ride_music_mousedown(int widgetIndex, rct_window *w, rct_widg for (i = 0; i < countof(MusicStyleOrder); i++) window_ride_current_music_style_order[numItems++] = MusicStyleOrder[i]; - if (ride_music_info_list[36]->length != 0) + if (gRideMusicInfoList[36]->length != 0) window_ride_current_music_style_order[numItems++] = MUSIC_STYLE_CUSTOM_MUSIC_1; - if (ride_music_info_list[37]->length != 0) + if (gRideMusicInfoList[37]->length != 0) window_ride_current_music_style_order[numItems++] = MUSIC_STYLE_CUSTOM_MUSIC_2; } @@ -4550,7 +4550,7 @@ static void window_ride_music_paint(rct_window *w, rct_drawpixelinfo *dpi) static void cancel_scenery_selection(){ RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) &= ~(1 << 2); RCT2_GLOBAL(0x9DEA6F, uint8) &= ~(1 << 0); - unpause_sounds(); + audio_unpause_sounds(); rct_window* main_w = window_get_main(); @@ -4579,7 +4579,7 @@ static void setup_scenery_selection(rct_window* w){ RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) |= (1 << 2); RCT2_GLOBAL(0x009DEA6F, uint8) |= 1; - pause_sounds(); + audio_pause_sounds(); rct_window* w_main = window_get_main(); diff --git a/src/windows/ride_construction.c b/src/windows/ride_construction.c index f6704d2175..b3e06f650b 100644 --- a/src/windows/ride_construction.c +++ b/src/windows/ride_construction.c @@ -1594,7 +1594,7 @@ static void window_ride_construction_construct(rct_window *w) return; } - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); if (RCT2_GLOBAL(RCT2_ADDRESS_ABOVE_GROUND_FLAGS, uint8) & TRACK_ELEMENT_LOCATION_IS_UNDERGROUND) { viewport_set_visibility(1); @@ -3554,7 +3554,7 @@ void ride_construction_tooldown_construct(int screenX, int screenY) zAttempts == 0 || z < 0 ) { - sound_play_panned(SOUND_ERROR, RCT2_GLOBAL(0x0142406C, sint32), x, y, z); + audio_sound_play_panned(SOUND_ERROR, RCT2_GLOBAL(0x0142406C, sint32), x, y, z); w = window_find_by_class(WC_RIDE_CONSTRUCTION); if (w != NULL){ tool_set(w, 23, 12); @@ -3571,7 +3571,7 @@ void ride_construction_tooldown_construct(int screenX, int screenY) } else { window_close_by_class(WC_ERROR); - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, _currentTrackBeginX, _currentTrackBeginY, _currentTrackBeginZ); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, _currentTrackBeginX, _currentTrackBeginY, _currentTrackBeginZ); break; } } @@ -3626,7 +3626,7 @@ void ride_construction_tooldown_construct(int screenX, int screenY) _currentTrackCovered = saveCurrentTrackCovered; _currentTrackLiftHill = saveCurrentTrackLiftHill; - sound_play_panned(SOUND_ERROR, RCT2_GLOBAL(0x0142406C, sint32), x, y, z); + audio_sound_play_panned(SOUND_ERROR, RCT2_GLOBAL(0x0142406C, sint32), x, y, z); break; } else if (zAttempts >= 0) { z += 16; @@ -3680,7 +3680,7 @@ static void ride_construction_tooldown_entrance_exit(int screenX, int screenY) return; } - sound_play_panned( + audio_sound_play_panned( SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), diff --git a/src/windows/save_prompt.c b/src/windows/save_prompt.c index 0321e20a66..1b05645b3f 100644 --- a/src/windows/save_prompt.c +++ b/src/windows/save_prompt.c @@ -192,7 +192,7 @@ void window_save_prompt_open() // Pause the game RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) |= 2; - pause_sounds(); + audio_pause_sounds(); window_invalidate_by_class(WC_TOP_TOOLBAR); stringId = prompt_mode + STR_LOAD_GAME_PROMPT_TITLE; @@ -212,7 +212,7 @@ static void window_save_prompt_close(rct_window *w) { // Unpause the game RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) &= ~2; - unpause_sounds(); + audio_unpause_sounds(); window_invalidate_by_class(WC_TOP_TOOLBAR); } diff --git a/src/windows/scenery.c b/src/windows/scenery.c index fd42a10f44..ecf4eaed73 100644 --- a/src/windows/scenery.c +++ b/src/windows/scenery.c @@ -795,7 +795,7 @@ void window_scenery_scrollmousedown(rct_window *w, int scrollIndex, int x, int y window_scenery_selected_scenery_by_tab[tabIndex] = sceneryId; window_scenery_is_repaint_scenery_tool_on &= 0xFE; - sound_play_panned(4, (w->width >> 1) + w->x, 0, 0, 0); + audio_sound_play_panned(4, (w->width >> 1) + w->x, 0, 0, 0); w->scenery.hover_counter = -16; RCT2_GLOBAL(RCT2_ADDRESS_SCENERY_COST, uint32) = MONEY32_UNDEFINED; window_invalidate(w); diff --git a/src/windows/title_scenarioselect.c b/src/windows/title_scenarioselect.c index 0a2f57f157..b4a4d1f6f3 100644 --- a/src/windows/title_scenarioselect.c +++ b/src/windows/title_scenarioselect.c @@ -215,7 +215,7 @@ static void window_scenarioselect_scrollmousedown(rct_window *w, int scrollIndex if (y >= 0) continue; - sound_play_panned(SOUND_CLICK_1, w->width / 2 + w->x, 0, 0, 0); + audio_sound_play_panned(SOUND_CLICK_1, w->width / 2 + w->x, 0, 0, 0); scenario_load_and_play(scenario); break; } diff --git a/src/windows/top_toolbar.c b/src/windows/top_toolbar.c index 0d8f55b6da..c40c5ea852 100644 --- a/src/windows/top_toolbar.c +++ b/src/windows/top_toolbar.c @@ -1479,7 +1479,7 @@ static void window_top_toolbar_scenery_tool_down(short x, short y, rct_window *w if (cost != MONEY32_UNDEFINED){ window_close_by_class(WC_ERROR); - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); success = true; break; } @@ -1507,7 +1507,7 @@ static void window_top_toolbar_scenery_tool_down(short x, short y, rct_window *w if (successfulPlacements > 0) { window_close_by_class(WC_ERROR); } else { - sound_play_panned(SOUND_ERROR, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); + audio_sound_play_panned(SOUND_ERROR, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); } break; } @@ -1518,7 +1518,7 @@ static void window_top_toolbar_scenery_tool_down(short x, short y, rct_window *w RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, rct_string_id) = STR_CANT_POSITION_THIS_HERE; int cost = game_do_command(gridX, flags, gridY, parameter_2, GAME_COMMAND_PLACE_PATH, parameter_3, 0); if (cost != MONEY32_UNDEFINED) { - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); } break; } @@ -1542,7 +1542,7 @@ static void window_top_toolbar_scenery_tool_down(short x, short y, rct_window *w if (cost != MONEY32_UNDEFINED){ window_close_by_class(WC_ERROR); - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); return; } @@ -1556,7 +1556,7 @@ static void window_top_toolbar_scenery_tool_down(short x, short y, rct_window *w RCT2_GLOBAL(RCT2_ADDRESS_SCENERY_Z_COORDINATE, sint16) += 8; } - sound_play_panned(SOUND_ERROR, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); + audio_sound_play_panned(SOUND_ERROR, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); break; } case SCENERY_TYPE_LARGE: @@ -1579,7 +1579,7 @@ static void window_top_toolbar_scenery_tool_down(short x, short y, rct_window *w if (cost != MONEY32_UNDEFINED){ window_close_by_class(WC_ERROR); - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); return; } @@ -1593,7 +1593,7 @@ static void window_top_toolbar_scenery_tool_down(short x, short y, rct_window *w RCT2_GLOBAL(RCT2_ADDRESS_SCENERY_Z_COORDINATE, sint16) += 8; } - sound_play_panned(SOUND_ERROR, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); + audio_sound_play_panned(SOUND_ERROR, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); break; } case SCENERY_TYPE_BANNER: @@ -1613,7 +1613,7 @@ static void window_top_toolbar_scenery_tool_down(short x, short y, rct_window *w if (cost != MONEY32_UNDEFINED) { int bannerId = regs.edi; - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16), RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16)); window_banner_open(bannerId); } break; diff --git a/src/windows/track_list.c b/src/windows/track_list.c index fc8b3187ca..76c837569b 100644 --- a/src/windows/track_list.c +++ b/src/windows/track_list.c @@ -158,7 +158,7 @@ static void window_track_list_select(rct_window *w, int index) w->track_list.var_480 = index; - sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0); + audio_sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0); if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER) && index == 0) { window_close(w); ride_construct_new(_window_track_list_item); diff --git a/src/windows/track_place.c b/src/windows/track_place.c index 85365c9dc9..38102c2370 100644 --- a/src/windows/track_place.c +++ b/src/windows/track_place.c @@ -541,7 +541,7 @@ static void window_track_place_tooldown(rct_window* w, int widgetIndex, int x, i if (cost != MONEY32_UNDEFINED) { window_close_by_class(WC_ERROR); - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, mapX, mapY, mapZ); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, mapX, mapY, mapZ); RCT2_GLOBAL(0x00F440A7, uint8) = rideIndex; if (RCT2_GLOBAL(0x00F4414E, uint8) & 1) { @@ -563,7 +563,7 @@ static void window_track_place_tooldown(rct_window* w, int widgetIndex, int x, i } // Unable to build track - sound_play_panned(SOUND_ERROR, 0x8001, mapX, mapY, mapZ); + audio_sound_play_panned(SOUND_ERROR, 0x8001, mapX, mapY, mapZ); } /** diff --git a/src/world/balloon.c b/src/world/balloon.c index 62de010dfe..b1e5cfbd1a 100644 --- a/src/world/balloon.c +++ b/src/world/balloon.c @@ -26,7 +26,7 @@ void balloon_pop(rct_balloon *balloon) { balloon->popped = 1; balloon->var_26 = 0; - sound_play_panned(SOUND_BALLOON_POP, 0x8001, balloon->x, balloon->y, balloon->z); + audio_sound_play_panned(SOUND_BALLOON_POP, 0x8001, balloon->x, balloon->y, balloon->z); } /** diff --git a/src/world/duck.c b/src/world/duck.c index 9f75a65ac5..a5f6d2d7f0 100644 --- a/src/world/duck.c +++ b/src/world/duck.c @@ -288,7 +288,7 @@ static void duck_update_fly_away(rct_duck *duck) */ void duck_press(rct_duck *duck) { - sound_play_panned(SOUND_QUACK, 0x8001, duck->x, duck->y, duck->z); + audio_sound_play_panned(SOUND_QUACK, 0x8001, duck->x, duck->y, duck->z); } /** diff --git a/src/world/map.c b/src/world/map.c index b75ea436d6..9e6519a358 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -1606,7 +1606,7 @@ money32 map_set_land_ownership(uint8 flags, sint16 x1, sint16 y1, sint16 x2, sin y += 16; sint16 z = map_element_height(x, y) & 0xFFFF; - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); return 0; } @@ -1629,7 +1629,7 @@ money32 raise_land(int flags, int x, int y, int z, int ax, int ay, int bx, int b money32 cost = 0; if ((flags & GAME_COMMAND_FLAG_APPLY) && RCT2_GLOBAL(0x009A8C28, uint8) == 1) { - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); } uint8 min_height = 0xFF; @@ -1685,7 +1685,7 @@ money32 lower_land(int flags, int x, int y, int z, int ax, int ay, int bx, int b money32 cost = 0; if ((flags & GAME_COMMAND_FLAG_APPLY) && RCT2_GLOBAL(0x009A8C28, uint8) == 1) { - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, x, y, z); } uint8 max_height = 0; @@ -1808,7 +1808,7 @@ money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags) RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint32) = x; RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint32) = y; RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint32) = z; - sound_play_panned(SOUND_LAYING_OUT_WATER, 0x8001, x, y, z); + audio_sound_play_panned(SOUND_LAYING_OUT_WATER, 0x8001, x, y, z); } // Force ride construction to recheck area @@ -1873,7 +1873,7 @@ money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags) RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint32) = x; RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint32) = y; RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint32) = z; - sound_play_panned(SOUND_LAYING_OUT_WATER, 0x8001, x, y, z); + audio_sound_play_panned(SOUND_LAYING_OUT_WATER, 0x8001, x, y, z); } // Force ride construction to recheck area @@ -2030,7 +2030,7 @@ money32 smooth_land(int flags, int centreX, int centreY, int mapLeft, int mapTop // Play sound (only once) if ((flags & GAME_COMMAND_FLAG_APPLY) && RCT2_GLOBAL(0x009A8C28, uint8) == 1) { - sound_play_panned(SOUND_PLACE_ITEM, 0x8001, centreX, centreY, centreZ); + audio_sound_play_panned(SOUND_PLACE_ITEM, 0x8001, centreX, centreY, centreZ); } money32 totalCost = 0; diff --git a/src/world/particle.c b/src/world/particle.c index 1636b3ac42..27fe0221aa 100644 --- a/src/world/particle.c +++ b/src/world/particle.c @@ -71,7 +71,7 @@ void crashed_vehicle_particle_update(rct_crashed_vehicle_particle *particle) if (waterZ != 0 && particle->z >= waterZ && z <= waterZ) { // Splash - sound_play_panned(SOUND_WATER_2, 0x8001, particle->x, particle->y, waterZ); + audio_sound_play_panned(SOUND_WATER_2, 0x8001, particle->x, particle->y, waterZ); crash_splash_create(particle->x, particle->y, waterZ); sprite_remove((rct_sprite*)particle); return;