axiosengine 

axiosengine Commit Details


Date:2012-03-19 20:33:25 (12 years 6 months ago)
Author:nathan@daedalus
Branch:master
Commit:4755ff6b871df3d14245cc5427cacbe26626d41b
Parents: 5bdc5db4084be263ae33228fd943f3da2f6749b9
Message:Adding checks for if objects get deleted too fast Fixing post-build event to create combined directory

Changes:

File differences

axios/Axios_WP7.csproj
227227
228228
229229
230
230
231
231232
232233
233234
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
<PropertyGroup>
<PostBuildEvent>copy "$(TargetPath)" ..\..\Combined</PostBuildEvent>
<PostBuildEvent>if not exist "$(TargetPath)" ..\..\Combined mkdir "$(TargetPath)" ..\..\Combined
copy "$(TargetPath)" ..\..\Combined</PostBuildEvent>
</PropertyGroup>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
axios/Axios_Windows.csproj
258258
259259
260260
261
261
262
262263
263264
264265
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
<PropertyGroup>
<PostBuildEvent>copy "$(TargetPath)" ..\..\Combined</PostBuildEvent>
<PostBuildEvent>if not exist "$(TargetPath)" ..\..\Combined mkdir "$(TargetPath)" ..\..\Combined
copy "$(TargetPath)" ..\..\Combined</PostBuildEvent>
</PropertyGroup>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
axios/Axios_Xbox_360.csproj
222222
223223
224224
225
225
226
226227
227228
228229
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
<PropertyGroup>
<PostBuildEvent>copy "$(TargetPath)" ..\..\Combined</PostBuildEvent>
<PostBuildEvent>if not exist "$(TargetPath)" ..\..\Combined mkdir "$(TargetPath)" ..\..\Combined
copy "$(TargetPath)" ..\..\Combined</PostBuildEvent>
</PropertyGroup>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
axios/Engine/AxiosGameScreen.cs
2727
2828
2929
30
3031
3132
3233
......
100101
101102
102103
103
104
105104
106105
106
107
108
107109
108110
109111
......
134136
135137
136138
137
138
139
139140
140
141
141
142
143
144
145
146
147
148
142149
143
150
144151
145
152
153
146154
147155
148156
......
192200
193201
194202
195
203
204
205
206
207
208
209
210
211
212
213
214
196215
197216
198
217
199218
200219
201
220
202221
203222
204223
......
208227
209228
210229
211
230
212231
213232
214233
......
329348
330349
331350
332
351
333352
334353
335
354
336355
337356
338357
public abstract class AxiosGameScreen : PhysicsGameScreen
{
private List<AxiosGameObject> _gameObjects;
private List<AxiosGameObject> _objectstoremove = new List<AxiosGameObject>();
private AxiosGameObject prevobj;
private AxiosGameObject prevfocusobj;
if (obj is AxiosGameObject || obj is AxiosUIObject || obj is AxiosTimer)
{
AxiosGameObject tmp = obj as AxiosGameObject;
tmp.LoadContent(this);
if (obj is AxiosGameObject || obj is AxiosUIObject)
tmp.RemoveObject += new AxiosEvents.AxiosGameObjectHandler(RemoveGameObject);
tmp.LoadContent(this);
if (obj is AxiosGameObject && !(obj is AxiosUIObject))
{
_gameObjects.Add(tmp);
public void RemoveGameObject(AxiosGameObject gameobject)
{
gameobject.RemoveObject -= new AxiosGameObject.AxiosGameObjectHandler(RemoveGameObject);
try
if (this._gameObjects.Contains(gameobject))
{
gameobject.UnloadContent(this);
this._gameObjects.Remove(gameobject);
try
{
gameobject.UnloadContent(this);
this._gameObjects.Remove(gameobject);
}
catch (Exception)
{
}
}
catch (Exception)
else
{
//Not sure what is going on - but in certain cases an exception will be triggered that the body has already been marked for removal
Singleton<AxiosLog>.Instance.AddLine("[Axios Engine] - Adding objects too fast...remove " + gameobject.Name + " later", LoggingFlag.DEBUG);
this._objectstoremove.Add(gameobject);
}
}
{
base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
foreach (AxiosGameObject g in _gameObjects)
if (this._objectstoremove.Count > 0)
{
List<AxiosGameObject> list = this._objectstoremove.ToList<AxiosGameObject>();
foreach (AxiosGameObject obj in list)
{
this.RemoveGameObject(obj);
this._objectstoremove.Remove(obj);
}
}
foreach (AxiosGameObject g in _gameObjects.ToList())
g.Update(this, gameTime, otherScreenHasFocus, coveredByOtherScreen);
foreach (AxiosTimer t in _timers)
foreach (AxiosTimer t in _timers.ToList())
t.Update(this, gameTime, otherScreenHasFocus, coveredByOtherScreen);
foreach(AxiosUIObject g in _uiobjects)
foreach(AxiosUIObject g in _uiobjects.ToList())
g.Update(this, gameTime, otherScreenHasFocus, coveredByOtherScreen);
}
base.HandleCursor(input);
HandleMouseEvents(input);
foreach (AxiosGameObject g in _gameObjects)
foreach (AxiosGameObject g in _gameObjects.ToList())
g.HandleCursor(this, input);
}
{
base.HandleInput(input, gameTime);
foreach (AxiosGameObject g in _gameObjects)
foreach (AxiosGameObject g in _gameObjects.ToList())
g.HandleInput(this, input, gameTime);
foreach (AxiosUIObject g in _uiobjects)
foreach (AxiosUIObject g in _uiobjects.ToList())
g.HandleInput(this, input, gameTime);
}
axios/Engine/SimpleDrawableAxiosGameObject.cs
77
88
99
10
10
11
12
13
1114
1215
1316
......
8891
8992
9093
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
91125
92126
using FarseerPhysics.Dynamics;
using FarseerPhysics.SamplesFramework;
using Axios.Engine.Interfaces;
using FarseerPhysics.Common.Decomposition;
using FarseerPhysics.Common;
using FarseerPhysics.Factories;
using FarseerPhysics.Common.PolygonManipulation;
namespace Axios.Engine
{
this._draworder = value;
}
}
public void CreateBodyFromTexture(AxiosGameScreen gameScreen)
{
if (this.Texture != null)
{
uint[] data = new uint[this.Texture.Width * this.Texture.Height];
this.Texture.GetData<uint>(data);
Vertices vertices = PolygonTools.CreatePolygon(data, this.Texture.Width, false);
Vector2 vector = -vertices.GetCentroid();
vertices.Translate(ref vector);
base.Origin = -vector;
List<Vertices> list = BayazitDecomposer.ConvexPartition(SimplifyTools.ReduceByDistance(vertices, 4f));
base._scale = 1f;
Vector2 vector2 = (Vector2)(new Vector2(ConvertUnits.ToSimUnits(1)) * base._scale);
foreach (Vertices vertices2 in list)
{
vertices2.Scale(ref vector2);
}
base.BodyPart = BodyFactory.CreateCompoundPolygon(gameScreen.World, list, 1f, BodyType.Dynamic);
base.BodyPart.BodyType = BodyType.Dynamic;
base.BodyPart.Position = base.Position;
base.BodyPart.UserData = this;
base.BodyPart.CollidesWith = Category.All;
base.BodyPart.CollisionCategories = Category.All;
}
}
}
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.07822s using 13 queries.