summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/file_access_zip.h2
-rw-r--r--core/io/resource_format_binary.cpp7
-rw-r--r--core/io/resource_importer.cpp3
3 files changed, 8 insertions, 4 deletions
diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h
index 2cce24e878..c251b3c424 100644
--- a/core/io/file_access_zip.h
+++ b/core/io/file_access_zip.h
@@ -79,7 +79,7 @@ public:
};
class FileAccessZip : public FileAccess {
- unzFile zfile;
+ unzFile zfile = nullptr;
unz_file_info64 file_info;
mutable bool at_eof;
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 5097f6d98b..21de7835ce 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -863,7 +863,8 @@ void ResourceLoaderBinary::open(FileAccess *p_f) {
if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) {
f->close();
- ERR_FAIL_MSG("File format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a new engine version: " + local_path + ".");
+ ERR_FAIL_MSG(vformat("File '%s' can't be loaded, as it uses a format version (%d) or engine version (%d.%d) which are not supported by your engine version (%s).",
+ local_path, ver_format, ver_major, ver_minor, VERSION_BRANCH));
}
type = get_unicode_string();
@@ -1136,7 +1137,9 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) {
memdelete(f);
memdelete(fw);
- ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, "File format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a new engine version: " + local_path + ".");
+ ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED,
+ vformat("File '%s' can't be loaded, as it uses a format version (%d) or engine version (%d.%d) which are not supported by your engine version (%s).",
+ local_path, ver_format, ver_major, ver_minor, VERSION_BRANCH));
}
// Since we're not actually converting the file contents, leave the version
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp
index 9ed159bd20..4d980bcf1a 100644
--- a/core/io/resource_importer.cpp
+++ b/core/io/resource_importer.cpp
@@ -31,6 +31,7 @@
#include "resource_importer.h"
#include "core/os/os.h"
+#include "core/project_settings.h"
#include "core/variant_parser.h"
bool ResourceFormatImporter::SortImporterByName::operator()(const Ref<ResourceImporter> &p_a, const Ref<ResourceImporter> &p_b) const {
@@ -374,7 +375,7 @@ Ref<ResourceImporter> ResourceFormatImporter::get_importer_by_extension(const St
}
String ResourceFormatImporter::get_import_base_path(const String &p_for_file) const {
- return "res://.import/" + p_for_file.get_file() + "-" + p_for_file.md5_text();
+ return ProjectSettings::IMPORTED_FILES_PATH.plus_file(p_for_file.get_file() + "-" + p_for_file.md5_text());
}
bool ResourceFormatImporter::are_import_settings_valid(const String &p_path) const {