diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-05-04 13:24:02 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-05-04 13:24:02 -0300 |
commit | fbbe7dcdfbd09fc6ef5614dea2183481a27e4f4e (patch) | |
tree | 4e783f0e4347a2f612e6b85398c83a492d7b090f /drivers/pvr/PvrTcPacket.h | |
parent | 7f5b744b92256e42aa3c700ee88d8318732935c6 (diff) | |
parent | 6f8bd899311d459b9e391b4acf72ccfa5cc1d806 (diff) |
Merge remote-tracking branch 'origin/master'
Conflicts:
drivers/windows/dir_access_windows.cpp
Diffstat (limited to 'drivers/pvr/PvrTcPacket.h')
-rw-r--r-- | drivers/pvr/PvrTcPacket.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/pvr/PvrTcPacket.h b/drivers/pvr/PvrTcPacket.h new file mode 100644 index 0000000000..ac3b6a4dd1 --- /dev/null +++ b/drivers/pvr/PvrTcPacket.h @@ -0,0 +1,65 @@ +//============================================================================ +// +// Modulation data specifies weightings of colorA to colorB for each pixel +// +// For mode = 0 +// 00: 0/8 +// 01: 3/8 +// 10: 5/8 +// 11: 8/8 +// +// For mode = 1 +// 00: 0/8 +// 01: 4/8 +// 10: 4/8 with alpha punchthrough +// 11: 8/8 +// +// For colorIsOpaque=0 +// 3 bits A +// 4 bits R +// 4 bits G +// 3/4 bits B +// +// For colorIsOpaque=1 +// 5 bits R +// 5 bits G +// 4/5 bits B +// +//============================================================================ + +#pragma once +#include "ColorRgba.h" + +//============================================================================ + +namespace Javelin +{ +//============================================================================ + + struct PvrTcPacket + { + unsigned int modulationData; + unsigned usePunchthroughAlpha : 1; + unsigned colorA : 14; + unsigned colorAIsOpaque : 1; + unsigned colorB : 15; + unsigned colorBIsOpaque : 1; + + ColorRgb<int> GetColorRgbA() const; + ColorRgb<int> GetColorRgbB() const; + ColorRgba<int> GetColorRgbaA() const; + ColorRgba<int> GetColorRgbaB() const; + + void SetColorA(const ColorRgb<unsigned char>& c); + void SetColorB(const ColorRgb<unsigned char>& c); + + void SetColorA(const ColorRgba<unsigned char>& c); + void SetColorB(const ColorRgba<unsigned char>& c); + + static const unsigned char BILINEAR_FACTORS[16][4]; + static const unsigned char WEIGHTS[8][4]; + }; + +//============================================================================ +} // namespace Javelin +//============================================================================ |