diff --git a/Src/Graphics/New3D/New3D.cpp b/Src/Graphics/New3D/New3D.cpp index cf8d7a2..1e1fadb 100644 --- a/Src/Graphics/New3D/New3D.cpp +++ b/Src/Graphics/New3D/New3D.cpp @@ -913,9 +913,16 @@ void CNew3D::CacheModel(Model *m, const UINT32 *data) p.v[j].color[2] = shade; } else { - p.v[j].color[0] = (ph.header[4] >> 24); - p.v[j].color[1] = (ph.header[4] >> 16) & 0xFF; - p.v[j].color[2] = (ph.header[4] >> 8) & 0xFF; + if (ph.ColorDisabled()) { // no colours were set + p.v[j].color[0] = 255; + p.v[j].color[1] = 255; + p.v[j].color[2] = 255; + } + else { + p.v[j].color[0] = (ph.header[4] >> 24); + p.v[j].color[1] = (ph.header[4] >> 16) & 0xFF; + p.v[j].color[2] = (ph.header[4] >> 8) & 0xFF; + } } if ((ph.header[6] & 0x00800000)) { // if set, polygon is opaque diff --git a/Src/Graphics/New3D/PolyHeader.cpp b/Src/Graphics/New3D/PolyHeader.cpp index 6b5ffae..daceca1 100644 --- a/Src/Graphics/New3D/PolyHeader.cpp +++ b/Src/Graphics/New3D/PolyHeader.cpp @@ -181,6 +181,11 @@ void PolyHeader::Color(UINT8& r, UINT8& g, UINT8& b) b = (header[4] >> 8) & 0xFF; } +bool PolyHeader::ColorDisabled() +{ + return (header[4] & 0x80) > 0; +} + int PolyHeader::Page() { return (header[4] & 0x40) >> 6; @@ -262,7 +267,7 @@ bool PolyHeader::PolyAlpha() bool PolyHeader::TextureAlpha() { - return (header[6] & 0x1); + return (header[6] & 0x3) > 0; } bool PolyHeader::StencilPoly() diff --git a/Src/Graphics/New3D/PolyHeader.h b/Src/Graphics/New3D/PolyHeader.h index b560999..129e713 100644 --- a/Src/Graphics/New3D/PolyHeader.h +++ b/Src/Graphics/New3D/PolyHeader.h @@ -39,10 +39,10 @@ xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal Z coordinate(2.22 fixed poin 0x04: xxxxxxxx xxxxxxxx xxxxxxxx -------- Color(RGB888) +-------- -------- -------- x------- Color disabled -------- -------- -------- -x------ Texture page --------- -------- -------- ---xxxxx Upper 5 bits of texture U coordinate --------- -------- -------- x------- ? -------- -------- -------- --x----- ? +-------- -------- -------- ---xxxxx Upper 5 bits of texture U coordinate 0x05 : xxxxxxxx xxxxxxxx xxxxxxxx -------- Specular color ? @@ -105,6 +105,7 @@ public: //header 4 void Color(UINT8& r, UINT8& g, UINT8& b); + bool ColorDisabled(); int Page(); // header 5 diff --git a/VS2008/Supermodel.vcxproj b/VS2008/Supermodel.vcxproj index 35b7d5b..7e07ede 100644 --- a/VS2008/Supermodel.vcxproj +++ b/VS2008/Supermodel.vcxproj @@ -93,7 +93,7 @@ Disabled ..\Src;..\Src\OSD;..\Src\OSD\SDL;..\Src\OSD\Windows;..\Libraries\zlib-1.2.4;..\Libraries\SDL-1.2.14\include;$(DXSDK_DIR)\Include;%(AdditionalIncludeDirectories) - SUPERMODEL_WIN32;INLINE=static __inline;_MBCS;_CRT_SECURE_NO_WARNINGS;GLEW_STATIC;DEBUG + SUPERMODEL_WIN32;INLINE=static __inline;_MBCS;_CRT_SECURE_NO_WARNINGS;GLEW_STATIC true EnableFastChecks MultiThreadedDebug