diff -r d25b6764c7e84c1d59615d1118ff836eeb7daa20 -r ca67e2cb450f2b585949c821e9b5a629db07d592 axios/Engine/AxiosGameScreen.cs --- a/axios/Engine/AxiosGameScreen.cs Fri May 18 00:26:32 2012 -0500 +++ b/axios/Engine/AxiosGameScreen.cs Fri May 18 21:15:51 2012 -0500 @@ -394,6 +394,21 @@ //CleanUp(); } + public virtual bool LoadCircleItem(CircleItem circleitem) + { + return true; + } + + public virtual bool LoadRectangleItem(RectangleItem rectangleitem) + { + return true; + } + + public virtual bool LoadPathItem(PathItem pathitem) + { + return true; + } + #if WINDOWS // System.Drawing is NOT avaiable on WP7 or Xbox /* diff -r d25b6764c7e84c1d59615d1118ff836eeb7daa20 -r ca67e2cb450f2b585949c821e9b5a629db07d592 axios/Engine/Gleed2D/CircleItem.cs --- a/axios/Engine/Gleed2D/CircleItem.cs Fri May 18 00:26:32 2012 -0500 +++ b/axios/Engine/Gleed2D/CircleItem.cs Fri May 18 21:15:51 2012 -0500 @@ -23,13 +23,15 @@ { } - public override void load(ContentManager cm, World world, ref Dictionary cache) + public override void load(AxiosGameScreen gameScreen, ref Dictionary cache) { - base.load(cm, world, ref cache); - - _body = BodyFactory.CreateCircle(world, Radius, 1f); - _body.Position = ConvertUnits.ToSimUnits(Position); - _body.UserData = this; + base.load(gameScreen, ref cache); + if (gameScreen.LoadCircleItem(this)) + { + _body = BodyFactory.CreateCircle(gameScreen.World, Radius, 1f); + _body.Position = ConvertUnits.ToSimUnits(Position); + _body.UserData = this; + } } } diff -r d25b6764c7e84c1d59615d1118ff836eeb7daa20 -r ca67e2cb450f2b585949c821e9b5a629db07d592 axios/Engine/Gleed2D/Item.cs --- a/axios/Engine/Gleed2D/Item.cs Fri May 18 00:26:32 2012 -0500 +++ b/axios/Engine/Gleed2D/Item.cs Fri May 18 21:15:51 2012 -0500 @@ -49,8 +49,9 @@ /// Called by Level.FromFile(filename) on each Item after the deserialization process. /// Should be overriden and can be used to load anything needed by the Item (e.g. a texture). /// - public virtual void load(ContentManager cm, World world, ref Dictionary cache) + public virtual void load(AxiosGameScreen gameScreen, ref Dictionary cache) { + } public virtual void draw(SpriteBatch sb) diff -r d25b6764c7e84c1d59615d1118ff836eeb7daa20 -r ca67e2cb450f2b585949c821e9b5a629db07d592 axios/Engine/Gleed2D/Level.cs --- a/axios/Engine/Gleed2D/Level.cs Fri May 18 00:26:32 2012 -0500 +++ b/axios/Engine/Gleed2D/Level.cs Fri May 18 21:15:51 2012 -0500 @@ -54,7 +54,7 @@ _world = world; } - public static Level FromFile(string filename, ContentManager cm, World world) + public static Level FromFile(string filename, AxiosGameScreen gameScreen) { Dictionary cache = new Dictionary(); FileStream stream = System.IO.File.Open(filename, FileMode.Open); @@ -67,14 +67,14 @@ foreach (Item item in layer.Items) { item.CustomProperties.RestoreItemAssociations(level); - item.load(cm, world, ref cache); + item.load(gameScreen, ref cache); } } return level; } - public static Level FromStream(FileStream stream, ContentManager cm, World world) + public static Level FromStream(FileStream stream, AxiosGameScreen gameScreen) { Dictionary cache = new Dictionary(); XmlSerializer serializer = new XmlSerializer(typeof(Level)); @@ -86,7 +86,7 @@ foreach (Item item in layer.Items) { item.CustomProperties.RestoreItemAssociations(level); - item.load(cm, world, ref cache); + item.load(gameScreen, ref cache); } } diff -r d25b6764c7e84c1d59615d1118ff836eeb7daa20 -r ca67e2cb450f2b585949c821e9b5a629db07d592 axios/Engine/Gleed2D/PathItem.cs --- a/axios/Engine/Gleed2D/PathItem.cs Fri May 18 00:26:32 2012 -0500 +++ b/axios/Engine/Gleed2D/PathItem.cs Fri May 18 21:15:51 2012 -0500 @@ -26,17 +26,19 @@ { } - public override void load(ContentManager cm, World world, ref Dictionary cache) + public override void load(AxiosGameScreen gameScreen, ref Dictionary cache) { - base.load(cm, world, ref cache); + base.load(gameScreen, ref cache); + if (gameScreen.LoadPathItem(this)) + { + Vertices v = new Vertices(LocalPoints.Length); + foreach (Vector2 vec in LocalPoints) + v.Add(new Vector2(ConvertUnits.ToSimUnits(vec.X), ConvertUnits.ToSimUnits(vec.Y))); - Vertices v = new Vertices(LocalPoints.Length); - foreach (Vector2 vec in LocalPoints) - v.Add(new Vector2(ConvertUnits.ToSimUnits(vec.X), ConvertUnits.ToSimUnits(vec.Y))); - - _body = BodyFactory.CreateLoopShape(world, v); - _body.Position = ConvertUnits.ToSimUnits(this.Position); - _body.UserData = this; + _body = BodyFactory.CreateLoopShape(gameScreen.World, v); + _body.Position = ConvertUnits.ToSimUnits(this.Position); + _body.UserData = this; + } } } diff -r d25b6764c7e84c1d59615d1118ff836eeb7daa20 -r ca67e2cb450f2b585949c821e9b5a629db07d592 axios/Engine/Gleed2D/RectangleItem.cs --- a/axios/Engine/Gleed2D/RectangleItem.cs Fri May 18 00:26:32 2012 -0500 +++ b/axios/Engine/Gleed2D/RectangleItem.cs Fri May 18 21:15:51 2012 -0500 @@ -24,11 +24,11 @@ { } - public override void load(ContentManager cm, World world, ref Dictionary cache) + public override void load(AxiosGameScreen gameScreen, ref Dictionary cache) { - base.load(cm, world, ref cache); + base.load(gameScreen, ref cache); - _body = BodyFactory.CreateRectangle(world, ConvertUnits.ToSimUnits(Width), ConvertUnits.ToSimUnits(Height), 1f); + _body = BodyFactory.CreateRectangle(gameScreen.World, ConvertUnits.ToSimUnits(Width), ConvertUnits.ToSimUnits(Height), 1f); _body.Position = ConvertUnits.ToSimUnits(Position) + new Vector2(ConvertUnits.ToSimUnits(Width)/2, ConvertUnits.ToSimUnits(Height)/2); _body.UserData = this; } diff -r d25b6764c7e84c1d59615d1118ff836eeb7daa20 -r ca67e2cb450f2b585949c821e9b5a629db07d592 axios/Engine/Gleed2D/TextureItem.cs --- a/axios/Engine/Gleed2D/TextureItem.cs Fri May 18 00:26:32 2012 -0500 +++ b/axios/Engine/Gleed2D/TextureItem.cs Fri May 18 21:15:51 2012 -0500 @@ -77,7 +77,7 @@ /// You must provide your own implementation. However, you can rely on all public fields being /// filled by the level deserialization process. /// - public override void load(ContentManager cm, World world, ref Dictionary cache) + public override void load(AxiosGameScreen gameScreen, ref Dictionary cache) { //throw new NotImplementedException(); @@ -87,7 +87,7 @@ //or by using the Content Pipeline: if (!cache.ContainsKey(asset_name)) { - cache[asset_name] = cm.Load(asset_name); + cache[asset_name] = gameScreen.ScreenManager.Game.Content.Load(asset_name); } this.texture = cache[asset_name]; //this.texture = cm.Load(asset_name);