Fixed LOS lightsource keeping references to already unloaded convex hulls and subs, causing the los effects of the previously loaded subs to be always rendered.
This commit is contained in:
@@ -370,6 +370,7 @@ namespace Barotrauma.Lights
|
|||||||
public void ClearLights()
|
public void ClearLights()
|
||||||
{
|
{
|
||||||
lights.Clear();
|
lights.Clear();
|
||||||
|
losSource.Reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -641,6 +641,28 @@ namespace Barotrauma.Lights
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Reset()
|
||||||
|
{
|
||||||
|
hullsInRange.Clear();
|
||||||
|
diffToSub.Clear();
|
||||||
|
NeedsHullCheck = true;
|
||||||
|
NeedsRecalculation = true;
|
||||||
|
|
||||||
|
vertexCount = 0;
|
||||||
|
if (lightVolumeBuffer != null)
|
||||||
|
{
|
||||||
|
lightVolumeBuffer.Dispose();
|
||||||
|
lightVolumeBuffer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
indexCount = 0;
|
||||||
|
if (lightVolumeIndexBuffer != null)
|
||||||
|
{
|
||||||
|
lightVolumeIndexBuffer.Dispose();
|
||||||
|
lightVolumeIndexBuffer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Remove()
|
public void Remove()
|
||||||
{
|
{
|
||||||
if (LightSprite != null) LightSprite.Remove();
|
if (LightSprite != null) LightSprite.Remove();
|
||||||
|
|||||||
Reference in New Issue
Block a user