From 6f718228d4798352cef3c4a55ee10a811e4fa187 Mon Sep 17 00:00:00 2001 From: masoud bh Date: Sun, 15 Nov 2015 01:13:14 +0330 Subject: [PATCH 1/2] Load binaryname.pck if not found data.pck search for binaryname.pck in linux and windows --- core/globals.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/globals.cpp b/core/globals.cpp index ffd4cf5d5e7..a4a5245f0bd 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -332,6 +332,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) { String candidate = d->get_current_dir(); String current_dir = d->get_current_dir(); + String exec_name = OS::get_singleton()->get_executable_path().get_file().basename(); bool found = false; bool first_time=true; @@ -346,6 +347,15 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) { found=true; + } + break; + } else if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".pcz") )) { + if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { + + _load_settings("res://override.cfg"); + found=true; + + } break; } else if (_load_settings(current_dir+"/engine.cfg")==OK || _load_settings_binary(current_dir+"/engine.cfb")==OK) { From 6277fe3078eac6456968ca66d2abecf870d502b0 Mon Sep 17 00:00:00 2001 From: masoud bh Date: Sun, 15 Nov 2015 01:22:53 +0330 Subject: [PATCH 2/2] add priority to load binaryname.pck --- core/globals.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/globals.cpp b/core/globals.cpp index a4a5245f0bd..aee708d0cdd 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -340,7 +340,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) { //try to load settings in ascending through dirs shape! //tries to open pack, but only first time - if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.pcz") )) { + if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".pcz") )) { if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { _load_settings("res://override.cfg"); @@ -349,7 +349,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) { } break; - } else if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".pcz") )) { + } else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.pcz") )) { if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { _load_settings("res://override.cfg");