- Fixing bug where loadrecentangleitem wouldn't be called by Gleed2D library

This commit is contained in:
Nathan Adams 2012-05-19 16:19:06 -05:00
parent 2ffb70d9fc
commit 859a6c3c9d
2 changed files with 8 additions and 4 deletions

View File

@ -87,6 +87,8 @@
* - Adding cut extension - [Author: BJD]
* - Adding support for custom handling of Gleed2D items
* - Changing location of GetTexture to extensions
* - Enabling commented log messages
* - Fixing bug where loadrecentangleitem wouldn't be called by Gleed2D library
*
*/
#endregion

View File

@ -27,10 +27,12 @@ namespace Axios.Engine.Gleed2D
public override void load(AxiosGameScreen gameScreen, ref Dictionary<string, Texture2D> cache)
{
base.load(gameScreen, ref cache);
_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;
if (gameScreen.LoadRectangleItem(this))
{
_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;
}
}
}
}