diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 56 |
1 files changed, 41 insertions, 15 deletions
diff --git a/main/main.cpp b/main/main.cpp index fe07ba484d..bb601198db 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -58,6 +58,7 @@ #ifdef TOOLS_ENABLED #include "editor/doc/doc_data.h" +#include "editor/doc/doc_data_class_path.gen.h" #include "editor/editor_node.h" #include "editor/project_manager.h" #endif @@ -177,7 +178,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" -w, --windowed Request windowed mode.\n"); OS::get_singleton()->print(" --resolution <W>x<H> Request window resolution.\n"); OS::get_singleton()->print(" --position <X>,<Y> Request window position.\n"); - OS::get_singleton()->print(" --low-dpi Force low-DPI mode (macOS only).\n"); + OS::get_singleton()->print(" --low-dpi Force low-DPI mode (macOS and Windows only).\n"); OS::get_singleton()->print(" --no-window Disable window creation (Windows only). Useful together with --script.\n"); OS::get_singleton()->print("\n"); @@ -193,6 +194,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --frame-delay <ms> Simulate high CPU load (delay each frame by <ms> milliseconds).\n"); OS::get_singleton()->print(" --time-scale <scale> Force time scale (higher values are faster, 1.0 is normal speed).\n"); OS::get_singleton()->print(" --disable-render-loop Disable render loop so rendering only occurs when called explicitly from script.\n"); + OS::get_singleton()->print(" --disable-crash-handler Disable crash handler when supported by the platform code.\n"); OS::get_singleton()->print(" --fixed-fps <fps> Forces a fixed ratio between process and fixed_process timing, for use when precision is required, or when rendering to video files. Setting this will disable real-time syncronization, so that run speed is only capped by performance\n"); OS::get_singleton()->print("\n"); @@ -246,6 +248,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph performance = memnew(Performance); globals->add_singleton(ProjectSettings::Singleton("Performance", performance)); + GLOBAL_DEF("debug/settings/backtrace/message", String("Please include this when reporting the bug on https://github.com/godotengine/godot/issues")); + MAIN_PRINT("Main: Parse CMDLine"); /* argument parsing and main creation */ @@ -581,6 +585,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->print("Missing fixed-fps argument, aborting.\n"); goto error; } + } else if (I->get() == "--disable-crash-handler") { + OS::get_singleton()->disable_crash_handler(); } else { //test for game path @@ -1143,26 +1149,46 @@ bool Main::start() { #ifdef TOOLS_ENABLED if (doc_tool != "") { + { + DirAccessRef da = DirAccess::open(doc_tool); + if (!da) { + ERR_EXPLAIN("Argument supplied to --doctool must be a base godot build directory"); + ERR_FAIL_V(false); + } + } DocData doc; doc.generate(doc_base); DocData docsrc; - if (docsrc.load(doc_tool) == OK) { - print_line("Doc exists. Merging.."); - doc.merge_from(docsrc); - } else { - print_line("No Doc exists. Generating empty."); + Map<String, String> doc_data_classes; + Set<String> checked_paths; + print_line("Loading docs.."); + + for (int i = 0; i < _doc_data_class_path_count; i++) { + String path = doc_tool.plus_file(_doc_data_class_paths[i].path); + String name = _doc_data_class_paths[i].name; + doc_data_classes[name] = path; + if (!checked_paths.has(path)) { + checked_paths.insert(path); + docsrc.load_classes(path); + print_line("Loading docs from: " + path); + } } - for (List<String>::Element *E = removal_docs.front(); E; E = E->next()) { - DocData rmdoc; - if (rmdoc.load(E->get()) == OK) { - print_line(String("Removing classes in ") + E->get()); - doc.remove_from(rmdoc); - } + String index_path = doc_tool.plus_file("doc/classes"); + docsrc.load_classes(index_path); + checked_paths.insert(index_path); + print_line("Loading docs from: " + index_path); + + print_line("Merging docs.."); + doc.merge_from(docsrc); + for (Set<String>::Element *E = checked_paths.front(); E; E = E->next()) { + print_line("Erasing old docs at: " + E->get()); + DocData::erase_classes(E->get()); } - doc.save(doc_tool); + print_line("Generating new docs.."); + doc.save_classes(index_path, doc_data_classes); return false; } @@ -1325,7 +1351,6 @@ bool Main::start() { int shadow_atlas_q2_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_2_subdiv"); int shadow_atlas_q3_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_3_subdiv"); - sml->get_root()->set_shadow_atlas_size(shadow_atlas_size); sml->get_root()->set_shadow_atlas_quadrant_subdiv(0, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q0_subdiv)); sml->get_root()->set_shadow_atlas_quadrant_subdiv(1, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q1_subdiv)); @@ -1347,7 +1372,6 @@ bool Main::start() { sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true)); sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true)); GLOBAL_DEF("gui/common/snap_controls_to_pixels", true); - } String local_game_path; @@ -1389,6 +1413,8 @@ bool Main::start() { if (editor) { Error serr = editor_node->load_scene(local_game_path); + if (serr != OK) + ERR_PRINT("Failed to load scene"); OS::get_singleton()->set_context(OS::CONTEXT_EDITOR); } #endif |