Exemplo n.º 1
0
        public static V2DContentHolder UilToV2DContent(string path, ContentProcessorContext context)
        {
            V2DContentHolder result = null;

            VexObject vo = LoadFromUIL.Load(path);
            VexTree   vt = new VexTree();

            vt.Convert(vo, null);
            vt.WriteToXml();

            result = vt.GetV2DContent(context);

            return(result);
        }
Exemplo n.º 2
0
        public static V2DContentHolder SwfToV2DContent(SwfCompilationUnit scu, ContentProcessorContext context)
        {
            V2DContentHolder result = null;

            if (scu.IsValid)
            {
                SwfToVex  s2v = new SwfToVex();
                VexObject vo  = s2v.Convert(scu);
                VexTree   vt  = new VexTree();
                vt.Convert(vo, scu);
                vt.WriteToXml();

                result = vt.GetV2DContent(context);
            }
            return(result);
        }
Exemplo n.º 3
0
        public V2DContentHolder GetV2DContent(ContentProcessorContext context)
        {
            V2DContentHolder result = new V2DContentHolder();

            result.v2dWorld = genV2d.v2dWorld;// V2DWorld.CreateFromXml(genV2d.path);

            //XmlSerializer xs = new XmlSerializer(typeof(V2DWorld));
            //StringWriter sw = new StringWriter();
            //xs.Serialize(sw, result.v2dWorld);

            result.contentTextures.Clear();
            foreach (string s in usedImages.Keys)
            {
                ExternalReference <TextureContent> tr = new ExternalReference <TextureContent>(s);
                Texture2DContent texture = context.BuildAndLoadAsset <TextureContent, Texture2DContent>(tr, null);
                result.contentTextures.Add(Path.GetFileNameWithoutExtension(s), texture);
            }

            return(result);
        }
Exemplo n.º 4
0
        public V2DContentHolder GetV2DContent(ContentProcessorContext context)
        {
            V2DContentHolder result = new V2DContentHolder();
            result.v2dWorld = genV2d.v2dWorld;// V2DWorld.CreateFromXml(genV2d.path);

            //XmlSerializer xs = new XmlSerializer(typeof(V2DWorld));
            //StringWriter sw = new StringWriter();
            //xs.Serialize(sw, result.v2dWorld);

            result.contentTextures.Clear();
            foreach (string s in usedImages.Keys)
            {
                ExternalReference<TextureContent> tr = new ExternalReference<TextureContent>(s);
                Texture2DContent texture = context.BuildAndLoadAsset<TextureContent, Texture2DContent>(tr, null);
                result.contentTextures.Add(Path.GetFileNameWithoutExtension(s), texture);
            }

            return result;
        }