color flag

This commit is contained in:
Ian Curtis 2016-04-27 16:42:31 +00:00
parent 74e7ff3d7d
commit 09e27e3082
4 changed files with 20 additions and 7 deletions

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -93,7 +93,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\Src;..\Src\OSD;..\Src\OSD\SDL;..\Src\OSD\Windows;..\Libraries\zlib-1.2.4;..\Libraries\SDL-1.2.14\include;$(DXSDK_DIR)\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>SUPERMODEL_WIN32;INLINE=static __inline;_MBCS;_CRT_SECURE_NO_WARNINGS;GLEW_STATIC;DEBUG</PreprocessorDefinitions>
<PreprocessorDefinitions>SUPERMODEL_WIN32;INLINE=static __inline;_MBCS;_CRT_SECURE_NO_WARNINGS;GLEW_STATIC</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>