/[pcsx2_0.9.7]/trunk/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegRGBAQ.cs
ViewVC logotype

Contents of /trunk/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegRGBAQ.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 313 - (show annotations) (download)
Sun Dec 26 16:21:07 2010 UTC (9 years, 9 months ago) by william
File size: 1566 byte(s)
Auto Commited Import of: pcsx2-0.9.7-DEBUG (upstream: v0.9.7.4151 local: v0.9.7.293-latest) in ./trunk
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace GSDumpGUI
6 {
7 public class GIFRegRGBAQ : GIFReg
8 {
9 public int R;
10 public int G;
11 public int B;
12 public int A;
13 public float Q;
14
15 public GIFRegRGBAQ(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
16
17 static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
18 {
19 GIFRegRGBAQ r = new GIFRegRGBAQ(addr, LowData, HighData, PackedFormat);
20 r.Descriptor = (GIFRegDescriptor)addr;
21 if (PackedFormat)
22 {
23 r.R = (int)GetBit(LowData, 0, 8);
24 r.G = (int)GetBit(LowData, 32, 8);
25 r.B = (int)GetBit(HighData, 0, 8);
26 r.A = (int)GetBit(HighData, 32, 8);
27 r.Q = tag.Q;
28 }
29 else
30 {
31 r.R = (int)GetBit(LowData, 0, 8);
32 r.G = (int)GetBit(LowData, 8, 8);
33 r.B = (int)GetBit(LowData, 16, 8);
34 r.A = (int)GetBit(LowData, 24, 8);
35 r.Q = BitConverter.ToSingle(BitConverter.GetBytes(LowData), 4);
36 }
37 return r;
38 }
39
40 public override string ToString()
41 {
42 return Descriptor.ToString() + "@Red : " + R.ToString() + "@Green : " + G.ToString() + "@Blue : " + B.ToString() + "@Alpha : " + A.ToString();
43 }
44 }
45 }

  ViewVC Help
Powered by ViewVC 1.1.22