Update some trace messages to be more useful

This commit is contained in:
Chris Robinson
2014-01-03 23:19:52 -08:00
parent 355b8db915
commit 2dd87946fd
2 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -172,14 +172,14 @@ ALsoundfont *MidiSynth_getDefSoundfont(ALCcontext *context)
f = fopen(fname, "rb");
if(f == NULL)
ERR("Failed to open default soundfont %s\n", fname);
ERR("Failed to open %s\n", fname);
else
{
Reader reader;
reader.cb = read_file;
reader.ptr = f;
reader.error = 0;
TRACE("Loading default soundfont %s\n", fname);
TRACE("Loading %s\n", fname);
loadSf2(&reader, device->DefaultSfont, context);
fclose(f);
}
+5 -4
View File
@@ -688,7 +688,7 @@ static ALboolean ensureFontSanity(const Soundfont *sfont)
return AL_TRUE;
}
static ALboolean ensureZoneSanity(const GenModList *zone, int splidx)
static ALboolean ensureZoneSanity(const GenModList *zone, int instidx, int zoneidx, int splidx)
{
ALsizei i;
@@ -701,9 +701,10 @@ static ALboolean ensureZoneSanity(const GenModList *zone, int splidx)
if(!(low >= 0 && low <= 127 && low >= 0 && low <= 127 && high >= low))
{
TRACE("Skipping sample %d with invalid %s range: %d...%d\n", splidx,
TRACE("Instrument %d zone %d sample %d, invalid %s range: %d...%d\n",
instidx, zoneidx, splidx,
(zone->gens[i].mGenerator == 43) ? "key" :
(zone->gens[i].mGenerator == 44) ? "velocity" : "(unknown)",
(zone->gens[i].mGenerator == 44) ? "vel" : "(unk)",
low, high);
return AL_FALSE;
}
@@ -932,7 +933,7 @@ static void processInstrument(ALfontsound ***sounds, ALsizei *sounds_size, ALCco
for(;mod != mod_end;mod++)
GenModList_accumMod(&lzone, mod);
if(!ensureZoneSanity(&lzone, samp-sfont->shdr))
if(!ensureZoneSanity(&lzone, inst-sfont->inst, zone-sfont->ibag, samp-sfont->shdr))
break;
(*sounds)[*sounds_size] = NewFontsound(context);