Beispiel #1
0
HRESULT HookIDirect3DDevice9::GetLight(LPVOID _this,
									   DWORD Index,
									   D3DLIGHT9* pLight)
{
	LOG_API();
	return pD3Dev->GetLight(Index, pLight);
}
Beispiel #2
0
//-----------------------------------------------------------------------------
// Name: CTiny::Draw()
// Desc: Renders this CTiny instace using the current animation frames.
//-----------------------------------------------------------------------------
HRESULT CTiny::Draw(D3DXMATRIXA16 *mxViewProj, bool bRenderShadow)
{
    LPDIRECT3DDEVICE9 pDevice = this->m_pMA->GetDevice();
    D3DLIGHT9 light;
    pDevice->GetLight(0, &light);
    // update the ViewProjection matric for the animation
    ID3DXEffect* pMAEffect = m_pMA->GetEffect();
    if( pMAEffect )
    {
        pMAEffect->SetMatrix( "g_mViewProj", mxViewProj );
        pMAEffect->SetVector( "lhtDir", (D3DXVECTOR4 *)&(light.Direction));
    }

    SAFE_RELEASE( pMAEffect );
    SAFE_RELEASE( pDevice);
   


    if(bRenderShadow)
    {
        m_pMA->SetTechnique( "ShadowPass" );
    }
    else
    {

        m_pMA->SetTechnique( "Skinning20" );
            // translate player

       
    }

    return m_pAI->Draw();
}