From 7e184177b94d4b493a49f6398a49988d47b2e2af Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Wed, 7 May 2025 10:45:03 -0700 Subject: [PATCH] Add `PRINT_VERBOSE` macro alongside the function --- include/godot_cpp/core/print_string.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/godot_cpp/core/print_string.hpp b/include/godot_cpp/core/print_string.hpp index 69afaf07b..3e91905e4 100644 --- a/include/godot_cpp/core/print_string.hpp +++ b/include/godot_cpp/core/print_string.hpp @@ -67,4 +67,12 @@ void print_verbose(const Variant &p_variant, Args... p_args) { bool is_print_verbose_enabled(); +// This version avoids processing the text to be printed until it actually has to be printed, saving some CPU usage. +#define PRINT_VERBOSE(m_variant) \ + { \ + if (is_print_verbose_enabled()) { \ + print_line(m_variant); \ + } \ + } + } // namespace godot