mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-02-16 17:35:39 +00:00
New engine: expanded color indices to 12 bits from 11. Added PolygonHeader::ColorIndex and SensorColorIndex methods.
This commit is contained in:
parent
2ef5203839
commit
5c1a240565
|
@ -958,7 +958,7 @@ void CNew3D::CacheModel(Model *m, const UINT32 *data)
|
|||
// copy face attributes
|
||||
|
||||
if ((ph.header[1] & 2) == 0) {
|
||||
UINT32 colorIdx = (ph.header[4] >> 8) & 0x7FF;
|
||||
int colorIdx = ph.ColorIndex();
|
||||
p.faceColour[2] = (m_polyRAM[m_colorTableAddr + colorIdx] & 0xFF) / 255.f;
|
||||
p.faceColour[1] = ((m_polyRAM[m_colorTableAddr + colorIdx] >> 8) & 0xFF) / 255.f;
|
||||
p.faceColour[0] = ((m_polyRAM[m_colorTableAddr + colorIdx] >> 16) & 0xFF) / 255.f;
|
||||
|
|
|
@ -229,6 +229,16 @@ void PolyHeader::Color(UINT8& r, UINT8& g, UINT8& b)
|
|||
b = (header[4] >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
int PolyHeader::ColorIndex()
|
||||
{
|
||||
return (header[4] >> 8) & 0xFFF;
|
||||
}
|
||||
|
||||
int PolyHeader::SensorColorIndex()
|
||||
{
|
||||
return (header[4] >> 20) & 0xFFF;
|
||||
}
|
||||
|
||||
bool PolyHeader::ColorDisabled()
|
||||
{
|
||||
return (header[4] & 0x80) > 0;
|
||||
|
|
|
@ -117,6 +117,8 @@ public:
|
|||
|
||||
//header 4
|
||||
void Color(UINT8& r, UINT8& g, UINT8& b);
|
||||
int ColorIndex();
|
||||
int SensorColorIndex();
|
||||
bool ColorDisabled();
|
||||
int Page();
|
||||
|
||||
|
|
Loading…
Reference in a new issue