public static TxpFile FromDds(DdsFile[] ddsFiles) { TxpFile texPack = new TxpFile(); texPack.textures = new List <TxpTexture>(); foreach (DdsFile dds in ddsFiles) { if (dds == null) { return(null); } texPack.textures.Add(TxpTexture.FromDds(dds)); } return(texPack); }
public static TxpTexture FromDds(DdsFile dds) { TxpTexture tex = new TxpTexture(); tex.mipCount = dds.mipMapCount; uint counter = 0; TxpMipMap[] mips = new TxpMipMap[tex.mipCount]; foreach (DdsMipMap ddsMip in dds.mipMaps) { Console.Write(ddsMip == null); Console.Write("\n"); TxpMipMap mip = TxpMipMap.FromDds(ddsMip, dds.pixelFormat); mips[counter] = mip; } tex.mipMaps = mips; return(tex); }