Browse Source

Attempting to workaround the problem present in #20904, let me know if it works.

Juan Linietsky 7 năm trước cách đây
mục cha
commit
c627f3a707
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      scene/resources/texture.cpp

+ 5 - 1
scene/resources/texture.cpp

@@ -621,7 +621,11 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
 
 				memdelete(f);
 
-				if (bytes != total_size - ofs) {
+				int expected = total_size - ofs;
+				if (bytes < expected) {
+					//this is a compatibility workaround for older format, which saved less mipmaps. It is still recommended the image is reimported.
+					zeromem(w.ptr() + bytes, (expected - bytes));
+				} else if (bytes != expected) {
 					ERR_FAIL_V(ERR_FILE_CORRUPT);
 				}
 			}