Ejemplo n.º 1
0
        public object Load(AssetManager assets, VFS.VFSHandle handle, object parameters)
        {
            var filename = handle.FileName;

            using (var stream = handle.Open())
            {
                Palette palette;
                // Read a CPS as binary (for palette.cps).
                if (filename.EndsWith(".CPS"))
                {
                    return(new BinFile(CpsFile.ReadAsBytes(stream, out palette)));
                }
                else
                {
                    return(new BinFile(stream));
                }
            }
        }
Ejemplo n.º 2
0
        public object Load(AssetManager assets, VFS.VFSHandle handle, object parameters)
        {
            string filename = handle.FileName;

            using (var stream = handle.Open())
                if (filename.EndsWith(".CPS"))
                {
                    return(CpsFile.Read(stream));
                }
                else if (filename.EndsWith(".PCX"))
                {
                    return(PcxFile.Read(stream));
                }
                else
                {
                    return(ShpFile.Read(stream));
                }
        }