Wrap palette references with a PaletteRef object.

This commit is contained in:
Paul Chote
2013-02-24 11:08:50 +13:00
parent a166815348
commit f0ba0ce2e8
30 changed files with 83 additions and 43 deletions

View File

@@ -11,6 +11,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Traits;
using OpenRA.Mods.RA.Air;
using OpenRA.Mods.RA.Move;
@@ -29,7 +30,7 @@ namespace OpenRA.Mods.RA.Render
var visualOffset = ((move is Helicopter || move is Mobile) && move.Altitude > 0)
? Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0;
var shadowSprites = r.Select(a => a.WithPalette("shadow"));
var shadowSprites = r.Select(a => a.WithPalette(PaletteReference.FromName("shadow")));
var flyingSprites = (move.Altitude <= 0) ? r
: r.Select(a => a.WithPos(a.Pos - new float2(0, move.Altitude + visualOffset)).WithZOffset(move.Altitude + a.ZOffset));