You've already forked godot
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user