From 221443c5a2d174e52d391d15d5f1c6b5c9496d57 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 19 May 2015 21:36:35 -0300 Subject: more fixes -only refuse to load an older file if version major is different, fixes #1944 -fix drive letter default value, fixes #1939 --- core/io/resource_format_binary.cpp | 4 ++-- core/io/resource_format_xml.cpp | 2 +- core/os/dir_access.cpp | 11 +++++++++++ core/os/dir_access.h | 1 + demos/2d/kinematic_char/engine.cfg | 7 +++++++ demos/2d/lights_shadows/engine.cfg | 3 +++ demos/2d/navpoly/engine.cfg | 7 +++++++ demos/2d/normalmaps/engine.cfg | 7 +++++++ demos/2d/screen_space_shaders/engine.cfg | 6 ++++++ demos/2d/screen_space_shaders/screen_shaders.scn | Bin 5896 -> 5936 bytes demos/2d/texscreen/bubbles.scn | Bin 1456 -> 1551 bytes demos/2d/texscreen/engine.cfg | 7 +++++++ scene/gui/file_dialog.cpp | 10 ++-------- scene/resources/shader_graph.cpp | 2 +- 14 files changed, 55 insertions(+), 12 deletions(-) diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 3d7d2f2367..9fb17bcffb 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -861,7 +861,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { print_bl("minor: "+itos(ver_minor)); print_bl("format: "+itos(ver_format)); - if (ver_formatVERSION_MAJOR || (ver_major==VERSION_MAJOR && ver_minor>VERSION_MINOR)) { + if (ver_formatVERSION_MAJOR) { f->close(); ERR_EXPLAIN("File Format '"+itos(FORMAT_VERSION)+"."+itos(ver_major)+"."+itos(ver_minor)+"' is too new! Please upgrade to a a new engine version: "+local_path); @@ -968,7 +968,7 @@ String ResourceInteractiveLoaderBinary::recognize(FileAccess *p_f) { uint32_t ver_minor=f->get_32(); uint32_t ver_format=f->get_32(); - if (ver_formatVERSION_MAJOR || (ver_major==VERSION_MAJOR && ver_minor>VERSION_MINOR)) { + if (ver_formatVERSION_MAJOR) { f->close(); return ""; diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp index ce648523f0..3c100d375a 100644 --- a/core/io/resource_format_xml.cpp +++ b/core/io/resource_format_xml.cpp @@ -1671,7 +1671,7 @@ void ResourceInteractiveLoaderXML::open(FileAccess *p_f) { int major = version.get_slice(".",0).to_int(); int minor = version.get_slice(".",1).to_int(); - if (major>VERSION_MAJOR || (major==VERSION_MAJOR && minor>VERSION_MINOR)) { + if (major>VERSION_MAJOR) { error=ERR_FILE_UNRECOGNIZED; ResourceLoader::notify_load_error(local_path+": File Format '"+version+"' is too new. Please upgrade to a newer engine version."); diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index a1031cf5f0..d0baae5872 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -56,6 +56,17 @@ String DirAccess::_get_root_string() const { return ""; } +int DirAccess::get_current_drive() { + + String path = get_current_dir().to_lower(); + for(int i=0;iclear(); drives->show(); - int current=-1; - String abspath = dir_access->get_current_dir(); - for(int i=0;iget_drive_count();i++) { - String d = dir_access->get_drive(i); - if (abspath.begins_with(d)) - current=i; + String d = dir_access->get_drive(i); drives->add_item(dir_access->get_drive(i)); } - if (current!=-1) - drives->select(current); + drives->select(dir_access->get_current_drive()); } } diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 24d5978856..a0766ff317 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -1301,7 +1301,7 @@ const ShaderGraph::InOutParamInfo ShaderGraph::inout_param_info[]={ {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,"Diffuse","DIFFUSE_OUT","",SLOT_TYPE_VEC,SLOT_OUT}, {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,"DiffuseAlpha","ALPHA_OUT","",SLOT_TYPE_SCALAR,SLOT_OUT}, {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,"Specular","SPECULAR","",SLOT_TYPE_VEC,SLOT_OUT}, - {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,"SpecularExp","SPECULAR","",SLOT_TYPE_SCALAR,SLOT_OUT}, + {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,"SpecularExp","SPEC_EXP","",SLOT_TYPE_SCALAR,SLOT_OUT}, {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,"Emission","EMISSION","",SLOT_TYPE_VEC,SLOT_OUT}, {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,"Glow","GLOW","",SLOT_TYPE_SCALAR,SLOT_OUT}, {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,"ShadeParam","SHADE_PARAM","",SLOT_TYPE_SCALAR,SLOT_OUT}, -- cgit v1.2.3