示例#1
0
        public object Load(AssetManager assets, VFS.VFSHandle handle, object parameters)
        {
            var p = (ShaderParameters)parameters;

            using (var stream = handle.Open())
                return(new Shader(stream, p.type));
        }
示例#2
0
        public object Load(AssetManager assets, VFS.VFSHandle handle, object parameters)
        {
            var shift     = 2;         // ra1 palette colours are stored as 6-bit values.
            var hasShadow = false;
            var cycles    = false;

            byte[] cpsRemap = null;
            if (parameters != null)
            {
                var p = (PaletteParameters)parameters;
                shift     = p.shift;
                hasShadow = p.hasShadow;
                cycles    = p.cycles;
                cpsRemap  = p.cpsRemap;
            }
            using (var stream = handle.Open())
                return(new Palette(stream, shift, hasShadow, cycles, cpsRemap));
        }
示例#3
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));
                }
            }
        }
示例#4
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));
                }
        }
示例#5
0
        public object Load(AssetManager assets, VFS.VFSHandle handle, object parameters)
        {
            var type = AudFileType.Buffered;

            if (parameters != null)
            {
                type = (AudFileType)parameters;
            }
            switch (type)
            {
            case AudFileType.Buffered:
                return(AudFile.ReadToBuffer(handle.Open()));

            case AudFileType.Streamed:
                return(AudFile.ReadToStream(handle.Open()));

            default:
                throw new ArgumentException();
            }
        }
示例#6
0
 public object Load(AssetManager assets, VFS.VFSHandle handle, object parameters)
 {
     using (var stream = handle.Open())
         return(TmpFile.Read(stream));
 }