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:
reaperrr
2017-08-05 22:43:09 +02:00
committed by abcdefg30
parent 99dac05fd7
commit d949e17b88
7 changed files with 11 additions and 13 deletions

View File

@@ -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;