mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-12 21:35:13 +00:00
Update func__sndopen() to use filepath_fix_directory()
This commit is contained in:
parent
cd5a60546f
commit
84b58c0fde
|
@ -109,7 +109,7 @@ const char *filepath_fix_directory(qbs *path) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return (char *)path->chr;
|
return reinterpret_cast<char *>(path->chr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Changes the slashes in a file name / path to make it compatible with the OS
|
/// @brief Changes the slashes in a file name / path to make it compatible with the OS
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#define STB_VORBIS_HEADER_ONLY
|
#define STB_VORBIS_HEADER_ONLY
|
||||||
#include "datetime.h"
|
#include "datetime.h"
|
||||||
#include "extras/stb_vorbis.c"
|
#include "extras/stb_vorbis.c"
|
||||||
|
#include "filepath.h"
|
||||||
#include "miniaudio.h"
|
#include "miniaudio.h"
|
||||||
#include "mutex.h"
|
#include "mutex.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -1754,8 +1755,8 @@ int32_t func__sndopen(qbs *fileName, qbs *requirements, int32_t passed) {
|
||||||
qbs_set(fileNameZ, qbs_add(fileName, qbs_new_txt_len("\0", 1))); // s1 = filename + CHR$(0)
|
qbs_set(fileNameZ, qbs_add(fileName, qbs_new_txt_len("\0", 1))); // s1 = filename + CHR$(0)
|
||||||
|
|
||||||
// Forward the request to miniaudio to open the sound file
|
// Forward the request to miniaudio to open the sound file
|
||||||
audioEngine.maResult = ma_sound_init_from_file(&audioEngine.maEngine, (const char *)fileNameZ->chr, audioEngine.soundHandles[handle]->maFlags, NULL,
|
audioEngine.maResult = ma_sound_init_from_file(&audioEngine.maEngine, filepath_fix_directory(fileNameZ), audioEngine.soundHandles[handle]->maFlags,
|
||||||
NULL, &audioEngine.soundHandles[handle]->maSound);
|
NULL, NULL, &audioEngine.soundHandles[handle]->maSound);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the sound failed to initialize, then free the handle and return INVALID_SOUND_HANDLE
|
// If the sound failed to initialize, then free the handle and return INVALID_SOUND_HANDLE
|
||||||
|
|
Loading…
Reference in a new issue