diff --git a/source/client/core/Config.cpp b/source/client/core/Config.cpp index 7695c6ea..79b8fe30 100644 --- a/source/client/core/Config.cpp +++ b/source/client/core/Config.cpp @@ -68,6 +68,7 @@ bool Config::isChunkMinimapEnabled = false; bool Config::isLightmapViewerEnabled = false; bool Config::isProfilerWindowEnabled = false; bool Config::isWireframeModeEnabled = false; +bool Config::isBgfxDebugLogEnabled = false; // Other std::string Config::defaultUsername = ""; diff --git a/source/client/core/Config.hpp b/source/client/core/Config.hpp index 0f3c475c..d0976f48 100644 --- a/source/client/core/Config.hpp +++ b/source/client/core/Config.hpp @@ -65,6 +65,7 @@ namespace Config { extern bool isLightmapViewerEnabled; extern bool isProfilerWindowEnabled; extern bool isWireframeModeEnabled; + extern bool isBgfxDebugLogEnabled; // Other extern std::string defaultUsername; diff --git a/source/client/graphics/BgfxCallback.cpp b/source/client/graphics/BgfxCallback.cpp index de1474b8..0c9f84a3 100644 --- a/source/client/graphics/BgfxCallback.cpp +++ b/source/client/graphics/BgfxCallback.cpp @@ -31,6 +31,7 @@ #include #include "BgfxCallback.hpp" +#include "Config.hpp" void BgfxCallback::fatal(const char* _filePath, uint16_t _line, bgfx::Fatal::Enum _code, const char* _str) { trace(_filePath, _line, "BGFX FATAL 0x%08x: %s\n", _code, _str); @@ -57,7 +58,8 @@ void BgfxCallback::traceVargs(const char* _filePath, uint16_t _line, const char* bx::vsnprintf(out + len, total-len, _format, _argList); } out[total] = '\0'; - bx::debugOutput(out); + if (Config::isBgfxDebugLogEnabled) + bx::debugOutput(out); } void BgfxCallback::profilerBegin(const char* /*_name*/, uint32_t /*_abgr*/, const char* /*_filePath*/, uint16_t /*_line*/) {