Exemplo n.º 1
0
/*****************************************************************
 * 
 * method :void		DrawCurrentPage(CDC *inDC)
 *
 * parameters : inCDC a device context
 *
 * returns : nothing
 *
 * description: Draw the current page
 *
 *
 ****************************************************************/
void		CEasyReport::DrawCurrentPage(CDC *inDC)
{
	int			i,aStart, aMax;
	CElement	*aElem;
	
	if( m_CurPage != 0 )
		aStart = m_PageItems[m_CurPage-1];
	else
		aStart = 0;
	aMax = m_PageItems[m_CurPage];
	for( i =aStart;i< aMax;i++)
	{
		aElem = (CElement *)m_ReportItems[i];
		aElem->Draw(inDC);
	}


/*	
	CRect	aRect(m_LeftMargin, -m_TopMargin, 
				m_PageWidth - m_RightMargin, -(m_PageHeight-m_BottomMargin));
	inDC->MoveTo(aRect.left, aRect.top);
	inDC->LineTo(aRect.right,aRect.top);
	inDC->LineTo(aRect.right, aRect.bottom);
	inDC->LineTo(aRect.left, aRect.bottom);
	inDC->LineTo(aRect.left, aRect.top);
*/	
}
Exemplo n.º 2
0
void CCell::Draw(CDC *pDC)
{
	POSITION pos;
	CElement *pElement;
	for(pos=m_Elements.GetHeadPosition();pos!=NULL;){
		pElement=(CElement *)(m_Elements.GetNext(pos));
		pElement->Draw(pDC);
	}
}
void CSkViewView::OnDraw(CDC* pDC)
{
	CSkViewDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;

  POSITION aPos = pDoc->GetListHeadPosition();
  CElement* pElement = 0;
  while(aPos)
  {
    pElement = pDoc->GetNext(aPos);
    if(pDC->RectVisible(pElement->GetBoundRect()))
      pElement->Draw(pDC);
  }
}
void CSketcherView::OnDraw(CDC* pDC)
{
  CSketcherDoc* pDoc = GetDocument();
  ASSERT_VALID(pDoc);
  if(!pDoc)
    return;

  POSITION aPos = pDoc->GetListHeadPosition();
  CElement* pElement = 0;              // Store for an element pointer
  while(aPos)                          // Loop while aPos is not null
  {
    pElement = pDoc->GetNext(aPos);    // Get the current element pointer
    // If the element is visible...
    if(pDC->RectVisible(pElement->GetBoundRect()))
      pElement->Draw(pDC, m_pSelected);// ...draw it
  }
}
Exemplo n.º 5
0
void CGame::GameMain()
{

	int i;

	CShanaProt*	player1;
	CShanaProt*	player2;

	m_Mode = m_NextMode ;
	switch( m_Mode ){
		case 0:
			// タイトルのスタート
			m_ModeTitle = new(m_CommonMode) CModeTitle( this );
			SetMode( 2 );
			break;

		case 1:
			// バトルモードスタート
			new(m_CommonMode) CModeBattle( this, m_ModeCharaSel->GetDecideChara( 0 ), m_ModeCharaSel->GetDecideChara( 1 ));
			SetMode( 2 );
			break;

		case 3:
			// タイトルモードの削除	
			if( m_ModeTitle != NULL ){
				delete m_ModeTitle;
				m_ModeTitle = NULL;
			}
			if( m_ModeCharaSel != NULL ){
				delete m_ModeCharaSel;
				m_ModeCharaSel = NULL;
			}
			SetMode( 2 );
			break;

		case 4:
			// 
			new(m_CommonMode) CModeBattle( this );
			SetMode( 2 );
			break;

		case 5:
			// キャラセレクトのスタート
			m_ModeCharaSel = new(m_CommonMode) CModeCharaSelect( this );
			if( m_ModeTitle != NULL ){
				delete m_ModeTitle;
				m_ModeTitle = NULL;
			}
			SetMode( 2 );
			break;

	}

	m_Input->UpDateState();

	CElement*	cEle;
	CElement*	cEleNext;

	// MOVE Main
	cEle = m_CommonMode->m_ActiveTask->m_Next;
	while( cEle->m_Next != m_CommonMode->m_ActiveTask->m_Next ){
		cEleNext = cEle->m_Next ;
		if( cEle->Move() == FALSE ){
			delete cEle;
		}
		else{
			cEle->Action();
			cEle->ActionFinalize();
			cEle->Interfere();
			cEle->InterfereFinalize();
		}
		cEle = cEleNext ;
	}

	// Begin the scene.
	LPDIRECT3DDEVICE9 d3ddevice;
	d3ddevice = m_D3DDraw.GetDevice();
	d3ddevice->BeginScene();
	// 画面クリア
	d3ddevice->Clear(0,NULL,D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,D3DCOLOR_XRGB(0,0,0),1.0f,0);

/*	for( i=0 ; i<4 ; i++ ){
		if( m_DispObjGroup->m_CDisp[i].m_Visible == TRUE ){
			m_D3DDraw.Draw( &m_DispObjGroup->m_CDisp[i] );
		}
	}
*/
	cEle = m_CommonMode->m_ActiveTask->m_Next;
	while( cEle->m_Next != m_CommonMode->m_ActiveTask->m_Next ){
		cEleNext = cEle->m_Next ;
		cEle->Draw( &m_D3DDraw );
		cEle->DrawFinalize();
		cEle = cEleNext ;
	}

	d3ddevice->EndScene();

//	CFps::GetCFps()->WaitNextUpdate();

	// 画面に表示(バッファスワップ)
	d3ddevice->Present( NULL, NULL, NULL, NULL );

}