コード例 #1
0
ファイル: ZCrossHair.cpp プロジェクト: Asunaya/RefinedGunz
void ZCrossHair::Draw(MDrawContext* pDC)
{
	if(!m_bVisible) return;
	if (g_pGame->m_pMyCharacter == NULL) return;

	const float sizefactor = (float)MGetWorkspaceWidth() / (float)800  * 1.f;

	MPOINT center(MGetWorkspaceWidth()/2,MGetWorkspaceHeight()/2);

	float fFactor = g_pGame->m_pMyCharacter->GetCAFactor();
	fFactor = fFactor +0.2f;

#ifdef CROSSHAIR_PICK
	switch(m_nStatus)
	{
		case ZCS_NORMAL:	
		{
			DrawCrossHair(pDC, m_pBitmaps, center, sizefactor, fFactor); 
		}
		break;
		case ZCS_PICKENEMY:	
		{
			if (m_pPickBitmaps[CH_CENTER] != NULL)
				DrawCrossHair(pDC, m_pPickBitmaps, center, sizefactor, fFactor); 
			else DrawCrossHair(pDC, m_pBitmaps, center, sizefactor, fFactor); 
		}
		break;
	}
#else
	DrawCrossHair(pDC, m_pBitmaps, center, sizefactor, fFactor);
#endif
}
コード例 #2
0
void RenderingManagerC::update()
{

	

	// Clear the backbuffer to a blue color
	    g_pd3dDevice->Clear( 0L, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER|D3DCLEAR_STENCIL, 
	                         D3DCOLOR_XRGB(0,0,255), 1.0f, 0L );
	
	    // Begin the scene
	    g_pd3dDevice->BeginScene();
	
		DrawBackground();
		DrawPlayer();
		
		DrawRaycast();

		DrawPortal(true);
		DrawPortal(false);

		DrawCrossHair();
		//DrawBox(71.0f, 673.0f, 1218.0f, 673.0f, 0x00000000, 0xFFFFFFFF);
		DrawStaticObjects();

	

		DrawTurrents();
	    // End the scene
	    g_pd3dDevice->EndScene();

		// Present the backbuffer contents to the display
		g_pd3dDevice->Present( NULL, NULL, NULL, NULL );
}
コード例 #3
0
ファイル: ZCrossHair.cpp プロジェクト: Asunaya/RefinedGunz
void ZCrossHair::OnDrawOptionCrossHairPreview(void* pCanvas, MDrawContext *pDC)
{
	MBitmap* pBitmaps[CH_MAX] = {NULL, };

	int nSelIndex = 0;
	MComboBox* pComboBox = (MComboBox*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget("CrossHairComboBox");
	if (pComboBox)
	{
		nSelIndex = pComboBox->GetSelIndex();
	}

	int width = 64, height = 64;
	if (pCanvas != NULL)
	{
		ZCanvas* pcanvas = (ZCanvas*)pCanvas;
		width = pcanvas->GetClientRect().w;
		height = pcanvas->GetClientRect().h;
	}

	GetBitmaps(pBitmaps, NULL, ZCrossHairPreset(nSelIndex));

	pDC->SetColor(0, 0, 0);
	pDC->FillRectangle(0, 0, width, height);
	

	float sizefactor = 1.0f;
	MPOINT center(width/2,height/2);
	float fFactor = 0.5f + 0.2f;

	DrawCrossHair(pDC, pBitmaps, center, sizefactor, fFactor);

	pDC->SetColor(128, 128, 128);
	pDC->Rectangle(0,0,width, height);
}
コード例 #4
0
void EDA_DRAW_PANEL::CrossHairOn( wxDC* DC )
{
    ++m_cursorLevel;
    DrawCrossHair( DC );

    if( m_cursorLevel > 0 )  // Shouldn't happen, but just in case ..
        m_cursorLevel = 0;
}
コード例 #5
0
void ProjectPoints::ShowReprojectionErrors()
{
	for (int i = 0; i < projectpoints.size(); i++)
	{
		visibility.push_back(1);
		circle(inputimage, projectpoints[i], 3, cv::Scalar(255, 0, 0));
		DrawCrossHair(inputimage, originpoints[i]);
		//line(inputimage, projectpoints[i], originpoints[i], cv::Scalar(255, 0, 0));
	}
	double err = cv::norm(cv::Mat(originpoints), cv::Mat(projectpoints), CV_L2);
	err = std::sqrt(err*err / projectpoints.size());
	//std::cout << "reprojection error: " << err << std::endl;
	cv::imshow("Reprojection_2D", inputimage);
	cv::waitKey();
}
コード例 #6
0
void ProjectPoints::ShowDifferenceSBA(std::vector<cv::Point2f> pointsbeforesba)
{
	std::vector<cv::KeyPoint> keypointsbeforesba;
	std::vector<cv::KeyPoint> keypointsaftersba;
	cv::KeyPoint::convert(pointsbeforesba, keypointsbeforesba);
	cv::KeyPoint::convert(projectpoints, keypointsaftersba);
	cv::drawKeypoints(inputimage, keypointsbeforesba, inputimage,cv::Scalar(255,255,0));
	cv::drawKeypoints(inputimage, keypointsaftersba, inputimage, cv::Scalar(0, 255, 0));
	for (int i = 0; i < projectpoints.size(); i++)
	{
		DrawCrossHair(inputimage, originpoints[i]);
		//line(inputimage, projectpoints[i], originpoints[i], cv::Scalar(255, 0, 0));
	}
	double err = cv::norm(cv::Mat(pointsbeforesba), cv::Mat(projectpoints), CV_L2);
	err = std::sqrt(err*err / projectpoints.size());
	//std::cout << "error: " << err << std::endl;
	cv::imshow("difference before-after sba",inputimage);
	cv::waitKey();
}
コード例 #7
0
void EDA_DRAW_PANEL::CrossHairOff( wxDC* DC )
{
    DrawCrossHair( DC );
    --m_cursorLevel;
}