Exemplo n.º 1
0
 public override void Initialize(ContentTypeWriterManager manager)
 {
     manager.RegisterTypeWriter <VertexBufferContent>(new VertexBufferWriter());
     manager.RegisterTypeWriter <IndexCollection>(new IndexBufferWriter());
     // TODO: implement MaterialWriter
     //manager.RegisterTypeWriter<MaterialContent>(new MaterialWriter());
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            log4net.Config.BasicConfigurator.Configure(new log4net.Appender.DebugAppender());

            _opaqueData["TextureType"] = TextureType.Texture2D;
            if (!ParseCommandLine(args))
            {
                return;
            }

            if (string.IsNullOrEmpty(_outputName))
            {
                _outputName = string.Format("{0}.meb", Path.GetFileNameWithoutExtension(_imageName));
            }



            //GetTypeWriters();
            ProcessAssemblies();

            string ext = Path.GetExtension(_imageName).ToLower();
            var    imp = _importers.FirstOrDefault(i => i.attribue.FileExtensions.Contains(ext));

            if (imp.type == null)
            {
                Console.WriteLine("file format is not handled by TextureImporter.");
                return;
            }

            ContentManager           manager = new ContentManager(_log);
            ContentTypeWriterManager contentTypeWriterManager = new ContentTypeWriterManager();

            contentTypeWriterManager.RegisterTypeWriter <Texture2DContent>(new Texture2DWriter());

            IContentImporter importer = CreateImporter(imp.type, _opaqueData);

            var content = importer.Import(_imageName, manager);

            IContentProcessor processor = CreateProcessor(FindDefaultProcessor(importer.GetType()), _opaqueData);

            object processedContent = processor.Process(content, new ContentProcessorContext());

            ContentTypeWriter typeWriter = GetTypeWriter(processedContent.GetType());

            using (FileStream stream = new FileStream(_outputName, FileMode.OpenOrCreate))
            {
                ContentWriter writer = manager.CreateWriter(contentTypeWriterManager, stream);
                writer.WriteObject(processedContent, typeWriter);
                writer.Flush();
            }
        }
Exemplo n.º 3
0
 public override void Initialize(ContentTypeWriterManager manager)
 {
     manager.RegisterTypeWriter <Matrix4>(new MatrixWriter());
     manager.RegisterTypeWriter <VertexBufferContent>(new VertexBufferWriter());
     manager.RegisterTypeWriter <IndexCollection>(new IndexBufferWriter());
     manager.RegisterTypeWriter <Minotaur.Core.BoundingSphere>(new BoundingSphereWriter());
     manager.RegisterTypeWriter <MaterialContent>(new MaterialWriter());
     manager.RegisterTypeWriter <BoneAnimationsContent>(new BoneAnimationWriter());
 }
Exemplo n.º 4
0
 public override void Initialize(ContentTypeWriterManager manager)
 {
     manager.RegisterTypeWriter <VertexAttribute>(new VertexAttributeWriter());
 }
Exemplo n.º 5
0
 public override void Initialize(ContentTypeWriterManager manager)
 {
     manager.RegisterTypeWriter <Vector3>(new Vector3Writer());
 }
Exemplo n.º 6
0
 public override void Initialize(ContentTypeWriterManager manager)
 {
     manager.RegisterTypeWriter <Quaternion>(new QuaternionWriter());
 }
Exemplo n.º 7
0
 public override void Initialize(ContentTypeWriterManager manager)
 {
     manager.RegisterTypeWriter <Minotaur.Core.BoundingSphere>(new BoundingSphereWriter());
     //manager.RegisterTypeWriter<ModelMeshPartContent>(new ModelMeshPartWriter());
 }
Exemplo n.º 8
0
 public override void Initialize(ContentTypeWriterManager manager)
 {
     manager.RegisterTypeWriter <VectorKey>(new VectorKeyWriter());
     manager.RegisterTypeWriter <QuaternionKey>(new QuaternionKeyWriter());
 }
Exemplo n.º 9
0
 public override void Initialize(ContentTypeWriterManager manager)
 {
     manager.RegisterTypeWriter <ShaderSourceContent>(new ShaderSourceWriter());
     manager.RegisterTypeWriter <UniformValueContent>(new UniformValueWriter());
     manager.RegisterTypeWriter <Color4>(new ColorWriter());
 }
Exemplo n.º 10
0
 public override void Initialize(ContentTypeWriterManager manager)
 {
     manager.RegisterTypeWriter <Texture2DContent>(new Texture2DWriter());
 }