All pastes #90607 Raw Edit

Someone

public text v1 · immutable
#90607 ·published 2006-07-17 21:08 UTC
rendered paste body
void RenderCameraView( vec3_t origin, float x, float y, float w, float h, float fov, vec3_t angle, char * szTitle, bool bAimspot )
{
	static vec4_t colCamSpot = { 1.0f, 1.0f, 0.0f, 1.0f };
	static vec4_t colCamText = { 1.0f, 1.0f, 1.0f, 1.0f };

	refdef_t rfCam;
	memcpy( &rfCam, &Client.pcg->refdef, sizeof( refdef_t ) );

	float iX = x;
	float iY = y;
	float iW = w;
	float iH = h;
	CG_AdjustFrom640( &iX, &iY, &iH, &iW );

	rfCam.x			= (int)iX;
	rfCam.y			= (int)iY;
	rfCam.height	= (int)iH;
	rfCam.width		= (int)iW;
	rfCam.fov_x		= fov;
	rfCam.fov_y		= fov;
	VectorCopy( origin, rfCam.vieworg );

	AnglesToAxis( angle, rfCam.viewaxis );

	((Syscall_t)fdSyscall.GetTrampoline())( CG_R_CLEARSCENE );
	for (UINT i = 0; i < refEntities.size(); i++)
	{
		if ( refEntities[i].entityNum > 0 )
			((Syscall_t)fdSyscall.GetTrampoline())(CG_R_ADDREFENTITYTOSCENE, &refEntities[i]);	// add
	}

	// Render
	((Syscall_t)fdSyscall.GetTrampoline())( CG_R_RENDERSCENE, &rfCam );

	// Wnd text
	CG_DrawStringExt( (int)x, (int)y, szTitle, colCamText, true, true, 8, 8, -1);

	// Aimspot 
	if ( bAimspot ) 
		CG_FillRect( x+ w/2, y + h/2, 4, 4, colCamSpot);

}