Keep debug & verbose options after loading project from project manager

(cherry picked from commit b2d27214aa)
This commit is contained in:
PouleyKetchoupp 2020-07-09 09:32:42 +02:00 committed by Rémi Verschelde
parent 0246a1a276
commit fe0adc4f77
4 changed files with 16 additions and 0 deletions

View file

@ -197,6 +197,10 @@ bool OS::is_stdout_verbose() const {
return _verbose_stdout;
}
bool OS::is_stdout_debug_enabled() const {
return _debug_stdout;
}
void OS::dump_memory_to_file(const char *p_file) {
//Memory::dump_static_mem_to_file(p_file);
@ -812,6 +816,7 @@ OS::OS() {
low_processor_usage_mode = false;
low_processor_usage_mode_sleep_usec = 10000;
_verbose_stdout = false;
_debug_stdout = false;
_no_window = false;
_exit_code = 0;
_orientation = SCREEN_LANDSCAPE;

View file

@ -53,6 +53,7 @@ class OS {
bool low_processor_usage_mode;
int low_processor_usage_mode_sleep_usec;
bool _verbose_stdout;
bool _debug_stdout;
String _local_clipboard;
uint64_t _msec_splash;
bool _no_window;
@ -359,6 +360,7 @@ public:
virtual bool is_userfs_persistent() const { return true; }
bool is_stdout_verbose() const;
bool is_stdout_debug_enabled() const;
virtual void disable_crash_handler() {}
virtual bool is_disable_crash_handler() const { return false; }

View file

@ -2040,6 +2040,14 @@ void ProjectManager::_open_selected_projects() {
args.push_back("--editor");
if (OS::get_singleton()->is_stdout_debug_enabled()) {
args.push_back("--debug");
}
if (OS::get_singleton()->is_stdout_verbose()) {
args.push_back("--verbose");
}
if (OS::get_singleton()->is_disable_crash_handler()) {
args.push_back("--disable-crash-handler");
}

View file

@ -799,6 +799,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (I->get() == "-d" || I->get() == "--debug") {
debug_mode = "local";
OS::get_singleton()->_debug_stdout = true;
#if defined(DEBUG_ENABLED) && !defined(SERVER_ENABLED)
} else if (I->get() == "--debug-collisions") {
debug_collisions = true;