mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-23 10:51:58 -05:00
Do not hardcode music length
This commit is contained in:
parent
45944cb037
commit
0fb5f186ee
3 changed files with 52 additions and 55 deletions
|
@ -355,7 +355,7 @@ void audio_init_ride_sounds_and_info()
|
|||
|
||||
for (size_t m = 0; m < Util::CountOf(gRideMusicInfoList); m++)
|
||||
{
|
||||
rct_ride_music_info *rideMusicInfo = gRideMusicInfoList[m];
|
||||
rct_ride_music_info * rideMusicInfo = gRideMusicInfoList[m];
|
||||
const utf8 * path = context_get_path_legacy(rideMusicInfo->path_id);
|
||||
if (File::Exists(path))
|
||||
{
|
||||
|
@ -367,11 +367,9 @@ void audio_init_ride_sounds_and_info()
|
|||
{
|
||||
rideMusicInfo->length = 0;
|
||||
}
|
||||
// FIX: Custom ones have no length set and while populating the combo box
|
||||
// they are ignored if 0.
|
||||
if ((m == 36 || m == 37) && rideMusicInfo->length == 0)
|
||||
// The length used to be hardcoded, but we stopped doing that to allow replacement.
|
||||
if (rideMusicInfo->length == 0)
|
||||
{
|
||||
// Try to get it.
|
||||
rideMusicInfo->length = fs.GetLength();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,10 +48,9 @@ typedef struct rct_ride_music
|
|||
|
||||
typedef struct rct_ride_music_info
|
||||
{
|
||||
uint32 length;
|
||||
uint32 offset;
|
||||
uint8 path_id;
|
||||
uint8 var_9;
|
||||
uint32 offset;
|
||||
uint32 length;
|
||||
} rct_ride_music_info;
|
||||
|
||||
typedef struct rct_ride_music_params
|
||||
|
|
|
@ -3621,56 +3621,56 @@ sint32 ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, u
|
|||
return position;
|
||||
}
|
||||
|
||||
#define INIT_MUSIC_INFO(path_id, offset, length, unknown) (rct_ride_music_info[]){length, offset, path_id, unknown}
|
||||
#define INIT_MUSIC_INFO(path_id, offset) (rct_ride_music_info[]){path_id, offset, 0}
|
||||
|
||||
//0x009AF1C8
|
||||
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),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS7, 1378, 15331658, 0),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS8, 1378, 17503414, 0),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS9, 1378, 7005802, 0),
|
||||
INIT_MUSIC_INFO(0, 1378, 0, 0), // Referred to the nearly empty CSS10.DAT file
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS11, 1378, 7023288, 0),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS12, 1378, 2767948, 0),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS13, 1378, 3373390, 0),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS14, 1378, 20783042, 0),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS15, 1378, 10009312, 0),
|
||||
INIT_MUSIC_INFO(0, 1378, 0, 0), // Referred to the nearly empty CSS16.DAT file
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS3, 689, 1244886, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS17, 2756, -1, 0),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS18, 2756, 8429568, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS19, 2756, 10143784, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS20, 2756, 12271656, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS21, 2756, 9680968, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS22, 2756, 10062056, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS23, 2756, 11067432, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS24, 2756, 12427456, 0),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS25, 2756, 15181512, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS26, 2756, 10694816, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS27, 2756, 10421232, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS28, 2756, 13118376, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS29, 2756, 15310892, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS30, 2756, 10215464, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS31, 2756, 11510316, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS32, 2756, 11771944, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS33, 2756, 10759724, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS34, 2756, 14030716, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS35, 2756, 11642576, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS36, 2756, 8953764, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS37, 2756, 13303852, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS38, 2756, 10093888, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CUSTOM1, 2756, 0, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CUSTOM2, 2756, 0, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS39, 2756, 7531564, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS40, 1378, 5291306, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS41, 2756, 27860700, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS42, 2756, 6774090, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS43, 2756, 15630412, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS44, 2756, 8209704, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS45, 2756, 10006740, 1),
|
||||
INIT_MUSIC_INFO(PATH_ID_CSS46, 2756, 6772776, 1),
|
||||
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),
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue