From 6a23e28670e1dcf73f036cdeb6d1bd88b357dc32 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 16 Aug 2015 21:29:10 +0200 Subject: [PATCH] Refactored music file list, removed some extra unused code, clear up some comments --- src/audio/audio.c | 8 +++----- src/audio/audio.h | 2 +- src/rct2.c | 2 +- src/rct2.h | 4 ---- src/ride/ride.c | 4 ++-- src/ride/ride.h | 2 +- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/audio/audio.c b/src/audio/audio.c index b01894cc30..803ffd5fcb 100644 --- a/src/audio/audio.c +++ b/src/audio/audio.c @@ -1700,8 +1700,8 @@ void audio_init1() } } audio_init2(devicenum); - int m = 0; - do { + + for(int m = 0; m < countof(ride_music_info_list); m++) { rct_ride_music_info* ride_music_info = ride_music_info_list[m]; const char* path = get_file_path(ride_music_info->pathid); FILE *file = fopen(path, "rb"); @@ -1713,9 +1713,7 @@ void audio_init1() ride_music_info->length = 0; } } - m++; - // 46 is the number of files in ride_music_info_list - } while(m + 1 < 46); + } } /** diff --git a/src/audio/audio.h b/src/audio/audio.h index ef41f56601..d7205407a6 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -147,7 +147,7 @@ typedef struct { uint8 var_9; } rct_ride_music_info; -extern rct_ride_music_info* ride_music_info_list[]; +extern rct_ride_music_info* ride_music_info_list[46]; 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; diff --git a/src/rct2.c b/src/rct2.c index 61af055adf..8fdf68811a 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -299,7 +299,7 @@ int check_file_path(int pathId) // A data file is missing from the installation directory. The original implementation // asks for a CD-ROM path at this point and stores it in cdrom_path @ 0x9AA318. // The file_on_cdrom[pathId] @ 0x009AA0B flag is set to 1 as well. - // For PATH_ID_SIXFLAGS_MAGICMOUNTAIN and PATH_ID_SIXFLAGS_BUILDYOUROWN, + // For PATH_ID_SIXFLAGS_MAGICMOUNTAIN (and the now removed PATH_ID_SIXFLAGS_BUILDYOUROWN), // the original implementation always assumes they are stored on CD-ROM. // This has been removed for now for the sake of simplicity and could be added // later in a more convenient way using the INI file. diff --git a/src/rct2.h b/src/rct2.h index d391e0d239..f6a6533dac 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -191,10 +191,8 @@ enum { PATH_ID_CUSTOM2, PATH_ID_CSS39, PATH_ID_CSS40, - PATH_ID_TRACKSIDX, PATH_ID_CSS41, PATH_ID_SIXFLAGS_MAGICMOUNTAIN, - PATH_ID_SIXFLAGS_BUILDYOUROWN, PATH_ID_CSS42, PATH_ID_CSS43, PATH_ID_CSS44, @@ -249,10 +247,8 @@ static const char * const file_paths[] = "Data\\CUSTOM2.WAV", "Data\\CSS39.DAT", "Data\\CSS40.DAT", - "Tracks\\Tracks.IDX", "Data\\CSS41.DAT", "Scenarios\\Six Flags Magic Mountain.SC6", - "Scenarios\\Build your own Six Flags Park.SC6", "Data\\CSS42.DAT", "Data\\CSS43.DAT", "Data\\CSS44.DAT", diff --git a/src/ride/ride.c b/src/ride/ride.c index 0ab877bd53..8f11aad916 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -2509,7 +2509,7 @@ uint8 *ride_music_style_tuneids[] = { MAKE_TUNEID_LIST(18), // MUSIC_STYLE_JUNGLE_DRUMS MAKE_TUNEID_LIST(19), // MUSIC_STYLE_EGYPTIAN MAKE_TUNEID_LIST(20), // MUSIC_STYLE_TOYLAND - MAKE_TUNEID_LIST(21), // MUSIC_STYLE_8 + MAKE_TUNEID_LIST(21), // MUSIC_STYLE_CIRCUS_SHOW MAKE_TUNEID_LIST(22), // MUSIC_STYLE_SPACE MAKE_TUNEID_LIST(23), // MUSIC_STYLE_HORROR MAKE_TUNEID_LIST(24), // MUSIC_STYLE_TECHNO @@ -3313,7 +3313,7 @@ int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint #define INIT_MUSIC_INFO(pathid, offset, length, unknown) (rct_ride_music_info[]){length, offset, pathid, unknown} //0x009AF1C8 -rct_ride_music_info* ride_music_info_list[] = { +rct_ride_music_info* ride_music_info_list[46] = { 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), diff --git a/src/ride/ride.h b/src/ride/ride.h index 0bdc574eb6..a87a168d64 100644 --- a/src/ride/ride.h +++ b/src/ride/ride.h @@ -598,7 +598,7 @@ enum { MUSIC_STYLE_JUNGLE_DRUMS, MUSIC_STYLE_EGYPTIAN, MUSIC_STYLE_TOYLAND, - MUSIC_STYLE_8, + MUSIC_STYLE_CIRCUS_SHOW, MUSIC_STYLE_SPACE, MUSIC_STYLE_HORROR, MUSIC_STYLE_TECHNO,