- Code: Select all
void __thiscall PRO_Polygon::APISetTranslucencyPatternSelect(PRO_Polygon *this, __int32 a2)
{
if ( !(*((_BYTE *)this + 83) & 2) )
*((_DWORD *)this + 6) ^= (*((_DWORD *)this + 6) ^ (a2 << 17)) & 0x20000;
}
Here is what it is actually doing:
- Code: Select all
void PRO_Polygon::APISetTranslucencyPatternSelect(long pattern)
{
if (_user_xlu_pattern_select)
_hw_polygon._mcw2._translucency_pattern_select = pattern & 1;
}
There is a bit field at the very end of the object that is used by the API that holds API-level state information. These bits can affect how the hardware polygon is formatted. In this case, _user_xlu_pattern_select doesn't look like anything too special, although I wonder why they even make that configurable. My guess is that it's safe to assume that when polygons are translucent, the pattern can be freely changed except in some specific case where perhaps the API creates translucent polygons internally and wants to enforce a specific pattern.