diff options
| author | Ray <[email protected]> | 2022-05-12 16:35:28 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-05-12 16:35:28 +0200 |
| commit | f3aac87422220b0b8adcefd46f72dbd62c9736d5 (patch) | |
| tree | 5990dfb600e41c6726023ba85f94b23adb65dff4 | |
| parent | ea598f7d7722a725fb73069bc11eab6c2e2b93a5 (diff) | |
| download | raylib-f3aac87422220b0b8adcefd46f72dbd62c9736d5.tar.gz raylib-f3aac87422220b0b8adcefd46f72dbd62c9736d5.zip | |
Some minor tweaks
| -rw-r--r-- | src/raudio.c | 10 | ||||
| -rw-r--r-- | src/rcore.c | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/raudio.c b/src/raudio.c index aae9ba87..47a0da40 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1518,16 +1518,14 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, jar_xm_set_max_loop_count(ctxXm, 0); // Set infinite number of loops unsigned int bits = 32; - if (AUDIO_DEVICE_FORMAT == ma_format_s16) - bits = 16; - else if (AUDIO_DEVICE_FORMAT == ma_format_u8) - bits = 8; + if (AUDIO_DEVICE_FORMAT == ma_format_s16) bits = 16; + else if (AUDIO_DEVICE_FORMAT == ma_format_u8) bits = 8; // NOTE: Only stereo is supported for XM music.stream = LoadAudioStream(AUDIO.System.device.sampleRate, bits, 2); music.frameCount = (unsigned int)jar_xm_get_remaining_samples(ctxXm); // NOTE: Always 2 channels (stereo) music.looping = true; // Looping enabled by default - jar_xm_reset(ctxXm); // make sure we start at the beginning of the song + jar_xm_reset(ctxXm); // make sure we start at the beginning of the song music.ctxData = ctxXm; musicLoaded = true; @@ -1548,7 +1546,7 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, for (int i = 0; i < it; i++) newData[i] = data[i]; // Memory loaded version for jar_mod_load_file() - if (dataSize && dataSize < 32*1024*1024) + if (dataSize && (dataSize < 32*1024*1024)) { ctxMod->modfilesize = dataSize; ctxMod->modfile = newData; diff --git a/src/rcore.c b/src/rcore.c index 552ad201..b2fbabbf 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2910,7 +2910,7 @@ const char *GetFileName(const char *filePath) // Get filename string without extension (uses static string) const char *GetFileNameWithoutExt(const char *filePath) { - #define MAX_FILENAMEWITHOUTEXT_LENGTH 128 + #define MAX_FILENAMEWITHOUTEXT_LENGTH 256 static char fileName[MAX_FILENAMEWITHOUTEXT_LENGTH] = { 0 }; memset(fileName, 0, MAX_FILENAMEWITHOUTEXT_LENGTH); |
