summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp39
1 files changed, 23 insertions, 16 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 9cd190a0e8..b6bc10cee7 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -796,7 +796,6 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
main_args.clear();
print_help(execpath);
-
if (performance)
memdelete(performance);
@@ -812,6 +811,8 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
memdelete(packed_data);
if (file_access_network_client)
memdelete(file_access_network_client);
+ if(path_remap)
+ memdelete(path_remap);
// Note 1: *zip_packed_data live into *packed_data
// Note 2: PackedData::~PackedData destroy this.
@@ -820,7 +821,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
// memdelete( zip_packed_data );
//#endif
-
+ unregister_core_driver_types();
unregister_core_types();
OS::get_singleton()->_cmdline.clear();
@@ -1007,8 +1008,21 @@ bool Main::start() {
bool export_debug=false;
List<String> args = OS::get_singleton()->get_cmdline_args();
for (int i=0;i<args.size();i++) {
+ //parameters that do not have an argument to the right
+ if (args[i]=="-nodocbase") {
+ doc_base=false;
+ } else if (args[i]=="-noquit") {
+ noquit=true;
+ } else if (args[i]=="-convert_old") {
+ convert_old=true;
+ } else if (args[i]=="-editor" || args[i]=="-e") {
+ editor=true;
+ } else if (args[i].length() && args[i][0] != '-' && game_path == "") {
+ game_path=args[i];
+ }
//parameters that have an argument to the right
- if (i < (args.size()-1)) {
+ else if (i < (args.size()-1)) {
+ bool parsed_pair=true;
if (args[i]=="-doctool") {
doc_tool=args[i+1];
} else if (args[i]=="-script" || args[i]=="-s") {
@@ -1037,20 +1051,13 @@ bool Main::start() {
} else if (args[i]=="-dumpstrings") {
editor=true; //needs editor
dumpstrings=args[i+1];
+ } else {
+ // The parameter does not match anything known, don't skip the next argument
+ parsed_pair=false;
+ }
+ if (parsed_pair) {
+ i++;
}
- i++;
- }
- //parameters that do not have an argument to the right
- if (args[i]=="-nodocbase") {
- doc_base=false;
- } else if (args[i]=="-noquit") {
- noquit=true;
- } else if (args[i]=="-convert_old") {
- convert_old=true;
- } else if (args[i]=="-editor" || args[i]=="-e") {
- editor=true;
- } else if (args[i].length() && args[i][0] != '-' && game_path == "") {
- game_path=args[i];
}
}