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); }
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); } }
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) { }
public SteamRollerScreen(V2DContent v2dContent) : base(v2dContent) { }
public AllTrainScreen(V2DContent v2dContent) : base(v2dContent) { }
public TwoCanalTwoBoulevardScreen(V2DContent v2dContent) : base(v2dContent) { }
public BaseScreen(V2DContent v2dContent) : base(v2dContent) { }
public SplashScreen(V2DContent v2dContent) : base(v2dContent) { }
public TwoCanalTwoTrainScreen(V2DContent v2dContent) : base(v2dContent) { }
public GearJointDemo(V2DContent v2dContent) : base(v2dContent) { }
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) { }
public Scene2Data(V2DContent v2dContent) : base(v2dContent) { }
public DistanceJointDemo(V2DContent v2dContent) : base(v2dContent) { }
public LaneChangeScreen(V2DContent v2dContent) : base(v2dContent) { }
public HudScreen(V2DContent v2dContent) : base(v2dContent) { }
public TitleScreen(V2DContent v2dContent) : base(v2dContent) { }
public CrosswalkScreen(V2DContent v2dContent) : base(v2dContent) { }
public SpaceMediumScreen(V2DContent v2dContent) : base(v2dContent) { }
public RevoluteJointDemo(V2DContent v2dContent) : base(v2dContent) { }
public SpinnerDemo(V2DContent v2dContent) : base(v2dContent) { }
public HousesScreen(V2DContent v2dContent) : base(v2dContent) { }
public PulleyJointDemo(V2DContent v2dContent) : base(v2dContent) { }
public AllCarsScreen(V2DContent v2dContent) : base(v2dContent) { }
public WideBoulevardScreen(V2DContent v2dContent) : base(v2dContent) { }
public GameOverlay(V2DContent v2dContent) : base(v2dContent) { isPersistantScreen = true; }
public Screen(V2DContent v2dContent) { this.v2dWorld = v2dContent.v2dWorld; this.textures = v2dContent.textures; SetAttributes(); }
public TwoCanalScreen(V2DContent v2dContent) : base(v2dContent) { }