Include less things from macros.h
This commit is contained in:
parent
ca83c720ff
commit
5afab83cd6
@ -7,7 +7,9 @@
|
||||
#include "../../util/profiling_clock.h"
|
||||
#include "voxel_graph_node_db.h"
|
||||
|
||||
#include <core/config/engine.h>
|
||||
#include <core/core_string_names.h>
|
||||
#include <core/io/image.h>
|
||||
|
||||
namespace zylann::voxel {
|
||||
|
||||
|
9
util/macros.cpp
Normal file
9
util/macros.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include <core/os/os.h>
|
||||
|
||||
namespace zylann {
|
||||
|
||||
bool is_verbose_output_enabled() {
|
||||
return OS::get_singleton()->is_stdout_verbose();
|
||||
}
|
||||
|
||||
} // namespace zylann
|
@ -1,12 +1,12 @@
|
||||
#ifndef VOXEL_MACROS_H
|
||||
#define VOXEL_MACROS_H
|
||||
|
||||
#include <core/os/os.h>
|
||||
#include <core/string/print_string.h>
|
||||
|
||||
// print_verbose() is used everywhere in the engine, but its drawback is that even if you turn it off, strings
|
||||
// you print are still allocated and formatted, to not be used. This macro avoids the string.
|
||||
#define ZN_PRINT_VERBOSE(msg) \
|
||||
if (OS::get_singleton()->is_stdout_verbose()) { \
|
||||
if (is_verbose_output_enabled()) { \
|
||||
print_line(msg); \
|
||||
}
|
||||
|
||||
@ -24,4 +24,10 @@
|
||||
#define ZN_TTR(msg) msg
|
||||
#endif
|
||||
|
||||
namespace zylann {
|
||||
|
||||
bool is_verbose_output_enabled();
|
||||
|
||||
} // namespace zylann
|
||||
|
||||
#endif // VOXEL_MACROS_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user