-moved sounds to mem1 (overjoy, play around with them in mem2 and

you'll notice why I moved them to mem1 now)
This commit is contained in:
fix94.1 2012-06-20 12:45:53 +00:00
parent 3f79b1f8e0
commit 50f0e72e17

View File

@ -104,7 +104,7 @@ GuiSound::GuiSound(GuiSound *g)
if (g->sound != NULL) if (g->sound != NULL)
{ {
u8 * snd = (u8 *)MEM2_alloc(g->length); u8 *snd = (u8 *)MEM1_alloc(g->length);
memcpy(snd, g->sound, length); memcpy(snd, g->sound, length);
Load(snd, g->length, true); Load(snd, g->length, true);
} }
@ -144,7 +144,7 @@ void GuiSound::FreeMemory()
if(allocated) if(allocated)
{ {
MEM2_free(sound); MEM1_free(sound);
allocated = false; allocated = false;
} }
filepath = ""; filepath = "";
@ -237,15 +237,15 @@ bool GuiSound::LoadSoundEffect(const u8 * snd, u32 len)
decoder.Rewind(); decoder.Rewind();
u32 done = 0; u32 done = 0;
sound = (u8 *)MEM2_alloc(4096); sound = (u8 *)MEM1_alloc(4096);
memset(sound, 0, 4096); memset(sound, 0, 4096);
while(1) while(1)
{ {
u8 * tmpsnd = (u8 *)MEM2_realloc(sound, done+4096); u8 * tmpsnd = (u8 *)MEM1_realloc(sound, done+4096);
if(!tmpsnd) if(!tmpsnd)
{ {
MEM2_free(sound); MEM1_free(sound);
return false; return false;
} }
@ -258,7 +258,7 @@ bool GuiSound::LoadSoundEffect(const u8 * snd, u32 len)
done += read; done += read;
} }
sound = (u8 *)MEM2_realloc(sound, done); sound = (u8 *)MEM1_realloc(sound, done);
SoundEffectLength = done; SoundEffectLength = done;
allocated = true; allocated = true;
@ -407,7 +407,7 @@ u8 * uncompressLZ77(const u8 *inBuf, u32 inLength, u32 * size)
const u8 *inBufEnd = inBuf + inLength; const u8 *inBufEnd = inBuf + inLength;
inBuf += 8; inBuf += 8;
buffer = (u8 *)MEM2_alloc(uncSize); buffer = (u8 *)MEM1_alloc(uncSize);
if (!buffer) if (!buffer)
return buffer; return buffer;
@ -468,7 +468,7 @@ void GuiSound::UncompressSoundbin(const u8 * snd, u32 len, bool isallocated)
} }
else else
{ {
sound = (u8 *)MEM2_alloc(length); sound = (u8 *)MEM1_alloc(length);
if (!sound) if (!sound)
{ {
length = 0; length = 0;
@ -480,7 +480,7 @@ void GuiSound::UncompressSoundbin(const u8 * snd, u32 len, bool isallocated)
if(isallocated) if(isallocated)
{ {
void *p = (void *)snd; void *p = (void *)snd;
MEM2_free(p); MEM1_free(p);
} }
allocated = true; allocated = true;