From 221443c5a2d174e52d391d15d5f1c6b5c9496d57 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 19 May 2015 21:36:35 -0300 Subject: [PATCH] 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 ++++++ .../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 3d7d2f2367e..9fb17bcffbb 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 ce648523f0e..3c100d375a0 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 a1031cf5f09..d0baae58728 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;i@rTER_r>QXEEI z+H5i1i&>VdG1{2a%on2%Di0X%lGQanEH#-4iIOd0x24NwcytdM9`ICOyvgt6f6sT$ zxhMJG?~3nRpYz;=szUW?0=OUpd|v}_kvL=qxWxn1e&?LxQXnz`CT4BXM{Un@r~HbO zi^bT**~5I&7f*Nbld*T$Ul5BvPJ8&7)wME6oNvXsgJ<(@dCB11rlrK&%WLcpNE%j; zFu$<46x}z>9_4d`8|T;GTrldA%DTb1xcLN=V9hXxjGA_sbr!khgkf%1PfW5QXFXPg zmBpDg_9DL&Ta9+W)6M|YF~PK$n44K-ZG11d)ddEI(8?c!)AFlYFaJ@Cx4=PqagVepw7z<&O*VX&@F9e-i`oNqNg%ZBiX+j=M#Th^`!=ebWe z9t+<{T(|Z`V^Mhb@)<4B^oF@L@>${6_XCBEdrdpsYtioXZ(QytJR_gQyC|V(2xYv@ z0v%>7cR66~!(sGdzkD<=$uFg+xb)4uMRDXMoT9{6#O=JKY~`ik-MlpRH|4c-oI}is zkk8vg2U@e`@X!y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ou>ao?0P;e$8XjkL=0d}a zgM9}3=2k<vpOI)&`mBoiIV?2k(uJK{TU4S;0^IYM9^6+v+F7Rv_e5LZX--#hE zmn*3P_<7JW;yi0XfK1=3T02>Eq-q^xLn~G5BpXgvt*d0|cXz$}aW|JO=w|V_TOW(1 zcT!mhvRvCgyMf+VE=BEm%7ReIs`v}BG?flpS`OpdRerWiV|j)t(8DCp71-C3zex#H zBcWI!=8bs2OXF%x(v9fPXhoBHJhH;w>zMe%^`pHk9D{radTGtaiD#LN@4$0Rj*LN= zJgN2p0Idv~`Y9+r3MU9ZlVE@dn1fAiIogN>4klp()X=2{nwbpklIOdKNULKsAZV0`k{}?`bV diff --git a/demos/2d/texscreen/bubbles.scn b/demos/2d/texscreen/bubbles.scn index 779cba6930b1fc02626cf82de3661a3934b45732..41026aceed0d264372e05e999c94af67fcbbd51a 100644 GIT binary patch delta 743 zcmWlXOK1~e6ov21KWS`Dp<1;~G4)SuQWamt7iw+q%%n+;E~Hgds^p(0lP22EgiIeA zi)pEE>H|a7DoUh?E?iW_g$fc&W?%V-4s*!lm_vOT?|@b->w(W&ZVS z9b1m21b~W`p$qRa7nf2!4nEPVnu3ALn2U6z5>Zod%EQcQ!fBfxiy3M+OCw}(k3Y_8 zh!NNO%wkz8Vb!?}*p&xtz$d&OGgyWF<^A=A7oIBxtT4HI*NaVIRNMip26rICm3W+w zs<9&)UCo6LvNpc|4OQIeA?cWsVsk90-!hhAKOfV3ncX^9OIVIM(wk8GnyLnWq01}P zNr-Og3l~jzBD@w+*?dbkfLPgdG<%)Q&G;TdioGrLK^a|JGdv@#YQ2e+u60Qlr9)O! zQT&Jtybpx9-l1zXNt0CLZ9b_R$~=>RxjS!3a^|1B`7|%SlP^rTYAF|0Bc}?F(6w+# zPM2%1E{{5wHsmcHpBwkfCqLM>=QqpWn6q}+ z`_&XwS>w~1I`)Y?fA(w>ZV7J8#s!)Qj7)>VrFy(so7&x-&^jiWd>8{bvgpC0NeI{8 z0E3m|gs`lW))@Q7&@2B$|9hynNGqouQzsuom{I?CUr2s$IXC+U?A$y*UK1+=Q@2)3 z3uitacKg8%>k delta 625 zcmWlXT}Tvh6vgk%e|A@Ei>Eo=N3)51d1h)}zKXIeEM3YSPSoLP5gb#k4N*>(Mj zc0`1FN>~D|6hTU&9<+xZOOcSkz(tqICp-r%13CDQml0L`7(it|Y#>QW8rje9~m3sE>S6)eD2^oonO(oBPWJOH-u#=4$DaFGA)F`*4 zcO<2$gVK$$8Wd=pjyfSrOjIkLW%Y=v9Cut6VnAAkAsn5{x6Wcd4BI*RC_$W;gkNBW z>sMZbkH0`GJgT13OhfOZpXnRtsVM%ylV!VHkI`-Dr7vxA0$*jWaRIkclear(); 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 24d5978856c..a0766ff317f 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},