diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-06-30 14:33:18 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-07-15 17:06:12 +0200 |
commit | 780cd225e967ce37dd5c5c787e516c48db28a71e (patch) | |
tree | 1c3d06f80b867e0d238a9e4bff17602362294d6e /src/audio/sampman_miles.cpp | |
parent | Remove stupid cast (diff) | |
download | re3-780cd225e967ce37dd5c5c787e516c48db28a71e.tar re3-780cd225e967ce37dd5c5c787e516c48db28a71e.tar.gz re3-780cd225e967ce37dd5c5c787e516c48db28a71e.tar.bz2 re3-780cd225e967ce37dd5c5c787e516c48db28a71e.tar.lz re3-780cd225e967ce37dd5c5c787e516c48db28a71e.tar.xz re3-780cd225e967ce37dd5c5c787e516c48db28a71e.tar.zst re3-780cd225e967ce37dd5c5c787e516c48db28a71e.zip |
Diffstat (limited to 'src/audio/sampman_miles.cpp')
-rw-r--r-- | src/audio/sampman_miles.cpp | 100 |
1 files changed, 84 insertions, 16 deletions
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index 49f2f10f..b77584d0 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1061,10 +1061,20 @@ cSampleManager::Initialise(void) #endif for ( int32 i = STREAMED_SOUND_MISSION_MOBR1; i < TOTAL_STREAMED_SOUNDS; i++ ) { +#ifdef PS2_AUDIO_PATHS strcpy(filepath, m_szCDRomRootPath); - strcat(filepath, StreamedNameTable[i]); - + strcat(filepath, PS2StreamedNameTable[i]); + mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); + + if ( !mp3Stream[0] ) +#endif + { + strcpy(filepath, m_szCDRomRootPath); + strcat(filepath, StreamedNameTable[i]); + + mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); + } if ( mp3Stream[0] ) { @@ -1102,11 +1112,21 @@ cSampleManager::Initialise(void) for (int32 i = 0; i < STREAMED_SOUND_MISSION_MOBR1; i++) { +#ifdef PS2_AUDIO_PATHS strcpy(filepath, m_MP3FilesPath); - strcat(filepath, StreamedNameTable[i]); + strcat(filepath, PS2StreamedNameTable[i]); mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); + if ( !mp3Stream[0] ) +#endif + { + strcpy(filepath, m_MP3FilesPath); + strcat(filepath, StreamedNameTable[i]); + + mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); + } + if (mp3Stream[0]) { AIL_stream_ms_position(mp3Stream[0], &tatalms, NULL); @@ -1147,10 +1167,20 @@ cSampleManager::Initialise(void) #endif for ( int32 i = STREAMED_SOUND_MISSION_COMPLETED4; i < STREAMED_SOUND_MISSION_PAGER; i++ ) { +#ifdef PS2_AUDIO_PATHS strcpy(filepath, m_MiscomPath); - strcat(filepath, StreamedNameTable[i]); - + strcat(filepath, PS2StreamedNameTable[i]); + mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); + + if ( !mp3Stream[0] ) +#endif + { + strcpy(filepath, m_MiscomPath); + strcat(filepath, StreamedNameTable[i]); + + mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); + } if ( mp3Stream[0] ) { @@ -2043,11 +2073,20 @@ cSampleManager::PreloadStreamedFile(uint32 nFile, uint8 nStream) } char filepath[MAX_PATH]; - +#ifdef PS2_AUDIO_PATHS strcpy(filepath, nFile < STREAMED_SOUND_MISSION_COMPLETED4 ? m_MP3FilesPath : (nFile < STREAMED_SOUND_MISSION_MOBR1 ? m_MiscomPath : m_WavFilesPath)); - strcat(filepath, StreamedNameTable[nFile]); - + strcat(filepath, PS2StreamedNameTable[nFile]); + mp3Stream[nStream] = AIL_open_stream(DIG, filepath, 0); + + if ( !mp3Stream[nStream] ) +#endif + { + strcpy(filepath, nFile < STREAMED_SOUND_MISSION_COMPLETED4 ? m_MP3FilesPath : (nFile < STREAMED_SOUND_MISSION_MOBR1 ? m_MiscomPath : m_WavFilesPath)); + strcat(filepath, StreamedNameTable[nFile]); + + mp3Stream[nStream] = AIL_open_stream(DIG, filepath, 0); + } if ( mp3Stream[nStream] ) { @@ -2109,10 +2148,20 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream) // Try to continue from previous song, if already started if(!_GetMP3PosFromStreamPos(&position, &e) && !e) { nFile = 0; +#ifdef PS2_AUDIO_PATHS strcpy(filename, m_MiscomPath); - strcat(filename, StreamedNameTable[nFile]); - mp3Stream[nStream] = - AIL_open_stream(DIG, filename, 0); + strcat(filename, PS2StreamedNameTable[nFile]); + + mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); + + if ( !mp3Stream[nStream] ) +#endif + { + strcpy(filename, m_MiscomPath); + strcat(filename, StreamedNameTable[nFile]); + mp3Stream[nStream] = + AIL_open_stream(DIG, filename, 0); + } if(mp3Stream[nStream]) { AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1); nStreamLoopedFlag[nStream] = TRUE; @@ -2156,11 +2205,20 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream) { nFile = 0; _bIsMp3Active = 0; +#ifdef PS2_AUDIO_PATHS strcpy(filename, m_MiscomPath); - strcat(filename, StreamedNameTable[nFile]); + strcat(filename, PS2StreamedNameTable[nFile]); - mp3Stream[nStream] = - AIL_open_stream(DIG, filename, 0); + mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); + + if ( !mp3Stream[nStream] ) +#endif + { + strcpy(filename, m_MiscomPath); + strcat(filename, StreamedNameTable[nFile]); + mp3Stream[nStream] = + AIL_open_stream(DIG, filename, 0); + } if(mp3Stream[nStream]) { AIL_set_stream_loop_count( mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1); @@ -2201,10 +2259,20 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream) position = 0; nFile = 0; } +#ifdef PS2_AUDIO_PATHS strcpy(filename, m_MiscomPath); - strcat(filename, StreamedNameTable[nFile]); - + strcat(filename, PS2StreamedNameTable[nFile]); + mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); + + if ( !mp3Stream[nStream] ) +#endif + { + strcpy(filename, m_MiscomPath); + strcat(filename, StreamedNameTable[nFile]); + mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0); + } + if ( mp3Stream[nStream] ) { AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1); |