瀏覽代碼

Fix `print_verbose()` macro conflicting with `UtilityFunctions::print_verbose()`

David Snopek 8 月之前
父節點
當前提交
47d9cb9bed
共有 1 個文件被更改,包括 5 次插入7 次删除
  1. 5 7
      include/godot_cpp/core/print_string.hpp

+ 5 - 7
include/godot_cpp/core/print_string.hpp

@@ -61,15 +61,13 @@ void print_line_rich(const Variant &p_variant, Args... p_args) {
 	UtilityFunctions::print_rich(p_variant, p_args...);
 }
 
+template <typename... Args>
+void print_verbose(const Variant &p_variant, Args... p_args) {
+	UtilityFunctions::print_verbose(p_variant, p_args...);
+}
+
 bool is_print_verbose_enabled();
 
-// Checking the condition before evaluating the text to be printed avoids processing unless 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
 
 #endif // GODOT_PRINT_STRING_HPP