Add Multiply blend mode for D2K move-flash and shroud.
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
|
||||
using System.IO;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
{
|
||||
@@ -24,6 +24,7 @@ namespace OpenRA.Mods.RA
|
||||
[Desc("Palette byte offset")]
|
||||
public readonly long Offset = 0;
|
||||
public readonly bool AllowModifiers = true;
|
||||
public readonly bool InvertColor = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PaletteFromR8(this); }
|
||||
}
|
||||
@@ -42,10 +43,11 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
for (var i = 0; i < 256; i++)
|
||||
{
|
||||
// The custom palette is scaled into the range 0-128.
|
||||
// This makes the move-flash match the original game, but may not be correct in other cases.
|
||||
var packed = s.ReadUInt16();
|
||||
colors[i] = (uint)((255 << 24) | ((packed & 0xF800) << 7) | ((packed & 0x7E0) << 4) | ((packed & 0x1f) << 2));
|
||||
colors[i] = (uint)((255 << 24) | ((packed & 0xF800) << 8) | ((packed & 0x7E0) << 5) | ((packed & 0x1f) << 3));
|
||||
|
||||
if (info.InvertColor)
|
||||
colors[i] ^= 0x00FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user