diff options
Diffstat (limited to 'drivers/unix/os_unix.cpp')
-rw-r--r-- | drivers/unix/os_unix.cpp | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index c5eb343cc8..458488f3e9 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -32,14 +32,14 @@ #ifdef UNIX_ENABLED +#include "core/debugger/engine_debugger.h" +#include "core/debugger/script_debugger.h" #include "core/os/thread_dummy.h" #include "core/project_settings.h" #include "drivers/unix/dir_access_unix.h" #include "drivers/unix/file_access_unix.h" -#include "drivers/unix/mutex_posix.h" #include "drivers/unix/net_socket_posix.h" #include "drivers/unix/rw_lock_posix.h" -#include "drivers/unix/semaphore_posix.h" #include "drivers/unix/thread_posix.h" #include "servers/visual_server.h" @@ -96,16 +96,16 @@ void OS_Unix::debug_break() { }; static void handle_interrupt(int sig) { - if (ScriptDebugger::get_singleton() == NULL) + if (!EngineDebugger::is_active()) return; - ScriptDebugger::get_singleton()->set_depth(-1); - ScriptDebugger::get_singleton()->set_lines_left(1); + EngineDebugger::get_script_debugger()->set_depth(-1); + EngineDebugger::get_script_debugger()->set_lines_left(1); } void OS_Unix::initialize_debugging() { - if (ScriptDebugger::get_singleton() != NULL) { + if (EngineDebugger::is_active()) { struct sigaction action; memset(&action, 0, sizeof(action)); action.sa_handler = handle_interrupt; @@ -122,15 +122,9 @@ void OS_Unix::initialize_core() { #ifdef NO_THREADS ThreadDummy::make_default(); - SemaphoreDummy::make_default(); - MutexDummy::make_default(); RWLockDummy::make_default(); #else ThreadPosix::make_default(); -#if !defined(OSX_ENABLED) && !defined(IPHONE_ENABLED) - SemaphorePosix::make_default(); -#endif - MutexPosix::make_default(); RWLockPosix::make_default(); #endif FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_RESOURCES); @@ -310,7 +304,7 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo if (p_pipe_mutex) { p_pipe_mutex->lock(); } - (*r_pipe) += buf; + (*r_pipe) += String::utf8(buf); if (p_pipe_mutex) { p_pipe_mutex->unlock(); } @@ -559,34 +553,34 @@ void UnixTerminalLogger::log_error(const char *p_function, const char *p_file, i // This prevents Godot from writing ANSI escape codes when redirecting // stdout and stderr to a file. const bool tty = isatty(fileno(stdout)); - const char *red = tty ? "\E[0;31m" : ""; + const char *gray = tty ? "\E[0;90m" : ""; + const char *red = tty ? "\E[0;91m" : ""; const char *red_bold = tty ? "\E[1;31m" : ""; - const char *yellow = tty ? "\E[0;33m" : ""; + const char *yellow = tty ? "\E[0;93m" : ""; const char *yellow_bold = tty ? "\E[1;33m" : ""; - const char *magenta = tty ? "\E[0;35m" : ""; + const char *magenta = tty ? "\E[0;95m" : ""; const char *magenta_bold = tty ? "\E[1;35m" : ""; - const char *cyan = tty ? "\E[0;36m" : ""; + const char *cyan = tty ? "\E[0;96m" : ""; const char *cyan_bold = tty ? "\E[1;36m" : ""; const char *reset = tty ? "\E[0m" : ""; - const char *bold = tty ? "\E[1m" : ""; switch (p_type) { case ERR_WARNING: - logf_error("%sWARNING: %s: %s%s%s\n", yellow_bold, p_function, reset, bold, err_details); - logf_error("%s At: %s:%i.%s\n", yellow, p_file, p_line, reset); + logf_error("%sWARNING:%s %s\n", yellow_bold, yellow, err_details); + logf_error("%s at: %s (%s:%i)%s\n", gray, p_function, p_file, p_line, reset); break; case ERR_SCRIPT: - logf_error("%sSCRIPT ERROR: %s: %s%s%s\n", magenta_bold, p_function, reset, bold, err_details); - logf_error("%s At: %s:%i.%s\n", magenta, p_file, p_line, reset); + logf_error("%sSCRIPT ERROR:%s %s\n", magenta_bold, magenta, err_details); + logf_error("%s at: %s (%s:%i)%s\n", gray, p_function, p_file, p_line, reset); break; case ERR_SHADER: - logf_error("%sSHADER ERROR: %s: %s%s%s\n", cyan_bold, p_function, reset, bold, err_details); - logf_error("%s At: %s:%i.%s\n", cyan, p_file, p_line, reset); + logf_error("%sSHADER ERROR:%s %s\n", cyan_bold, cyan, err_details); + logf_error("%s at: %s (%s:%i)%s\n", gray, p_function, p_file, p_line, reset); break; case ERR_ERROR: default: - logf_error("%sERROR: %s: %s%s%s\n", red_bold, p_function, reset, bold, err_details); - logf_error("%s At: %s:%i.%s\n", red, p_file, p_line, reset); + logf_error("%sERROR:%s %s\n", red_bold, red, err_details); + logf_error("%s at: %s (%s:%i)%s\n", gray, p_function, p_file, p_line, reset); break; } } |