Exemple #1
0
bool FindStart(int y, int x, int k)
{
	if(k > 0)
	{
		if(!PutSquares(k))
		{
			ResetMat();
			return false;
		}
		if(k == numPolys)
			return true;
	}
	ResetMat();
	for(; y < h; ++y)
	{
		for(; x < w; ++x)
		{
			if(mat[y][x] == -1)
			{
				sx[k] = x;
				sy[k] = y;
				if(FindStart(y,x+1,k+1))
					return true;
			}
		}
		x = 0;
	}
	return false;
}
Exemple #2
0
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
CBoundBox::CBoundBox(LPDIRECT3DDEVICE9 pDevice)
{
	ResetMat();

	//for( int i = 0; i < 8; i++ )
	//{
	//	m_pTrueVertices[i] = new D3DXVECTOR3( 0.f, 0.f, 0.f );
	//}

	m_pDevice=pDevice;
	m_box=NULL,
		m_boxOrig=NULL,
		m_pCollideInfo=NULL,
		//tmp_pVertexBuffer(NULL),
	m_pPlaneTop		=	new D3DXPLANE;
	m_pPlaneBottom	=	new D3DXPLANE;
	m_pPlaneSides[0]=	new D3DXPLANE;
	m_pPlaneSides[1]=	new D3DXPLANE;
	m_pPlaneSides[2]=	new D3DXPLANE;
	m_pPlaneSides[3]=	new D3DXPLANE;

	m_pCollideInfo	=	new CollideInfo;

	m_vCenterPoint.x = 0.f;
	m_vCenterPoint.y = 0.f;
	m_vCenterPoint.z = 0.f;
}