浏览代码

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

Clement Espeute 2 年之前
父节点
当前提交
b024063945
共有 1 个文件被更改,包括 8 次插入3 次删除
  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);