From 5ccbc83a6692df5318bb71242b00474b6d9d4f89 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..9c3b91e91 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