diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/main/main.cpp b/main/main.cpp index 0d9e94346e..5b1782815e 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -57,6 +57,7 @@ #include "tools/editor/editor_node.h" #include "tools/editor/project_manager.h" #include "tools/editor/console.h" +#include "tools/pck/pck_packer.h" #endif #include "io/file_access_network.h" @@ -211,6 +212,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas while (I) { I->get()=unescape_cmdline(I->get().strip_escapes()); +// print_line("CMD: "+I->get()); I=I->next(); } @@ -223,6 +225,8 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas String game_path="."; String debug_mode; String debug_host; + String main_pack; + bool quiet_stdout=false; int rtm=-1; String remotefs; @@ -237,9 +241,9 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas I=args.front(); - packed_data = PackedData::get_singleton(); - if (!packed_data) - packed_data = memnew(PackedData); + packed_data = PackedData::get_singleton(); + if (!packed_data) + packed_data = memnew(PackedData); #ifdef MINIZIP_ENABLED packed_data->add_pack_source(ZipArchive::get_singleton()); @@ -371,6 +375,9 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas } else if (I->get()=="-nowindow") { // fullscreen OS::get_singleton()->set_no_window_mode(true); + } else if (I->get()=="-quiet") { // fullscreen + + quiet_stdout=true; } else if (I->get()=="-v") { // fullscreen OS::get_singleton()->_verbose_stdout=true; } else if (I->get()=="-path") { // resolution @@ -425,6 +432,17 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas goto error; }; + } else if (I->get() == "-main_pack") { + + if (I->next()) { + + main_pack=I->next()->get(); + N = I->next()->next(); + } else { + + goto error; + }; + } else if (I->get()=="-debug" || I->get()=="-d") { debug_mode="local"; } else if (I->get()=="-editor_scene") { @@ -541,7 +559,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas #endif - if (globals->setup(game_path)!=OK) { + if (globals->setup(game_path,main_pack)!=OK) { #ifdef TOOLS_ENABLED editor=false; @@ -557,6 +575,13 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas use_custom_res=false; } + if (bool(Globals::get_singleton()->get("application/disable_stdout"))) { + quiet_stdout=true; + } + + if (quiet_stdout) + _print_line_enabled=false; + OS::get_singleton()->set_cmdline(execpath, main_args); #ifdef TOOLS_ENABLED @@ -580,12 +605,22 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas if (use_custom_res && globals->has("display/resizable")) video_mode.resizable=globals->get("display/resizable"); + if (!force_res && use_custom_res && globals->has("display/test_width") && globals->has("display/test_height")) { + int tw = globals->get("display/test_width"); + int th = globals->get("display/test_height"); + if (tw>0 && th>0) { + video_mode.width=tw; + video_mode.height=th; + } + } GLOBAL_DEF("display/width",video_mode.width); GLOBAL_DEF("display/height",video_mode.height); GLOBAL_DEF("display/fullscreen",video_mode.fullscreen); GLOBAL_DEF("display/resizable",video_mode.resizable); + GLOBAL_DEF("display/test_width",0); + GLOBAL_DEF("display/test_height",0); if (rtm==-1) { rtm=GLOBAL_DEF("render/thread_model",OS::RENDER_THREAD_SAFE); } @@ -764,6 +799,7 @@ Error Main::setup2() { #ifdef TOOLS_ENABLED EditorNode::register_editor_types(); + ObjectTypeDB::register_type<PCKPacker>(); // todo: move somewhere else #endif MAIN_PRINT("Main: Load Scripts, Modules, Drivers"); |