Renamed WaterPaletteRotation to RotationPaletteEffect

This commit is contained in:
reaperrr
2015-08-18 22:14:49 +02:00
parent ca055eb7bb
commit 96c7d4345e
5 changed files with 19 additions and 11 deletions

View File

@@ -366,7 +366,7 @@
<Compile Include="Traits\PaletteEffects\GlobalLightingPaletteEffect.cs" /> <Compile Include="Traits\PaletteEffects\GlobalLightingPaletteEffect.cs" />
<Compile Include="Traits\PaletteEffects\FlashPaletteEffect.cs" /> <Compile Include="Traits\PaletteEffects\FlashPaletteEffect.cs" />
<Compile Include="Traits\PaletteEffects\MenuPaletteEffect.cs" /> <Compile Include="Traits\PaletteEffects\MenuPaletteEffect.cs" />
<Compile Include="Traits\PaletteEffects\WaterPaletteRotation.cs" /> <Compile Include="Traits\PaletteEffects\RotationPaletteEffect.cs" />
<Compile Include="Traits\Player\ActorGroupProxy.cs" /> <Compile Include="Traits\Player\ActorGroupProxy.cs" />
<Compile Include="Traits\Player\AllyRepair.cs" /> <Compile Include="Traits\Player\AllyRepair.cs" />
<Compile Include="Traits\Player\BaseAttackNotifier.cs" /> <Compile Include="Traits\Player\BaseAttackNotifier.cs" />

View File

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits namespace OpenRA.Mods.Common.Traits
{ {
[Desc("Palette effect used for sprinkle \"animations\".")] [Desc("Palette effect used for sprinkle \"animations\".")]
class WaterPaletteRotationInfo : ITraitInfo class RotationPaletteEffectInfo : ITraitInfo
{ {
[Desc("Defines which palettes should be excluded from this effect.")] [Desc("Defines which palettes should be excluded from this effect.")]
public readonly HashSet<string> ExcludePalettes = new HashSet<string>(); public readonly HashSet<string> ExcludePalettes = new HashSet<string>();
@@ -33,22 +33,23 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Step towards next color index per tick.")] [Desc("Step towards next color index per tick.")]
public readonly float RotationStep = .25f; public readonly float RotationStep = .25f;
public object Create(ActorInitializer init) { return new WaterPaletteRotation(init.World, this); } public object Create(ActorInitializer init) { return new RotationPaletteEffect(init.World, this); }
} }
class WaterPaletteRotation : ITick, IPaletteModifier class RotationPaletteEffect : ITick, IPaletteModifier
{ {
readonly WaterPaletteRotationInfo info; readonly RotationPaletteEffectInfo info;
readonly World world; readonly World world;
float t = 0; float t = 0;
uint[] temp; uint[] temp;
public WaterPaletteRotation(World world, WaterPaletteRotationInfo info) public RotationPaletteEffect(World world, RotationPaletteEffectInfo info)
{ {
this.world = world; this.world = world;
this.info = info; this.info = info;
temp = new uint[info.RotationRange]; /* allocating this on the fly actually hurts our profile */ // Allocating this on the fly actually hurts our profile
temp = new uint[info.RotationRange];
} }
public void Tick(Actor self) public void Tick(Actor self)

View File

@@ -2051,6 +2051,13 @@ namespace OpenRA.Mods.Common.UtilityCommands
} }
} }
// WaterPaletteRotation renamed to RotationPaletteEffect
if (engineVersion < 20150903)
{
if (depth == 1 && node.Key == "WaterPaletteRotation")
node.Key = "RotationPaletteEffect";
}
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
} }
} }

View File

@@ -72,7 +72,7 @@
MenuEffect: Desaturated MenuEffect: Desaturated
CloakPaletteEffect: CloakPaletteEffect:
FlashPaletteEffect: FlashPaletteEffect:
WaterPaletteRotation: RotationPaletteEffect@water:
ExcludePalettes: effect, chrome ExcludePalettes: effect, chrome
RotationBase: 32 RotationBase: 32

View File

@@ -67,13 +67,13 @@
RemapIndex: 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 RemapIndex: 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
PlayerHighlightPalette: PlayerHighlightPalette:
MenuPaletteEffect: MenuPaletteEffect:
WaterPaletteRotation@defaultwater: RotationPaletteEffect@defaultwater:
ExcludePalettes: chrome ExcludePalettes: chrome
ExcludeTilesets: DESERT ExcludeTilesets: DESERT
WaterPaletteRotation@actorswater: RotationPaletteEffect@actorswater:
ExcludePalettes: chrome, terrain ExcludePalettes: chrome, terrain
ExcludeTilesets: TEMPERAT, SNOW, INTERIOR ExcludeTilesets: TEMPERAT, SNOW, INTERIOR
WaterPaletteRotation@desertwater: RotationPaletteEffect@desertwater:
ExcludePalettes: chrome, effect, player ExcludePalettes: chrome, effect, player
ExcludeTilesets: TEMPERAT, SNOW, INTERIOR ExcludeTilesets: TEMPERAT, SNOW, INTERIOR
RotationBase: 32 RotationBase: 32