예제 #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);
        }
예제 #2
0
        public void Read(
            Stream inputStream,
            short chunkCount,
            int baseOffset,
            int fileSize)
        {
            FtexsFileMipMap mipMap = FtexsFileMipMap.ReadFtexsFileMipMap(
                inputStream,
                chunkCount,
                baseOffset,
                fileSize);

            AddMipMap(mipMap);
        }
예제 #3
0
 public static FtexsFileMipMap ReadFtexsFileMipMap(Stream inputStream, short chunkCount)
 {
     FtexsFileMipMap result = new FtexsFileMipMap();
     result.Read(inputStream, chunkCount);
     return result;
 }
예제 #4
0
 public static FtexsFileMipMap ReadFtexsFileMipMap(Stream inputStream, short chunkCount, bool flipEndian = false)
 {
     FtexsFileMipMap result = new FtexsFileMipMap();
     result.Read(inputStream, chunkCount, flipEndian);
     return result;
 }
예제 #5
0
 public void AddMipMap(FtexsFileMipMap mipMap)
 {
     _mipMaps.Add(mipMap);
 }
예제 #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();
        }
예제 #7
0
 public void AddMipMap(FtexsFileMipMap mipMap)
 {
     _mipMaps.Add(mipMap);
 }