From 1d12470a78d31a054aefc7f7c9a863db24b09986 Mon Sep 17 00:00:00 2001 From: George Marques Date: Tue, 14 Nov 2017 20:01:45 -0200 Subject: Add print_error function, akin to print_line --- core/print_string.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'core/print_string.cpp') diff --git a/core/print_string.cpp b/core/print_string.cpp index 92a04cbf0..520fb3dae 100644 --- a/core/print_string.cpp +++ b/core/print_string.cpp @@ -82,7 +82,25 @@ void print_line(String p_string) { PrintHandlerList *l = print_handler_list; while (l) { - l->printfunc(l->userdata, p_string); + l->printfunc(l->userdata, p_string, false); + l = l->next; + } + + _global_unlock(); +} + +void print_error(String p_string) { + + if (!_print_error_enabled) + return; + + OS::get_singleton()->printerr("%s\n", p_string.utf8().get_data()); + + _global_lock(); + PrintHandlerList *l = print_handler_list; + while (l) { + + l->printfunc(l->userdata, p_string, true); l = l->next; } -- cgit v1.2.3-70-g09d2