当前位置: 首页>>代码示例>>C++>>正文


C++ CObj::IsCull方法代码示例

本文整理汇总了C++中CObj::IsCull方法的典型用法代码示例。如果您正苦于以下问题:C++ CObj::IsCull方法的具体用法?C++ CObj::IsCull怎么用?C++ CObj::IsCull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CObj的用法示例。


在下文中一共展示了CObj::IsCull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Render

void CDialogMsg::Render( C2DRender* p2DRender )
{
	CSize size;	
	LPCUSTOMTEXT lpCustomText;

//	CD3DFont* pOldFont = p2DRender->GetFont();
//	p2DRender->SetFont( CWndBase::m_Theme.m_pFontWndTitle );
	
	LPDIRECT3DDEVICE9 pd3dDevice = p2DRender->m_pd3dDevice;
	
	pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, 1 );
	pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, 1 );
	pd3dDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_POINT );		
	pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT );		
	
	pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );	
	pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE,   TRUE );
	
	pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_SELECTARG1 );
	pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
	pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP,   D3DTOP_MODULATE );
	pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
	pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_TFACTOR  );
	
	TEXTUREVERTEX vertex[ 4 * 18 ];
	CPoint point;
	int nIndex;
		
	for( int i = 0; i < m_textArray.GetSize(); i++ )
	{
		lpCustomText = (LPCUSTOMTEXT) m_textArray.GetAt( i );
		TEXTUREVERTEX* pVertices = vertex; 
		if( !lpCustomText->m_bInfinite && lpCustomText->m_timer.TimeOut() )
		{
			// 퀘스트 이모티콘을 다시 보이게 한다.
			if( lpCustomText->m_pObj->GetType() == OT_MOVER )
				((CMover*)lpCustomText->m_pObj)->m_bShowQuestEmoticon = TRUE;
			safe_delete( lpCustomText );
			m_textArray.RemoveAt( i );
			i --;
		}
		else
		{
			CObj* pObj = lpCustomText->m_pObj;
			if( lpCustomText->m_pTexture )
			{
				if( pObj->IsCull() == FALSE )
				{
					// 월드 좌표를 스크린 좌표로 프로젝션 한다.
					D3DXVECTOR3 vOut, vPos = pObj->GetPos(), vPosHeight;
					D3DVIEWPORT9 vp;
					const BOUND_BOX* pBB;
					
					if( pObj->m_pModel )
						pBB	= pObj->m_pModel->GetBBVector();
					else
						return;

					pd3dDevice->GetViewport( &vp );

					D3DXMATRIX matTrans;
					D3DXMATRIX matWorld;
					D3DXMatrixIdentity(&matWorld);
					D3DXMatrixTranslation( &matTrans, vPos.x, vPos.y , vPos.z);

					D3DXMatrixMultiply( &matWorld, &matWorld, &pObj->GetMatrixScale() );
					D3DXMatrixMultiply( &matWorld, &matWorld, &pObj->GetMatrixRotation() );
					D3DXMatrixMultiply( &matWorld, &matWorld, &matTrans );

					vPosHeight = pBB->m_vPos[0];
					vPosHeight.x = 0;
					vPosHeight.z = 0;
					
					D3DXVec3Project( &vOut, &vPosHeight, &vp, &pObj->GetWorld()->m_matProj,
						&pObj->GetWorld()->m_pCamera->m_matView, &matWorld);

					CPoint point;
					point.x = (LONG)( vOut.x - 32 / 2 );
					point.y = (LONG)( vOut.y - 32 );
					
					MakeEven( point.x );			
	
					p2DRender->RenderTexture( point, lpCustomText->m_pTexture );
				}
			}
			else
			{
			LPCTSTR lpStr = lpCustomText->m_string;
			lpCustomText->m_pFont->GetTextExtent( (TCHAR*)lpStr, &size );
			if( pObj->IsCull() == FALSE )
			{
				int nAlpha = 200;
				if( !lpCustomText->m_bInfinite && lpCustomText->m_timer.GetLeftTime() > 4000 )
					nAlpha = (int)( 200 - ( ( lpCustomText->m_timer.GetLeftTime() - 4000 )* 200 / 1000 ) );
	
				// 월드 좌표를 스크린 좌표로 프로젝션 한다.
				D3DXVECTOR3 vOut, vPos = pObj->GetPos(), vPosHeight;
				D3DVIEWPORT9 vp;
				const BOUND_BOX* pBB;
				
//.........这里部分代码省略.........
开发者ID:KerwinMa,项目名称:SourceFlyFF,代码行数:101,代码来源:DialogMsg.cpp


注:本文中的CObj::IsCull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。