2010-12-25 17:18:13 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace GSDumpGUI
|
|
|
|
|
{
|
2010-12-29 08:41:15 +00:00
|
|
|
|
[Serializable]
|
2010-12-25 17:18:13 +00:00
|
|
|
|
public class GIFRegRGBAQ : GIFReg
|
|
|
|
|
{
|
2010-12-28 18:31:45 +00:00
|
|
|
|
public byte R;
|
|
|
|
|
public byte G;
|
|
|
|
|
public byte B;
|
|
|
|
|
public byte A;
|
2010-12-26 01:00:11 +00:00
|
|
|
|
public float Q;
|
2010-12-25 17:18:13 +00:00
|
|
|
|
|
2010-12-28 18:31:45 +00:00
|
|
|
|
public GIFRegRGBAQ(byte addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
2010-12-26 12:22:37 +00:00
|
|
|
|
|
2010-12-28 18:31:45 +00:00
|
|
|
|
static public GIFReg Unpack(GIFTag tag, byte addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
2010-12-25 17:18:13 +00:00
|
|
|
|
{
|
2010-12-26 12:22:37 +00:00
|
|
|
|
GIFRegRGBAQ r = new GIFRegRGBAQ(addr, LowData, HighData, PackedFormat);
|
2010-12-26 01:00:11 +00:00
|
|
|
|
r.Descriptor = (GIFRegDescriptor)addr;
|
|
|
|
|
if (PackedFormat)
|
|
|
|
|
{
|
2010-12-28 18:31:45 +00:00
|
|
|
|
r.R = (byte)GetBit(LowData, 0, 8);
|
|
|
|
|
r.G = (byte)GetBit(LowData, 32, 8);
|
|
|
|
|
r.B = (byte)GetBit(HighData, 0, 8);
|
|
|
|
|
r.A = (byte)GetBit(HighData, 32, 8);
|
2010-12-26 01:00:11 +00:00
|
|
|
|
r.Q = tag.Q;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-12-28 18:31:45 +00:00
|
|
|
|
r.R = (byte)GetBit(LowData, 0, 8);
|
|
|
|
|
r.G = (byte)GetBit(LowData, 8, 8);
|
|
|
|
|
r.B = (byte)GetBit(LowData, 16, 8);
|
|
|
|
|
r.A = (byte)GetBit(LowData, 24, 8);
|
2010-12-26 01:00:11 +00:00
|
|
|
|
r.Q = BitConverter.ToSingle(BitConverter.GetBytes(LowData), 4);
|
|
|
|
|
}
|
2010-12-25 17:18:13 +00:00
|
|
|
|
return r;
|
|
|
|
|
}
|
2010-12-26 01:00:11 +00:00
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return Descriptor.ToString() + "@Red : " + R.ToString() + "@Green : " + G.ToString() + "@Blue : " + B.ToString() + "@Alpha : " + A.ToString();
|
|
|
|
|
}
|
2010-12-25 17:18:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|