Log the function name instead of the source file and line number
This commit is contained in:
@@ -1344,16 +1344,18 @@ static ALvoid InitContext(ALCcontext *pContext)
|
||||
*/
|
||||
static ALCvoid FreeContext(ALCcontext *context)
|
||||
{
|
||||
TRACE("%p\n", context);
|
||||
|
||||
if(context->SourceMap.size > 0)
|
||||
{
|
||||
ERR("FreeContext(%p): deleting %d Source(s)\n", context, context->SourceMap.size);
|
||||
ERR("(%p) Deleting %d Source(s)\n", context, context->SourceMap.size);
|
||||
ReleaseALSources(context);
|
||||
}
|
||||
ResetUIntMap(&context->SourceMap);
|
||||
|
||||
if(context->EffectSlotMap.size > 0)
|
||||
{
|
||||
ERR("FreeContext(%p): deleting %d AuxiliaryEffectSlot(s)\n", context, context->EffectSlotMap.size);
|
||||
ERR("(%p) Deleting %d AuxiliaryEffectSlot(s)\n", context, context->EffectSlotMap.size);
|
||||
ReleaseALAuxiliaryEffectSlots(context);
|
||||
}
|
||||
ResetUIntMap(&context->EffectSlotMap);
|
||||
@@ -1377,14 +1379,14 @@ void ALCcontext_IncRef(ALCcontext *context)
|
||||
{
|
||||
RefCount ref;
|
||||
ref = IncrementRef(&context->ref);
|
||||
TRACE("%p refcount increment to %d\n", context, ref);
|
||||
TRACE("%p increasing refcount to %u\n", context, ref);
|
||||
}
|
||||
|
||||
void ALCcontext_DecRef(ALCcontext *context)
|
||||
{
|
||||
RefCount ref;
|
||||
ref = DecrementRef(&context->ref);
|
||||
TRACE("%p refcount decrement to %d\n", context, ref);
|
||||
TRACE("%p decreasing refcount to %u\n", context, ref);
|
||||
if(ref == 0) FreeContext(context);
|
||||
}
|
||||
|
||||
@@ -2537,7 +2539,7 @@ ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *pDevice)
|
||||
|
||||
if(pDevice->NumContexts > 0)
|
||||
{
|
||||
WARN("alcCloseDevice(): destroying %u Context(s)\n", pDevice->NumContexts);
|
||||
WARN("Destroying %u Context(s)\n", pDevice->NumContexts);
|
||||
while(pDevice->ContextList)
|
||||
alcDestroyContext(pDevice->ContextList);
|
||||
}
|
||||
@@ -2545,21 +2547,21 @@ ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *pDevice)
|
||||
|
||||
if(pDevice->BufferMap.size > 0)
|
||||
{
|
||||
WARN("alcCloseDevice(): deleting %d Buffer(s)\n", pDevice->BufferMap.size);
|
||||
WARN("Deleting %d Buffer(s)\n", pDevice->BufferMap.size);
|
||||
ReleaseALBuffers(pDevice);
|
||||
}
|
||||
ResetUIntMap(&pDevice->BufferMap);
|
||||
|
||||
if(pDevice->EffectMap.size > 0)
|
||||
{
|
||||
WARN("alcCloseDevice(): deleting %d Effect(s)\n", pDevice->EffectMap.size);
|
||||
WARN("Deleting %d Effect(s)\n", pDevice->EffectMap.size);
|
||||
ReleaseALEffects(pDevice);
|
||||
}
|
||||
ResetUIntMap(&pDevice->EffectMap);
|
||||
|
||||
if(pDevice->FilterMap.size > 0)
|
||||
{
|
||||
WARN("alcCloseDevice(): deleting %d Filter(s)\n", pDevice->FilterMap.size);
|
||||
WARN("Deleting %d Filter(s)\n", pDevice->FilterMap.size);
|
||||
ReleaseALFilters(pDevice);
|
||||
}
|
||||
ResetUIntMap(&pDevice->FilterMap);
|
||||
@@ -2703,7 +2705,7 @@ static void ReleaseALC(ALCboolean doclose)
|
||||
if(doclose)
|
||||
{
|
||||
if(g_ulDeviceCount > 0)
|
||||
WARN("ReleaseALC(): closing %u Device%s\n", g_ulDeviceCount, (g_ulDeviceCount>1)?"s":"");
|
||||
WARN("Closing %u device%s\n", g_ulDeviceCount, (g_ulDeviceCount>1)?"s":"");
|
||||
|
||||
while(g_pDeviceList)
|
||||
{
|
||||
@@ -2716,7 +2718,7 @@ static void ReleaseALC(ALCboolean doclose)
|
||||
else
|
||||
{
|
||||
if(g_ulDeviceCount > 0)
|
||||
WARN("ReleaseALC(): %u Device%s not closed\n", g_ulDeviceCount, (g_ulDeviceCount>1)?"s":"");
|
||||
WARN("%u device%s not closed\n", g_ulDeviceCount, (g_ulDeviceCount>1)?"s":"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-8
@@ -207,18 +207,12 @@ void *GetSymbol(void *handle, const char *name)
|
||||
#endif
|
||||
|
||||
|
||||
void al_print(const char *fname, unsigned int line, const char *fmt, ...)
|
||||
void al_print(const char *func, const char *fmt, ...)
|
||||
{
|
||||
const char *fn;
|
||||
char str[256];
|
||||
int i;
|
||||
|
||||
fn = strrchr(fname, '/');
|
||||
if(!fn) fn = strrchr(fname, '\\');
|
||||
if(!fn) fn = fname;
|
||||
else fn += 1;
|
||||
|
||||
i = snprintf(str, sizeof(str), "AL lib: %s:%d: ", fn, line);
|
||||
i = snprintf(str, sizeof(str), "AL lib: %s: ", func);
|
||||
if(i < (int)sizeof(str) && i > 0)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
+1
-1
@@ -291,7 +291,7 @@ ALCboolean IsHrtfCompatible(ALCdevice *device)
|
||||
{
|
||||
if(device->FmtChans == DevFmtStereo && device->Frequency == Hrtf.sampleRate)
|
||||
return ALC_TRUE;
|
||||
ERR("Incompatible HRTF format: %s %uhz (%s %uhz needed)\n",
|
||||
ERR("format: %s %uhz (needed: %s %uhz)\n",
|
||||
DevFmtChannelsString(device->FmtChans), device->Frequency,
|
||||
DevFmtChannelsString(DevFmtStereo), Hrtf.sampleRate);
|
||||
return ALC_FALSE;
|
||||
|
||||
@@ -674,9 +674,8 @@ ALfloat CalcHrtfDelta(ALfloat oldGain, ALfloat newGain, const ALfloat olddir[3],
|
||||
void GetLerpedHrtfCoeffs(ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat (*coeffs)[2], ALuint *delays);
|
||||
ALuint GetMovingHrtfCoeffs(ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat delta, ALint counter, ALfloat (*coeffs)[2], ALuint *delays, ALfloat (*coeffStep)[2], ALint *delayStep);
|
||||
|
||||
void al_print(const char *fname, unsigned int line, const char *fmt, ...)
|
||||
PRINTF_STYLE(3,4);
|
||||
#define AL_PRINT(...) al_print(__FILE__, __LINE__, __VA_ARGS__)
|
||||
void al_print(const char *func, const char *fmt, ...) PRINTF_STYLE(2,3);
|
||||
#define AL_PRINT(...) al_print(__FUNCTION__, __VA_ARGS__)
|
||||
|
||||
extern FILE *LogFile;
|
||||
enum LogLevel {
|
||||
|
||||
Reference in New Issue
Block a user