示例#1
0
void CHudRadar::DrawPositionOnRadar( Vector vecPos, C_BasePlayer *pLocalPlayer, int type, int flags, int r, int g, int b, int a )
{
    float x, y, z_delta;
    int iBaseDotSize = 3;

    QAngle viewAngle = pLocalPlayer->EyeAngles();

    if( m_pVehicle != NULL )
    {
        viewAngle = m_pVehicle->GetAbsAngles();
        viewAngle.y += 90.0f;
    }

    float flScale;

    WorldToRadar( vecPos, pLocalPlayer->GetAbsOrigin(), viewAngle, x, y, z_delta, flScale );

    if( flags & RADAR_IGNORE_Z )
        z_delta = 0;

    switch( type )
    {
    case RADAR_CONTACT_GENERIC:
        r =	255;
        g = 170;
        b = 0;
        iBaseDotSize *= 2;
        break;
    case RADAR_CONTACT_MAGNUSSEN_RDU:
        r =	0;
        g = 200;
        b = 255;
        iBaseDotSize *= 2;
        break;
    case RADAR_CONTACT_ENEMY:
        r = 255;
        g = 0;
        b = 0;
        iBaseDotSize *= 2;
        break;
    case RADAR_CONTACT_LARGE_ENEMY:
        r = 255;
        g = 0;
        b = 0;
        iBaseDotSize *= 3;
        break;
    }

    DrawRadarDot( x, y, z_delta, iBaseDotSize, flags, r, g, b, a );
}
示例#2
0
void CHudRadar::DrawZAxis( Vector pos, int r, int g, int b, int a )
{
	const float diff = 128;

	if( pos.z > -diff && pos.z < diff )
	{
		DrawRadarDot( pos.x, pos.y, r, g, b, a );
	}
	else if( pos.z <= -diff )
	{
		// higher than player
		DrawT( pos.x, pos.y, r, g, b, a );
	}
	else
	{
		// lower than player
		DrawFlippedT( pos.x, pos.y, r, g, b, a );
	}
}