Skip to content

Commit

Permalink
Renamed engine.cfg to godot.cfg, to forcefully break compatibility wi…
Browse files Browse the repository at this point in the history
…th 2.x
  • Loading branch information
reduz committed Feb 4, 2017
1 parent 331a4d8 commit 102b5fc
Show file tree
Hide file tree
Showing 41 changed files with 271 additions and 271 deletions.
28 changes: 14 additions & 14 deletions core/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) {
bool ok = _load_resource_pack(p_main_pack);
ERR_FAIL_COND_V(!ok,ERR_CANT_OPEN);

if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) {

_load_settings("res://override.cfg");

Expand All @@ -275,7 +275,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) {
memdelete(d);

}
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) {

_load_settings("res://override.cfg");

Expand All @@ -291,7 +291,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) {

if (FileAccessNetworkClient::get_singleton()) {

if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) {

_load_settings("res://override.cfg");

Expand All @@ -311,9 +311,9 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) {
if (!_load_resource_pack("res://data.pck"))
_load_resource_pack("res://data.zip");
// make sure this is load from the resource path
print_line("exists engine cfg? "+itos(FileAccess::exists("/engine.cfg")));
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
print_line("loaded engine.cfg");
print_line("exists engine cfg? "+itos(FileAccess::exists("/godot.cfg")));
if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) {
print_line("loaded godot.cfg");
_load_settings("res://override.cfg");

}
Expand Down Expand Up @@ -341,7 +341,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) {

//tries to open pack, but only first time
if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".zip") )) {
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) {

_load_settings("res://override.cfg");
found=true;
Expand All @@ -350,15 +350,15 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) {
}
break;
} else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.zip") )) {
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.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) {
} else if (_load_settings(current_dir+"/godot.cfg")==OK || _load_settings_binary(current_dir+"/godot.cfb")==OK) {

_load_settings(current_dir+"/override.cfg");
candidate=current_dir;
Expand Down Expand Up @@ -416,7 +416,7 @@ Error GlobalConfig::_load_settings_binary(const String p_path) {
if (hdr[0]!='E'|| hdr[1]!='C' || hdr[2]!='F' || hdr[3]!='G') {

memdelete(f);
ERR_EXPLAIN("Corrupted header in binary engine.cfb (not ECFG)");
ERR_EXPLAIN("Corrupted header in binary godot.cfb (not ECFG)");
ERR_FAIL_V(ERR_FILE_CORRUPT;)
}

Expand Down Expand Up @@ -526,7 +526,7 @@ void GlobalConfig::clear(const String& p_name) {

Error GlobalConfig::save() {

return save_custom(get_resource_path()+"/engine.cfg");
return save_custom(get_resource_path()+"/godot.cfg");
}

Error GlobalConfig::_save_settings_binary(const String& p_file,const Map<String,List<String> > &props,const CustomMap& p_custom) {
Expand All @@ -536,7 +536,7 @@ Error GlobalConfig::_save_settings_binary(const String& p_file,const Map<String,
FileAccess *file = FileAccess::open(p_file,FileAccess::WRITE,&err);
if (err!=OK) {

ERR_EXPLAIN("Coudln't save engine.cfb at "+p_file);
ERR_EXPLAIN("Coudln't save godot.cfb at "+p_file);
ERR_FAIL_COND_V(err,err)
}

Expand Down Expand Up @@ -604,7 +604,7 @@ Error GlobalConfig::_save_settings_text(const String& p_file,const Map<String,Li
FileAccess *file = FileAccess::open(p_file,FileAccess::WRITE,&err);

if (err) {
ERR_EXPLAIN("Coudln't save engine.cfg - "+p_file);
ERR_EXPLAIN("Coudln't save godot.cfg - "+p_file);
ERR_FAIL_COND_V(err,err)
}

Expand Down Expand Up @@ -734,7 +734,7 @@ Error GlobalConfig::save_custom(const String& p_path,const CustomMap& p_custom,c
Error err = file->open(dst_file,FileAccess::WRITE);
if (err) {
memdelete(file);
ERR_EXPLAIN("Coudln't save engine.cfg");
ERR_EXPLAIN("Coudln't save godot.cfg");
ERR_FAIL_COND_V(err,err)
}

Expand Down
18 changes: 9 additions & 9 deletions core/variant_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ Error VariantParser::_parse_enginecfg(Stream *p_stream, Vector<String>& strings,
Token token;
get_token(p_stream,token,line,r_err_str);
if (token.type!=TK_PARENTHESIS_OPEN) {
r_err_str="Expected '(' in old-style engine.cfg construct";
r_err_str="Expected '(' in old-style godot.cfg construct";
return ERR_PARSE_ERROR;
}

Expand All @@ -442,7 +442,7 @@ Error VariantParser::_parse_enginecfg(Stream *p_stream, Vector<String>& strings,
CharType c=p_stream->get_char();

if (p_stream->is_eof()) {
r_err_str="Unexpected EOF while parsing old-style engine.cfg construct";
r_err_str="Unexpected EOF while parsing old-style godot.cfg construct";
return ERR_PARSE_ERROR;
}

Expand Down Expand Up @@ -1328,7 +1328,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
value=arr;

return OK;
} else if (id=="key") { // compatibility with engine.cfg
} else if (id=="key") { // compatibility with godot.cfg

Vector<String> params;
Error err = _parse_enginecfg(p_stream,params,line,r_err_str);
Expand Down Expand Up @@ -1364,7 +1364,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
value=ie;
return OK;

} else if (id=="mbutton") { // compatibility with engine.cfg
} else if (id=="mbutton") { // compatibility with godot.cfg

Vector<String> params;
Error err = _parse_enginecfg(p_stream,params,line,r_err_str);
Expand All @@ -1379,7 +1379,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in

value=ie;
return OK;
} else if (id=="jbutton") { // compatibility with engine.cfg
} else if (id=="jbutton") { // compatibility with godot.cfg

Vector<String> params;
Error err = _parse_enginecfg(p_stream,params,line,r_err_str);
Expand All @@ -1394,7 +1394,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
value=ie;

return OK;
} else if (id=="jaxis") { // compatibility with engine.cfg
} else if (id=="jaxis") { // compatibility with godot.cfg

Vector<String> params;
Error err = _parse_enginecfg(p_stream,params,line,r_err_str);
Expand All @@ -1412,19 +1412,19 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
value= ie;

return OK;
} else if (id=="img") { // compatibility with engine.cfg
} else if (id=="img") { // compatibility with godot.cfg

Token token;
get_token(p_stream,token,line,r_err_str);
if (token.type!=TK_PARENTHESIS_OPEN) {
r_err_str="Expected '(' in old-style engine.cfg construct";
r_err_str="Expected '(' in old-style godot.cfg construct";
return ERR_PARSE_ERROR;
}

while(true) {
CharType c = p_stream->get_char();
if (p_stream->is_eof()) {
r_err_str="Unexpected EOF in old style engine.cfg img()";
r_err_str="Unexpected EOF in old style godot.cfg img()";
return ERR_PARSE_ERROR;
}
if (c==')')
Expand Down
2 changes: 1 addition & 1 deletion doc/base/classes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14300,7 +14300,7 @@
Contains global variables accessible from everywhere.
</brief_description>
<description>
Contains global variables accessible from everywhere. Use the normal [Object] API, such as "Globals.get(variable)", "Globals.set(variable,value)" or "Globals.has(variable)" to access them. Variables stored in engine.cfg are also loaded into globals, making this object very useful for reading custom game configuration options.
Contains global variables accessible from everywhere. Use the normal [Object] API, such as "Globals.get(variable)", "Globals.set(variable,value)" or "Globals.has(variable)" to access them. Variables stored in godot.cfg are also loaded into globals, making this object very useful for reading custom game configuration options.
</description>
<methods>
<method name="add_property_info">
Expand Down
6 changes: 3 additions & 3 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void Main::print_help(const char* p_binary) {
OS::get_singleton()->print(VERSION_FULL_NAME" (c) 2008-2017 Juan Linietsky, Ariel Manzur.\n");
OS::get_singleton()->print("Usage: %s [options] [scene]\n",p_binary);
OS::get_singleton()->print("Options:\n");
OS::get_singleton()->print("\t-path [dir] : Path to a game, containing engine.cfg\n");
OS::get_singleton()->print("\t-path [dir] : Path to a game, containing godot.cfg\n");
#ifdef TOOLS_ENABLED
OS::get_singleton()->print("\t-e,-editor : Bring up the editor instead of running the scene.\n");
#endif
Expand Down Expand Up @@ -707,7 +707,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
else
input_map->load_from_globals(); //keys for game

if (video_driver=="") // specified in engine.cfg
if (video_driver=="") // specified in godot.cfg
video_driver=GLOBAL_DEF("display/driver/name",Variant((const char*)OS::get_singleton()->get_video_driver_name(0)));

if (!force_res && use_custom_res && globals->has("display/window/width"))
Expand Down Expand Up @@ -763,7 +763,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas

/* Determine Video Driver */

if (audio_driver=="") { // specified in engine.cfg
if (audio_driver=="") { // specified in godot.cfg
audio_driver=GLOBAL_DEF("audio/driver",OS::get_singleton()->get_audio_driver_name(0));
}

Expand Down
10 changes: 5 additions & 5 deletions tools/editor/editor_import_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ Vector<StringName> EditorExportPlatform::get_dependencies(bool p_bundles) const

Set<StringName> exported;

if (FileAccess::exists("res://engine.cfg"))
exported.insert("res://engine.cfg");
if (FileAccess::exists("res://godot.cfg"))
exported.insert("res://godot.cfg");

if (EditorImportExport::get_singleton()->get_export_filter()!=EditorImportExport::EXPORT_SELECTED) {

Expand Down Expand Up @@ -987,7 +987,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
}


StringName engine_cfg="res://engine.cfg";
StringName engine_cfg="res://godot.cfg";
StringName boot_splash;
{
String splash=GlobalConfig::get_singleton()->get("application/boot_splash"); //avoid splash from being converted
Expand Down Expand Up @@ -1041,7 +1041,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func

{

//make binary engine.cfg config
//make binary godot.cfg config
Map<String,Variant> custom;


Expand Down Expand Up @@ -1085,7 +1085,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func

}

String remap_file="engine.cfb";
String remap_file="godot.cfb";
String engine_cfb =EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmp"+remap_file;
GlobalConfig::get_singleton()->save_custom(engine_cfb,custom);
Vector<uint8_t> data = FileAccess::get_file_as_array(engine_cfb);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class EditorTranslationImportDialog : public ConfirmationDialog {

add_to_project = memnew( CheckButton);
add_to_project->set_pressed(true);
add_to_project->set_text(TTR("Add to Project (engine.cfg)"));
add_to_project->set_text(TTR("Add to Project (godot.cfg)"));
tcomp->add_child(add_to_project);

file_select = memnew(EditorFileDialog);
Expand Down
6 changes: 3 additions & 3 deletions tools/editor/project_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ void ProjectExportDialog::_export_action(const String& p_file) {

while(true) {

print_line("TESTING: "+location.plus_file("engine.cfg"));
if (FileAccess::exists(location.plus_file("engine.cfg"))) {
print_line("TESTING: "+location.plus_file("godot.cfg"));
if (FileAccess::exists(location.plus_file("godot.cfg"))) {

error->set_text(TTR("Please export outside the project folder!"));
error->popup_centered_minsize();
Expand Down Expand Up @@ -2099,7 +2099,7 @@ Error ProjectExport::export_project(const String& p_preset) {
added_settings["remap/"+platform]=Variant(remaps).operator Array();
}

String engine_cfg_path=d->get_current_dir()+"/engine.cfg";
String engine_cfg_path=d->get_current_dir()+"/godot.cfg";
print_line("enginecfg: "+engine_cfg_path);
GlobalConfig::get_singleton()->save_custom(engine_cfg_path,added_settings);

Expand Down
22 changes: 11 additions & 11 deletions tools/editor/project_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ class NewProjectDialog : public ConfirmationDialog {

if (mode!=MODE_IMPORT) {

if (d->file_exists("engine.cfg")) {
if (d->file_exists("godot.cfg")) {

error->set_text(TTR("Invalid project path, engine.cfg must not exist."));
error->set_text(TTR("Invalid project path, godot.cfg must not exist."));
memdelete(d);
return "";
}

} else {

if (valid_path != "" && !d->file_exists("engine.cfg")) {
if (valid_path != "" && !d->file_exists("godot.cfg")) {

error->set_text(TTR("Invalid project path, engine.cfg must exist."));
error->set_text(TTR("Invalid project path, godot.cfg must exist."));
memdelete(d);
return "";
}
Expand Down Expand Up @@ -137,7 +137,7 @@ class NewProjectDialog : public ConfirmationDialog {

String p = p_path;
if (mode==MODE_IMPORT) {
if (p.ends_with("engine.cfg")) {
if (p.ends_with("godot.cfg")) {

p=p.get_base_dir();
}
Expand All @@ -163,7 +163,7 @@ class NewProjectDialog : public ConfirmationDialog {

fdialog->set_mode(FileDialog::MODE_OPEN_FILE);
fdialog->clear_filters();
fdialog->add_filter("engine.cfg ; " _MKSTR(VERSION_NAME) " Project");
fdialog->add_filter("godot.cfg ; " _MKSTR(VERSION_NAME) " Project");
} else {
fdialog->set_mode(FileDialog::MODE_OPEN_DIR);
}
Expand All @@ -190,9 +190,9 @@ class NewProjectDialog : public ConfirmationDialog {



FileAccess *f = FileAccess::open(dir.plus_file("/engine.cfg"),FileAccess::WRITE);
FileAccess *f = FileAccess::open(dir.plus_file("/godot.cfg"),FileAccess::WRITE);
if (!f) {
error->set_text(TTR("Couldn't create engine.cfg in project path."));
error->set_text(TTR("Couldn't create godot.cfg in project path."));
} else {

f->store_line("; Engine configuration file.");
Expand Down Expand Up @@ -759,7 +759,7 @@ void ProjectManager::_load_recent_projects() {
continue;

String project = _name.get_slice("/",1);
String conf=path.plus_file("engine.cfg");
String conf=path.plus_file("godot.cfg");
bool favorite = (_name.begins_with("favorite_projects/"))?true:false;

uint64_t last_modified = 0;
Expand Down Expand Up @@ -1027,7 +1027,7 @@ void ProjectManager::_scan_dir(DirAccess *da,float pos, float total,List<String>
while(n!=String()) {
if (da->current_is_dir() && !n.begins_with(".")) {
subdirs.push_front(n);
} else if (n=="engine.cfg") {
} else if (n=="godot.cfg") {
r_projects->push_back(da->get_current_dir());
}
n=da->get_next();
Expand Down Expand Up @@ -1151,7 +1151,7 @@ void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) {
dir->list_dir_begin();
String file = dir->get_next();
while(confirm && file!=String()) {
if (!dir->current_is_dir() && file.ends_with("engine.cfg")) {
if (!dir->current_is_dir() && file.ends_with("godot.cfg")) {
confirm = false;
}
file = dir->get_next();
Expand Down
2 changes: 1 addition & 1 deletion tools/editor/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {


singleton=this;
set_title(TTR("Project Settings (engine.cfg)"));
set_title(TTR("Project Settings (godot.cfg)"));
undo_redo=&p_data->get_undo_redo();
data=p_data;

Expand Down
4 changes: 2 additions & 2 deletions tools/scripts/sort-demos.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# When scanning for demos, the project manager sorts them based on their
# timestamp, i.e. last modification date. This can make for a pretty
# messy output, so this script 'touches' each engine.cfg file in reverse
# messy output, so this script 'touches' each godot.cfg file in reverse
# alphabetical order to ensure a nice listing.
#
# It's good practice to run it once before packaging demos on the build
Expand All @@ -17,7 +17,7 @@ if [ -e demos.list ]; then
fi

for dir in 2d 3d gui misc viewport; do
find "demos/$dir" -name "engine.cfg" |sort >> demos.list
find "demos/$dir" -name "godot.cfg" |sort >> demos.list
done
cat demos.list |sort -r > demos_r.list

Expand Down
Loading

0 comments on commit 102b5fc

Please sign in to comment.