Skip to content

Commit

Permalink
[bgfx] Disabled debug output by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Nov 17, 2023
1 parent acc3cca commit c01b445
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions source/client/core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down
1 change: 1 addition & 0 deletions source/client/core/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ namespace Config {
extern bool isLightmapViewerEnabled;
extern bool isProfilerWindowEnabled;
extern bool isWireframeModeEnabled;
extern bool isBgfxDebugLogEnabled;

// Other
extern std::string defaultUsername;
Expand Down
4 changes: 3 additions & 1 deletion source/client/graphics/BgfxCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <bimg/bimg.h>

#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);
Expand All @@ -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*/) {
Expand Down

0 comments on commit c01b445

Please sign in to comment.