diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/SCsub | 3 | ||||
-rw-r--r-- | main/main.cpp | 74 | ||||
-rw-r--r-- | main/splash.png | bin | 15311 -> 14766 bytes | |||
-rw-r--r-- | main/splash_editor.png | bin | 39571 -> 36310 bytes |
4 files changed, 62 insertions, 15 deletions
diff --git a/main/SCsub b/main/SCsub index 62bc155c67..73cec1d250 100644 --- a/main/SCsub +++ b/main/SCsub @@ -28,7 +28,8 @@ env.CommandNoCache("#main/splash_editor.gen.h", "#main/splash_editor.png", run_i env.Depends("#main/app_icon.gen.h", "#main/app_icon.png") env.CommandNoCache("#main/app_icon.gen.h", "#main/app_icon.png", run_in_subprocess(main_builders.make_app_icon)) -SConscript('tests/SCsub') +if env["tools"]: + SConscript('tests/SCsub') lib = env.add_library("main", env.main_sources) env.Prepend(LIBS=[lib]) diff --git a/main/main.cpp b/main/main.cpp index 5de5c52b14..28c4ef7fbb 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -444,6 +444,32 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (I->next()) { audio_driver = I->next()->get(); + + bool found = false; + for (int i = 0; i < OS::get_singleton()->get_audio_driver_count(); i++) { + if (audio_driver == OS::get_singleton()->get_audio_driver_name(i)) { + found = true; + } + } + + if (!found) { + OS::get_singleton()->print("Unknown audio driver '%s', aborting.\nValid options are ", audio_driver.utf8().get_data()); + + for (int i = 0; i < OS::get_singleton()->get_audio_driver_count(); i++) { + if (i == OS::get_singleton()->get_audio_driver_count() - 1) { + OS::get_singleton()->print(" and "); + } else if (i != 0) { + OS::get_singleton()->print(", "); + } + + OS::get_singleton()->print("'%s'", OS::get_singleton()->get_audio_driver_name(i)); + } + + OS::get_singleton()->print(".\n"); + + goto error; + } + N = I->next()->next(); } else { OS::get_singleton()->print("Missing audio driver argument, aborting.\n"); @@ -455,6 +481,32 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (I->next()) { video_driver = I->next()->get(); + + bool found = false; + for (int i = 0; i < OS::get_singleton()->get_video_driver_count(); i++) { + if (video_driver == OS::get_singleton()->get_video_driver_name(i)) { + found = true; + } + } + + if (!found) { + OS::get_singleton()->print("Unknown video driver '%s', aborting.\nValid options are ", video_driver.utf8().get_data()); + + for (int i = 0; i < OS::get_singleton()->get_video_driver_count(); i++) { + if (i == OS::get_singleton()->get_video_driver_count() - 1) { + OS::get_singleton()->print(" and "); + } else if (i != 0) { + OS::get_singleton()->print(", "); + } + + OS::get_singleton()->print("'%s'", OS::get_singleton()->get_video_driver_name(i)); + } + + OS::get_singleton()->print(".\n"); + + goto error; + } + N = I->next()->next(); } else { OS::get_singleton()->print("Missing video driver argument, aborting.\n"); @@ -930,10 +982,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph video_mode.height = GLOBAL_GET("display/window/size/height"); if (globals->has_setting("display/window/size/test_width") && globals->has_setting("display/window/size/test_height")) { + int tw = globals->get("display/window/size/test_width"); - int th = globals->get("display/window/size/test_height"); - if (tw > 0 && th > 0) { + if (tw > 0) { video_mode.width = tw; + } + int th = globals->get("display/window/size/test_height"); + if (th > 0) { video_mode.height = th; } } @@ -989,10 +1044,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } if (video_driver_idx < 0) { - - //OS::get_singleton()->alert("Invalid Video Driver: " + video_driver); video_driver_idx = 0; - //goto error; } if (audio_driver == "") { // specified in project.godot @@ -1009,10 +1061,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } if (audio_driver_idx < 0) { - - OS::get_singleton()->alert("Invalid Audio Driver: " + audio_driver); audio_driver_idx = 0; - //goto error; } { @@ -1299,8 +1348,8 @@ Error Main::setup2(Thread::ID p_main_tid_override) { ClassDB::set_current_api(ClassDB::API_NONE); //no more api is registered at this point - print_verbose("CORE API HASH: " + itos(ClassDB::get_api_hash(ClassDB::API_CORE))); - print_verbose("EDITOR API HASH: " + itos(ClassDB::get_api_hash(ClassDB::API_EDITOR))); + print_verbose("CORE API HASH: " + uitos(ClassDB::get_api_hash(ClassDB::API_CORE))); + print_verbose("EDITOR API HASH: " + uitos(ClassDB::get_api_hash(ClassDB::API_EDITOR))); MAIN_PRINT("Main: Done"); return OK; @@ -1457,12 +1506,11 @@ bool Main::start() { }; if (test != "") { -#ifdef DEBUG_ENABLED +#ifdef TOOLS_ENABLED main_loop = test_main(test, args); if (!main_loop) return false; - #endif } else if (script != "") { @@ -1808,9 +1856,7 @@ bool Main::start() { // Hide console window if requested (Windows-only). bool hide_console = EditorSettings::get_singleton()->get_setting("interface/editor/hide_console_window"); OS::get_singleton()->set_console_visible(!hide_console); - } - if (project_manager || editor) { // Load SSL Certificates from Editor Settings (or builtin) Crypto::load_default_certificates(EditorSettings::get_singleton()->get_setting("network/ssl/editor_ssl_certificates").operator String()); } diff --git a/main/splash.png b/main/splash.png Binary files differindex 32960db65f..7bddd4325a 100644 --- a/main/splash.png +++ b/main/splash.png diff --git a/main/splash_editor.png b/main/splash_editor.png Binary files differindex d8677f1749..2967d8dd3e 100644 --- a/main/splash_editor.png +++ b/main/splash_editor.png |