make fog of war rendering optional for classic mods

This commit is contained in:
Matthias Mailänder
2013-03-07 23:18:50 +01:00
parent b16b171b1e
commit de30f0a917
6 changed files with 30 additions and 3 deletions

View File

@@ -129,8 +129,9 @@ namespace OpenRA.Graphics
}
var clipRect = Game.viewport.WorldBounds(wr.world);
DrawShroud(wr, clipRect, fogSprites, fogPalette);
DrawShroud(wr, clipRect, sprites, shroudPalette);
if (wr.world.WorldActor.HasTrait<Fog>())
DrawShroud(wr, clipRect, fogSprites, fogPalette);
}
void DrawShroud(WorldRenderer wr, Rectangle clip, Sprite[,] s, PaletteReference pal)

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -178,6 +178,7 @@
<Compile Include="Traits\ValidateOrder.cs" />
<Compile Include="Traits\Waypoint.cs" />
<Compile Include="Traits\World\Country.cs" />
<Compile Include="Traits\World\Fog.cs" />
<Compile Include="Traits\World\PlayerColorPalette.cs" />
<Compile Include="Traits\World\ResourceLayer.cs" />
<Compile Include="Traits\World\ResourceType.cs" />
@@ -194,7 +195,7 @@
<Compile Include="Widgets\DropDownButtonWidget.cs" />
<Compile Include="Widgets\GridLayout.cs" />
<Compile Include="Widgets\ImageWidget.cs" />
<Compile Include="Widgets\LabelWidget.cs" />
<Compile Include="Widgets\LabelWidget.cs" />
<Compile Include="Widgets\LineGraphWidget.cs" />
<Compile Include="Widgets\ListLayout.cs" />
<Compile Include="Widgets\MapPreviewWidget.cs" />

View File

@@ -0,0 +1,22 @@
#region Copyright & License Information
/*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
namespace OpenRA.Traits
{
public class FogInfo : TraitInfo<Fog>
{
/*
* This tag trait will enable fog of war in ShroudRenderer.
* Don't forget about HiddenUnderFog and FrozenUnderFog.
*/
}
public class Fog { }
}

View File

@@ -158,6 +158,7 @@ World:
SpatialBins:
BinSize: 4
Shroud:
Fog:
CrateSpawner:
Minimum: 1
Maximum: 6

View File

@@ -353,6 +353,7 @@ World:
SpatialBins:
BinSize: 4
Shroud:
Fog:
PathFinder:
ValidateOrder:

View File

@@ -306,6 +306,7 @@ World:
SpatialBins:
BinSize: 4
Shroud:
Fog:
PathFinder:
ValidateOrder: