Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }