Improved map rendering, shops, light bugfix, junction boxes wont break as easily
This commit is contained in:
@@ -57,5 +57,10 @@ namespace Subsurface.Lights
|
||||
float scale = range / ((float)lightTexture.Width / 2.0f);
|
||||
spriteBatch.Draw(lightTexture, new Vector2(Position.X, -Position.Y), null, color, 0, center, scale, SpriteEffects.None, 1);
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
Game1.LightManager.RemoveLight(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,13 +76,11 @@ namespace Subsurface.Lights
|
||||
foreach (LightSource light in lights)
|
||||
{
|
||||
if (light.Color.A < 0.01f || light.Range < 0.01f) continue;
|
||||
|
||||
|
||||
if (!MathUtils.CircleIntersectsRectangle(light.Position, light.Range, viewRect)) continue;
|
||||
|
||||
//clear alpha to 1
|
||||
ClearAlphaToOne(graphics, spriteBatch);
|
||||
|
||||
ClearAlphaToOne(graphics, spriteBatch);
|
||||
|
||||
if (!MathUtils.CircleIntersectsRectangle(light.Position, light.Range, viewRect)) continue;
|
||||
|
||||
//draw all shadows
|
||||
//write only to the alpha channel, which sets alpha to 0
|
||||
graphics.RasterizerState = RasterizerState.CullNone;
|
||||
|
||||
Reference in New Issue
Block a user