RegEx, FindPickable & DrawShadows optimization

This commit is contained in:
Regalis
2015-09-27 17:02:15 +03:00
parent c8ee9e085f
commit 97c3ac1412
8 changed files with 124 additions and 91 deletions
+2 -3
View File
@@ -111,7 +111,7 @@ namespace Subsurface.Lights
}
}
public void DrawShadows(GraphicsDevice graphicsDevice, Camera cam, Vector2 lightSourcePos, bool los = true)
public void DrawShadows(GraphicsDevice graphicsDevice, Camera cam, Vector2 lightSourcePos, Matrix transform, bool los = true)
{
if (!Enabled) return;
@@ -224,8 +224,7 @@ namespace Subsurface.Lights
currentIndex = (currentIndex + 1) % primitiveCount;
}
shadowEffect.World = cam.ShaderTransform
* Matrix.CreateOrthographic(GameMain.GraphicsWidth, GameMain.GraphicsHeight, -1, 1) * 0.5f;
shadowEffect.World = transform;
shadowEffect.CurrentTechnique.Passes[0].Apply();
graphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.TriangleStrip, shadowVertices, 0, shadowVertexCount * 2 - 2);