Explorar el Código

Removed srgb flag, instead -srgb is always passed to texconv

Clement Espeute hace 2 años
padre
commit
b024063945
Se han modificado 1 ficheros con 8 adiciones y 3 borrados
  1. 8 3
      hxd/fs/Convert.hx

+ 8 - 3
hxd/fs/Convert.hx

@@ -303,10 +303,15 @@ class CompressIMG extends Convert {
 			try sys.FileSystem.deleteFile(dstPath) catch( e : Dynamic ) {};
 			sys.io.File.copy(srcPath, tmpFile);
 
-			// convert srgb textures to normal space
-			var srgbParam = hasParam("srgb") && getParam("srgb") ? "-srgb" : "";
+			var args = [
+				"-f",
+				tcFmt,
+				"-y",
+				"-nologo",
+				"-srgb", // Convert srgb to linear color space if target format doesn't support srgb (i.e from convertig from PNG to dds RGBA)
+				tmpFile
+			];
 
-			var args = ["-f", tcFmt, "-y", "-nologo", srgbParam, tmpFile];
 			if( !mips ) args = ["-m", "1"].concat(args);
 			command("texconv", args);
 			sys.FileSystem.deleteFile(tmpFile);