cnc water palette rotation

This commit is contained in:
Paul Chote
2010-08-14 17:52:59 +12:00
parent aa6e671d89
commit 5c1408d4d7
2 changed files with 19 additions and 3 deletions

View File

@@ -13,10 +13,20 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
class WaterPaletteRotationInfo : TraitInfo<WaterPaletteRotation> { }
class WaterPaletteRotationInfo : ITraitInfo
{
public readonly bool CncMode = false;
public object Create(ActorInitializer init) { return new WaterPaletteRotation(CncMode); }
}
class WaterPaletteRotation : ITick, IPaletteModifier
{
bool cncmode = false;
public WaterPaletteRotation(bool cncmode)
{
this.cncmode = cncmode;
}
float t = 0;
public void Tick(Actor self)
{
@@ -29,7 +39,12 @@ namespace OpenRA.Mods.RA
using (var bitmapCopy = new Bitmap(b))
for (int j = 0; j < b.Height; j++)
for (int i = 0; i < 7; i++)
b.SetPixel(0x60 + (rotate + i) % 7, j, bitmapCopy.GetPixel(0x60 + i, j));
{
if (cncmode)
b.SetPixel(0x20 + (rotate + i) % 7, j, bitmapCopy.GetPixel(0x20 + i, j));
else
b.SetPixel(0x60 + (rotate + i) % 7, j, bitmapCopy.GetPixel(0x60 + i, j));
}
}
}
}

View File

@@ -44,7 +44,8 @@ Player:
World:
ScreenShaker:
# WaterPaletteRotation:
WaterPaletteRotation:
CncMode: true
BuildingInfluence:
UnitInfluence:
BridgeLayer: