Sources/CcgDump/BoneLightBindInfo.cpp
// initializes this from the structures found in the cgf file

initializes this from the structures found in the cgf file
initializes this from the structures found in the cgf file
void CBoneLightBindInfo::load (const SBoneLightBind& bind, const LIGHT_CHUNK_DESC& light, const char* szLightName, float fScale)
{
	m_nDLightFlags = 0;
	if (strstr(szLightName,"_ls"))
		m_nDLightFlags |= DLF_LIGHTSOURCE;
	if (strstr(szLightName, "_hs"))
		m_nDLightFlags |= DLF_HEATSOURCE;
	if (!(m_nDLightFlags & (DLF_HEATSOURCE|DLF_LIGHTSOURCE)))
		m_nDLightFlags |= DLF_HEATSOURCE;
	if (strstr(szLightName, "local"))
		m_nDLightFlags |= DLF_LOCAL;
	if (light.szLightImage[0])
		m_nDLightFlags |= DLF_PROJECT;
	else
		m_nDLightFlags |= DLF_POINT;
	m_nBone = bind.nBoneId;
	m_vPos  = bind.vLightOffset;
	m_qRot  = exp( quaternionf(0,bind.vRotLightOrientation) );
	constructMatLight();
	m_nType = light.type;
	m_rgbColor.r = light.color.r / 255.0f;
	m_rgbColor.g = light.color.g / 255.0f;
	m_rgbColor.b = light.color.b / 255.0f;
	m_rgbColor.a = 1.0f;
	m_fIntensity      = light.intens;
	m_fHotSpotSize    = light.hotsize;
	m_fFalloffSize    = light.fallsize;
	m_fNearAttenStart = light.nearAttenStart;
	m_fNearAttenEnd   = light.nearAttenEnd;
	m_fFarAttenStart  = light.attenStart;
	m_fFarAttenEnd    = light.attenEnd;
	m_vDirection      = light.vDirection;
	m_strLightImage   = light.szLightImage;
	m_bOn             = light.on;
	m_bUseNearAtten   = light.useNearAtten;
	m_bUseFarAtten    = light.useAtten;
	m_bShadow         = light.shadow;
	if (!m_bUseFarAtten)
	{
#ifdef _CRY_ANIMATION_BASE_HEADER_
		g_GetLog()->LogWarning ("\003no far attenuation in the heat source (bone) light, using default");
#endif
		m_fFarAttenEnd = 40;
	}
	scale (fScale);
}
void CBoneLightBindInfo :: load ( const SBoneLightBind & bind , const LIGHT_CHUNK_DESC & light , const char * szLightName , float fScale ) { m_nDLightFlags = 0 ; if ( strstr ( szLightName , " " ) ) m_nDLightFlags |= DLF_LIGHTSOURCE ; if ( strstr ( szLightName , " " ) ) m_nDLightFlags |= DLF_HEATSOURCE ; if ( ! ( m_nDLightFlags & ( DLF_HEATSOURCE | DLF_LIGHTSOURCE ) ) ) m_nDLightFlags |= DLF_HEATSOURCE ; if ( strstr ( szLightName , " " ) ) m_nDLightFlags |= DLF_LOCAL ; if ( light . szLightImage [ 0 ] ) m_nDLightFlags |= DLF_PROJECT ; else m_nDLightFlags |= DLF_POINT ; m_nBone = bind . nBoneId ; m_vPos = bind . vLightOffset ; m_qRot = exp ( quaternionf ( 0 , bind . vRotLightOrientation ) ) ; constructMatLight ( ) ; m_nType = light . type ; m_rgbColor . r = light . color . r / 255.0f ; m_rgbColor . g = light . color . g / 255.0f ; m_rgbColor . b = light . color . b / 255.0f ; m_rgbColor . a = 1.0f ; m_fIntensity = light . intens ; m_fHotSpotSize = light . hotsize ; m_fFalloffSize = light . fallsize ; m_fNearAttenStart = light . nearAttenStart ; m_fNearAttenEnd = light . nearAttenEnd ; m_fFarAttenStart = light . attenStart ; m_fFarAttenEnd = light . attenEnd ; m_vDirection = light . vDirection ; m_strLightImage = light . szLightImage ; m_bOn = light . on ; m_bUseNearAtten = light . useNearAtten ; m_bUseFarAtten = light . useAtten ; m_bShadow = light . shadow ; if ( ! m_bUseFarAtten ) { #ifdef _CRY_ANIMATION_BASE_HEADER_ g_GetLog ( ) -> LogWarning ( " \003 " ) ; #endif m_fFarAttenEnd = 40 ; } scale ( fScale ) ; }
initializes this from the structures found in the cgf file
initializes this from the structures found in the cgf file
// set up the flags that will be set to the DLight
 // the light source must have a name with substrings _ls and/or _hs
 // _ls means a light source, _hs means a heat source
 // if none is present, then the heat source flag is automatically set up
