1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Reimport now checks source path changes and imported files and their md5, fixes #14728

This commit is contained in:
Juan Linietsky
2017-12-27 15:21:18 -03:00
parent 5c636875e4
commit 988d29bdd8
3 changed files with 74 additions and 4 deletions

View File

@@ -569,6 +569,37 @@ String FileAccess::get_md5(const String &p_file) {
return ret;
}
String FileAccess::get_multiple_md5(const Vector<String> &p_file) {
MD5_CTX md5;
MD5Init(&md5);
for (int i = 0; i < p_file.size(); i++) {
FileAccess *f = FileAccess::open(p_file[i], READ);
ERR_CONTINUE(!f);
unsigned char step[32768];
while (true) {
int br = f->get_buffer(step, 32768);
if (br > 0) {
MD5Update(&md5, step, br);
}
if (br < 4096)
break;
}
memdelete(f);
}
MD5Final(&md5);
String ret = String::md5(md5.digest);
return ret;
}
String FileAccess::get_sha256(const String &p_file) {
FileAccess *f = FileAccess::open(p_file, READ);