mirror of
https://github.com/godotengine/godot.git
synced 2024-11-26 14:13:10 +00:00
more fixes
-only refuse to load an older file if version major is different, fixes #1944 -fix drive letter default value, fixes #1939
This commit is contained in:
parent
f220183e40
commit
221443c5a2
@ -861,7 +861,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
|
||||
print_bl("minor: "+itos(ver_minor));
|
||||
print_bl("format: "+itos(ver_format));
|
||||
|
||||
if (ver_format<FORMAT_VERSION || ver_major>VERSION_MAJOR || (ver_major==VERSION_MAJOR && ver_minor>VERSION_MINOR)) {
|
||||
if (ver_format<FORMAT_VERSION || ver_major>VERSION_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_format<FORMAT_VERSION || ver_major>VERSION_MAJOR || (ver_major==VERSION_MAJOR && ver_minor>VERSION_MINOR)) {
|
||||
if (ver_format<FORMAT_VERSION || ver_major>VERSION_MAJOR) {
|
||||
|
||||
f->close();
|
||||
return "";
|
||||
|
@ -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.");
|
||||
|
@ -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<get_drive_count();i++) {
|
||||
String d = get_drive(i).to_lower();
|
||||
if (path.begins_with(d))
|
||||
return i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Error _erase_recursive(DirAccess *da) {
|
||||
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
|
||||
virtual int get_drive_count()=0;
|
||||
virtual String get_drive(int p_drive)=0;
|
||||
virtual int get_current_drive();
|
||||
|
||||
virtual Error change_dir(String p_dir)=0; ///< can be relative or absolute, return false on success
|
||||
virtual String get_current_dir()=0; ///< return current dir location
|
||||
|
@ -4,6 +4,13 @@ name="Kinematic Collision"
|
||||
main_scene="res://colworld.scn"
|
||||
icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
width=800
|
||||
height=600
|
||||
stretch_mode="2d"
|
||||
stretch_aspect="keep"
|
||||
|
||||
[input]
|
||||
|
||||
move_up=[key(Up)]
|
||||
|
@ -6,6 +6,9 @@ main_scene="res://light_shadows.scn"
|
||||
[display]
|
||||
|
||||
stretch_mode="2d"
|
||||
width=800
|
||||
height=600
|
||||
stretch_aspect="keep"
|
||||
|
||||
[rasterizer]
|
||||
|
||||
|
@ -2,3 +2,10 @@
|
||||
|
||||
name="Navigation Polygon (2D)"
|
||||
main_scene="res://navigation.scn"
|
||||
|
||||
[display]
|
||||
|
||||
width=800
|
||||
height=600
|
||||
stretch_mode="2d"
|
||||
stretch_aspect="keep"
|
||||
|
@ -2,3 +2,10 @@
|
||||
|
||||
name="2D Normal Mapping"
|
||||
main_scene="res://normalmap.scn"
|
||||
|
||||
[display]
|
||||
|
||||
stretch_mode="2d"
|
||||
width=800
|
||||
height=600
|
||||
stretch_aspect="ignore"
|
||||
|
@ -3,3 +3,9 @@
|
||||
name="Screen-Space Shaders"
|
||||
main_scene="res://screen_shaders.scn"
|
||||
|
||||
[display]
|
||||
|
||||
width=780
|
||||
height=600
|
||||
stretch_mode="2d"
|
||||
stretch_aspect="keep"
|
||||
|
Binary file not shown.
Binary file not shown.
@ -2,3 +2,10 @@
|
||||
|
||||
name="Glass Bubbles (Texscreen)"
|
||||
main_scene="res://bubbles.scn"
|
||||
|
||||
[display]
|
||||
|
||||
width=800
|
||||
height=600
|
||||
stretch_mode="2d"
|
||||
stretch_aspect="keep"
|
||||
|
@ -608,18 +608,12 @@ void FileDialog::_update_drives() {
|
||||
drives->clear();
|
||||
drives->show();
|
||||
|
||||
int current=-1;
|
||||
String abspath = dir_access->get_current_dir();
|
||||
|
||||
for(int i=0;i<dir_access->get_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());
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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},
|
||||
|
Loading…
Reference in New Issue
Block a user