Beispiel #1
0
        public override V2DContentHolder Process(string fileName, ContentProcessorContext context)
        {
            //System.Diagnostics.Debugger.Launch();
            V2DContent       result = null;
            V2DContentHolder vch    = null;

            //System.Diagnostics.Debugger.Launch();

            if (File.Exists(fileName))
            {
                fileName = Path.GetFullPath(fileName);
                Directory.SetCurrentDirectory(Path.GetDirectoryName(fileName));
                FileStream   fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
                BinaryReader br = new BinaryReader(fs);

                string             name = Path.GetFileNameWithoutExtension(fileName);
                SwfReader          r    = new SwfReader(br.ReadBytes((int)fs.Length));
                SwfCompilationUnit scu  = new SwfCompilationUnit(r, name);
                if (scu.IsValid)
                {
                    vch = DDW.VexTo2DPhysics.V2D.SwfToV2DContent(scu, context);
                }
            }

            if (vch == null)
            {
                throw new InvalidContentException("invalid swf content");
            }
            result = new V2DContent();
            return(vch);
        }
Beispiel #2
0
 private void EnsureV2DWorld()
 {
     if (SymbolImport != null && v2dWorld == null)
     {
         // ** note: unnamed elements may actually fall out of scope and get gc/disposed, so need a ref
         // todo: use multiple content loaders per screen and unload where needed.
         //V2DContent content = V2DGame.instance.Content.Load<V2DContent>(SymbolImport.assetName);
         content  = V2DGame.instance.Content.Load <V2DContent>(SymbolImport.assetName);
         v2dWorld = content.v2dWorld;
         textures = content.textures;
         v2dWorld.RootInstance.Definition = v2dWorld.GetDefinitionByName(V2DGame.ROOT_NAME);
     }
 }
Beispiel #3
0
        public V2DContent GetV2DContent(ContentProcessorContext context)
        {
            V2DContent result = new V2DContent();

            result.v2dWorld = v2dWorld;

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

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

            return(result);
        }
 public StartScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }
 public Level1Screen(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #6
0
 public SteamRollerScreen(V2DContent v2dContent)  : base(v2dContent)
 {
 }
 public AllTrainScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #8
0
 public TwoCanalTwoBoulevardScreen(V2DContent v2dContent)  : base(v2dContent)
 {
 }
 public BaseScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #10
0
 public SplashScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }
 public TwoCanalTwoTrainScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #12
0
 public GearJointDemo(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #13
0
 public TwoLaneScreen(V2DContent v2dContent)  : base(v2dContent)
 {
 }
        //[V2DSpriteAttribute(isStatic = true, categoryBits = Category.WATER, maskBits = Category.PLAYER, isSensor = true)]
        //protected V2DSprite[] water;
        //[V2DSpriteAttribute(isStatic = true, categoryBits = Category.WATER, maskBits = Category.PLAYER)]
        //protected V2DSprite[] bridgeRail;

        //[SpriteAttribute(depthGroup = 14)]
        //protected Sprite[] bridge;

        public AllWaterScreen(V2DContent v2dContent) : base(v2dContent)
        {
        }
Beispiel #15
0
 public Scene2Data(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #16
0
 public DistanceJointDemo(V2DContent v2dContent)  : base(v2dContent)
 {
 }
Beispiel #17
0
 public LaneChangeScreen(V2DContent v2dContent)  : base(v2dContent)
 {
 }
 public HudScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #19
0
 public TitleScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #20
0
 public CrosswalkScreen(V2DContent v2dContent)  : base(v2dContent)
 {
 }
 public SpaceMediumScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #22
0
 public RevoluteJointDemo(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #23
0
 public SpinnerDemo(V2DContent v2dContent) : base(v2dContent)
 {
 }
 public HousesScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #25
0
 public PulleyJointDemo(V2DContent v2dContent) : base(v2dContent)
 {
 }
Beispiel #26
0
 public AllCarsScreen(V2DContent v2dContent)  : base(v2dContent)
 {
 }
 public WideBoulevardScreen(V2DContent v2dContent)  : base(v2dContent)
 {
 }
Beispiel #28
0
 public GameOverlay(V2DContent v2dContent) : base(v2dContent)
 {
     isPersistantScreen = true;
 }
Beispiel #29
0
 public Screen(V2DContent v2dContent)
 {
     this.v2dWorld = v2dContent.v2dWorld;
     this.textures = v2dContent.textures;
     SetAttributes();
 }
Beispiel #30
0
 public TwoCanalScreen(V2DContent v2dContent) : base(v2dContent)
 {
 }