Example #1
0
        public static FtexsFileMipMap ReadFtexsFileMipMap(
            Stream inputStream,
            short chunkCount,
            int baseOffset,
            int fileSize)
        {
            FtexsFileMipMap result = new FtexsFileMipMap();

            result.Read(inputStream, chunkCount, baseOffset, fileSize);
            return(result);
        }
Example #2
0
        public void Read(
            Stream inputStream,
            short chunkCount,
            int baseOffset,
            int fileSize)
        {
            FtexsFileMipMap mipMap = FtexsFileMipMap.ReadFtexsFileMipMap(
                inputStream,
                chunkCount,
                baseOffset,
                fileSize);

            AddMipMap(mipMap);
        }
Example #3
0
 public static FtexsFileMipMap ReadFtexsFileMipMap(Stream inputStream, short chunkCount)
 {
     FtexsFileMipMap result = new FtexsFileMipMap();
     result.Read(inputStream, chunkCount);
     return result;
 }
Example #4
0
 public static FtexsFileMipMap ReadFtexsFileMipMap(Stream inputStream, short chunkCount, bool flipEndian = false)
 {
     FtexsFileMipMap result = new FtexsFileMipMap();
     result.Read(inputStream, chunkCount, flipEndian);
     return result;
 }
Example #5
0
 public void AddMipMap(FtexsFileMipMap mipMap)
 {
     _mipMaps.Add(mipMap);
 }
Example #6
0
        private static List<FtexsFile> GetFtexsFiles(List<FtexFileMipMapInfo> mipMapInfos, List<byte[]> mipMapDatas)
        {
            Dictionary<byte, FtexsFile> ftexsFiles = new Dictionary<byte, FtexsFile>();

            foreach (var mipMapInfo in mipMapInfos)
            {
                if (ftexsFiles.ContainsKey(mipMapInfo.FtexsFileNumber) == false)
                {
                    FtexsFile ftexsFile = new FtexsFile
                    {
                        FileNumber = mipMapInfo.FtexsFileNumber
                    };
                    ftexsFiles.Add(mipMapInfo.FtexsFileNumber, ftexsFile);
                }
            }

            for (int i = 0; i < mipMapInfos.Count; i++)
            {
                FtexFileMipMapInfo mipMapInfo = mipMapInfos[i];
                FtexsFile ftexsFile = ftexsFiles[mipMapInfo.FtexsFileNumber];
                byte[] mipMapData = mipMapDatas[i];
                FtexsFileMipMap ftexsFileMipMap = new FtexsFileMipMap();
                List<FtexsFileChunk> chunks = GetFtexsChunks(mipMapInfo, mipMapData);
                ftexsFileMipMap.AddChunks(chunks);
                ftexsFile.AddMipMap(ftexsFileMipMap);
            }
            return ftexsFiles.Values.ToList();
        }
Example #7
0
 public void AddMipMap(FtexsFileMipMap mipMap)
 {
     _mipMaps.Add(mipMap);
 }