Ver código fonte

fix corrupted DXT5 textures, fix #22

Ivan Avdeev 6 anos atrás
pai
commit
ad48f45b3e
1 arquivos alterados com 7 adições e 1 exclusões
  1. 7 1
      src/texture.c

+ 7 - 1
src/texture.c

@@ -76,7 +76,6 @@ static int vtfImageSize(enum VTFImageFormat fmt, int width, int height) {
 		case VTFImage_DXT3:
 		case VTFImage_DXT5:
 			pixel_bits = 4;
-			break;
 		case VTFImage_DXT1:
 		case VTFImage_DXT1_A1:
 			pixel_bits += 4;
@@ -158,6 +157,13 @@ static int textureLoad(struct IFile *file, Texture *tex, struct Stack *tmp) {
 		return 0;
 	}
 
+	/*
+	if (!(hdr.version[0] > 7 || hdr.version[1] > 2)) {
+		PRINTF("VTF version %d.%d is not supported", hdr.version[0], hdr.version[1]);
+		return 0;
+	}
+	*/
+
 	//PRINTF("Texture: %dx%d, %s",
 	//	hdr.width, hdr.height, vtfFormatStr(hdr.hires_format));