From 3bdeb6f8a88df45d3fa9d8908204458b39be95ed Mon Sep 17 00:00:00 2001 From: Leon Krause Date: Sat, 12 May 2018 12:50:58 +0200 Subject: Revert "Fix custom resource path look-up per command line" This reverts commit 942f6dfbd66c1d15a45ef6447fd883103d9678a8. --- main/main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 36d27f19ec..c9e1c7a3aa 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -337,7 +337,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph String video_driver = ""; String audio_driver = ""; - String game_path; + String game_path = "."; bool upwards = false; String debug_mode; String debug_host; @@ -693,9 +693,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph I = N; } - if (game_path.empty()) { - game_path = "."; - } if (globals->setup(game_path, main_pack, upwards) == OK) { found_project = true; } else { -- cgit v1.2.3 From 5b4974f171ea1a8467049c85cd0c3c5011e39c18 Mon Sep 17 00:00:00 2001 From: Leon Krause Date: Sat, 12 May 2018 12:51:41 +0200 Subject: Remove dead branch in command line logic --- main/main.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index c9e1c7a3aa..cf1db2b85e 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -672,22 +672,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "--disable-crash-handler") { OS::get_singleton()->disable_crash_handler(); } else { - - //test for game path - bool gpfound = false; - - if (!I->get().begins_with("-") && game_path == "") { - DirAccess *da = DirAccess::open(I->get()); - if (da != NULL) { - game_path = I->get(); - gpfound = true; - memdelete(da); - } - } - - if (!gpfound) { - main_args.push_back(I->get()); - } + main_args.push_back(I->get()); } I = N; -- cgit v1.2.3 From 430d84769c1f18b82448d242d4a2a33e24b2a630 Mon Sep 17 00:00:00 2001 From: Leon Krause Date: Sat, 12 May 2018 13:21:26 +0200 Subject: Change reused variable name in command line parsing --- main/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index cf1db2b85e..5836c9c739 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -337,7 +337,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph String video_driver = ""; String audio_driver = ""; - String game_path = "."; + String project_path = "."; bool upwards = false; String debug_mode; String debug_host; @@ -553,7 +553,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (OS::get_singleton()->set_cwd(p) == OK) { //nothing } else { - game_path = I->next()->get(); //use game_path instead + project_path = I->next()->get(); //use project_path instead } N = I->next()->next(); } else { @@ -576,7 +576,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (OS::get_singleton()->set_cwd(path) == OK) { // path already specified, don't override } else { - game_path = path; + project_path = path; } #ifdef TOOLS_ENABLED editor = true; @@ -678,14 +678,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph I = N; } - if (globals->setup(game_path, main_pack, upwards) == OK) { + if (globals->setup(project_path, main_pack, upwards) == OK) { found_project = true; } else { #ifdef TOOLS_ENABLED editor = false; #else - OS::get_singleton()->print("Error: Could not load game path '%s'.\n", game_path.ascii().get_data()); + OS::get_singleton()->print("Error: Could not load game path '%s'.\n", project_path.ascii().get_data()); goto error; #endif @@ -976,7 +976,7 @@ error: video_driver = ""; audio_driver = ""; - game_path = ""; + project_path = ""; args.clear(); main_args.clear(); -- cgit v1.2.3