From b3396446afee6191a56e93c1b24aec4a0a12e68f Mon Sep 17 00:00:00 2001 From: Nicholas Estelami Date: Tue, 14 Jun 2022 18:56:17 -0400 Subject: Fixed StormLib Forward Slash BackSlash issues --- soh/src/code/audio_load.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'soh/src/code') diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index 29226bcbe..5a579e2a0 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -897,8 +897,8 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* mem, RelocInfo* relocInfo Drum* drum; SoundFontSound* sfx; s32 i; - SoundFont* sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]); - + SoundFont* sf = NULL; + s32 numDrums = 0; s32 numInstruments = 0; s32 numSfx = 0; @@ -908,6 +908,7 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* mem, RelocInfo* relocInfo numInstruments = gAudioContext.soundFonts[fontId].numInstruments; numSfx = gAudioContext.soundFonts[fontId].numSfx; } else { + sf = ResourceMgr_LoadAudioSoundFont(fontMap[fontId]); numDrums = sf->numDrums; numInstruments = sf->numInstruments; numSfx = sf->numSfx; @@ -1436,7 +1437,10 @@ void AudioLoad_Init(void* heap, u32 heapSize) { if (gUseLegacySD) numFonts = gAudioContext.soundFontTable->numEntries; - if (gUseLegacySD) { + if (gUseLegacySD) + { + gAudioContext.soundFonts = AudioHeap_Alloc(&gAudioContext.audioInitPool, numFonts * sizeof(SoundFont)); + for (i = 0; i < numFonts; i++) { AudioLoad_InitSoundFontMeta(i); } @@ -1474,11 +1478,10 @@ void AudioLoad_Init(void* heap, u32 heapSize) { numFonts = fntListSize; free(fntList); + gAudioContext.soundFonts = AudioHeap_Alloc(&gAudioContext.audioInitPool, numFonts * sizeof(SoundFont)); - int bp = 0; } - gAudioContext.soundFonts = AudioHeap_Alloc(&gAudioContext.audioInitPool, numFonts * sizeof(SoundFont)); if (temp_v0_3 = AudioHeap_Alloc(&gAudioContext.audioInitPool, D_8014A6C4.permanentPoolSize), temp_v0_3 == NULL) { // cast away const from D_8014A6C4 -- cgit v1.2.3