Perform FogObscures as late as possible
FogObscures is more expensive than simpler boolean, player or HasTraitInfo checks, so in these places it makes sense to perform the other checks first.
This commit is contained in:
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
if (world.FogObscures(pos) && !visibleThroughFog)
|
||||
if (!visibleThroughFog && world.FogObscures(pos))
|
||||
return SpriteRenderable.None;
|
||||
|
||||
var zoom = scaleSizeWithZoom ? 1f / wr.Viewport.Zoom : 1f;
|
||||
|
||||
Reference in New Issue
Block a user