all repos — mgba @ 642ba374e7c3c65dfb74c6d8ba1cc5beca839f3e

mGBA Game Boy Advance Emulator

GBA: Allow GBAThread to override GBA object logLevel
Jeffrey Pfau jeffrey@endrift.com
Thu, 01 Jan 2015 16:05:07 -0800
commit

642ba374e7c3c65dfb74c6d8ba1cc5beca839f3e

parent

b51710e92f0d9050666a531c060c0c4343e3e13f

1 files changed, 8 insertions(+), 4 deletions(-)

jump to
M src/gba/gba.csrc/gba/gba.c

@@ -607,13 +607,17 @@ }

static void _GBAVLog(struct GBA* gba, enum GBALogLevel level, const char* format, va_list args) { struct GBAThread* threadContext = GBAThreadGetContext(); + enum GBALogLevel logLevel = -1; + + if (gba) { + logLevel = gba->logLevel; + } + if (threadContext) { - if (!gba) { - gba = threadContext->gba; - } + logLevel = threadContext->logLevel; } - if (gba && !(level & gba->logLevel) && level != GBA_LOG_FATAL) { + if (!(level & logLevel) && level != GBA_LOG_FATAL) { return; }