예제 #1
0
        public Animation LoadAnimation(DirEntry entry)
        {
            Texture2D texture;
            var       chData = FalcomDecompressor.Decompress(LoadData(entry));

            using (var chStream = new MemoryStream(chData))
            {
                texture = AnimationLoader.LoadImage(GraphicsDevice, chStream);
            }

            ushort?[][,] animationInfo;
            var cpFile = Path.GetFileNameWithoutExtension(entry.Name);

            if (cpFile.EndsWith(" "))
            {
                cpFile = cpFile.Substring(0, cpFile.Length - 1) + "P";
            }
            var cpFileEntry = FindByName(cpFile, "_CP");
            var cpData      = FalcomDecompressor.Decompress(LoadData(cpFileEntry));

            using (var cpStream = new MemoryStream(cpData))
            {
                animationInfo = AnimationLoader.LoadInfo(cpStream);
            }

            return(new Animation(animationInfo, texture));
        }
예제 #2
0
        public Texture2D LoadTexture(DirEntry entry)
        {
            Texture2D texture;

            if (_textures.TryGetValue(entry.Name, out texture))
            {
                return(texture);
            }

            var data = LoadData(entry);

            if (data[0] != 'D' || data[1] != 'D' || data[2] != 'S' || data[3] != ' ')
            {
                // Compressed
                data = FalcomDecompressor.Decompress(data);
            }

            using (var stream = new MemoryStream(data))
            {
                var image = DDS.LoadImage(stream);
                texture = new Texture2D(GraphicsDevice, image.Width, image.Height);
                texture.SetData(image.Data);
            }

            _textures[entry.Name] = texture;

            return(texture);
        }
예제 #3
0
        public Texture2D LoadImage(DirEntry entry)
        {
            var chData = FalcomDecompressor.Decompress(LoadData(entry));

            using (var chStream = new MemoryStream(chData))
            {
                return(ChLoader.LoadImage(GraphicsDevice, entry.DatFilePath, entry.Name, chStream));
            }
        }
예제 #4
0
        public Scenario LoadScenario(DirEntry entry)
        {
            var      data = FalcomDecompressor.Decompress(LoadData(entry));
            Scenario scenario;

            using (var stream = new MemoryStream(data))
            {
                scenario = Scenario.FromFCStream(stream);
            }

            return(scenario);
        }