Lighting optimization (caching shadow vertices & only checking hulls in range if the position or range of the light changes), ragdoll optimization, itemcomponent optimization, dragging stunned/dead characters

This commit is contained in:
Regalis11
2015-10-11 21:04:42 +03:00
parent 0a96254696
commit 8df9133e84
25 changed files with 377 additions and 201 deletions

View File

@@ -192,6 +192,8 @@ namespace Subsurface
}
}
static Dictionary<string, float> timeElapsed = new Dictionary<string, float>();
/// <summary>
/// Call Update() on every object in Entity.list
/// </summary>
@@ -202,10 +204,46 @@ namespace Subsurface
item.Updated = false;
}
for (int i = 0; i < mapEntityList.Count; i++)
foreach (Hull hull in Hull.hullList)
{
mapEntityList[i].Update(cam, deltaTime);
hull.Update(cam, deltaTime);
}
foreach (Gap gap in Gap.GapList)
{
gap.Update(cam, deltaTime);
}
foreach (Item item in Item.itemList)
{
item.Update(cam, deltaTime);
}
//Stopwatch sw = new Stopwatch();
//for (int i = 0; i < mapEntityList.Count; i++)
//{
// sw.Restart();
// mapEntityList[i].Update(cam, deltaTime);
// sw.Stop();
// if (timeElapsed.ContainsKey(mapEntityList[i].Name))
// {
// float asd = 0.0f;
// timeElapsed.TryGetValue(mapEntityList[i].Name, out asd);
// asd += sw.ElapsedTicks;
// timeElapsed.Remove(mapEntityList[i].Name);
// timeElapsed.Add(mapEntityList[i].Name, asd);
// }
// else
// {
// timeElapsed.Add(mapEntityList[i].Name, sw.ElapsedTicks);
// }
//}
}
public virtual void Update(Camera cam, float deltaTime) { }