Progress + prettier ice walls

This commit is contained in:
Regalis
2015-12-12 13:44:05 +02:00
parent 78bccca4af
commit 17e8a2171f
49 changed files with 479 additions and 273 deletions
+10 -4
View File
@@ -249,7 +249,7 @@ namespace Barotrauma.Lights
if (!Enabled) return;
CachedShadow cachedShadow = null;
if (cachedShadows.TryGetValue(light, out cachedShadow))
if (cachedShadows.TryGetValue(light, out cachedShadow) && false)
{
if (light.Position == cachedShadow.LightPos ||
Vector2.DistanceSquared(light.WorldPosition, cachedShadow.LightPos) < 1.0f)
@@ -269,9 +269,15 @@ namespace Barotrauma.Lights
}
else
{
CalculateShadowVertices(light.Position, los);
cachedShadow = new CachedShadow(shadowVertices, penumbraVertices, light.WorldPosition);
cachedShadows.Add(light, cachedShadow);
Vector2 lightPos = light.WorldPosition;
if (light.Submarine!=null && parentEntity != null && parentEntity.Submarine == light.Submarine)
{
lightPos = light.Position;
}
CalculateShadowVertices(lightPos, los);
// cachedShadow = new CachedShadow(shadowVertices, penumbraVertices, light.WorldPosition);
// cachedShadows.Add(light, cachedShadow);
}
DrawShadows(graphicsDevice, cam, transform, los);