Пример #1
0
	void DrawMask( float fPercent )
	{
		RectI rect;

		int iChamber;
		float fChamberOverflowPercent;
		GetChamberIndexAndOverslow( fPercent, iChamber, fChamberOverflowPercent );
		float fRightPercent = GetRightEdgePercent( iChamber, fChamberOverflowPercent );
		float fHeightPercent = GetHeightPercent( iChamber, fChamberOverflowPercent );
		float fChamberLeftPercent = GetChamberLeftPercent( iChamber );
		float fChamberRightPercent = GetChamberRightPercent( iChamber );

		// draw mask for vertical chambers
		rect.left	= int(-METER_WIDTH/2 + fChamberLeftPercent*METER_WIDTH-1);
		rect.top	= int(-METER_HEIGHT/2);
		rect.right	= int(-METER_WIDTH/2 + fChamberRightPercent*METER_WIDTH+1);
		rect.bottom	= int(-METER_HEIGHT/2 + fHeightPercent*METER_HEIGHT);

		rect.left  = MIN( rect.left,  + METER_WIDTH/2 );
		rect.right = MIN( rect.right, + METER_WIDTH/2 );

		m_quadMask.StretchTo( rect );
		m_quadMask.Draw();

		// draw mask for horizontal chambers
		rect.left	= (int)(-METER_WIDTH/2 + fRightPercent*METER_WIDTH); 
		rect.top	= -METER_HEIGHT/2;
		rect.right	= +METER_WIDTH/2;
		rect.bottom	= +METER_HEIGHT/2;

		rect.left  = MIN( rect.left,  + METER_WIDTH/2 );
		rect.right = MIN( rect.right, + METER_WIDTH/2 );

		m_quadMask.StretchTo( rect );
		m_quadMask.Draw();
	}
Пример #2
0
void StreamDisplay::DrawMask( float fPercent )
{
	RectF rect;

	int iChamber;
	float fChamberOverflowPercent;
	GetChamberIndexAndOverslow( fPercent, iChamber, fChamberOverflowPercent );
	float fRightPercent = GetRightEdgePercent( iChamber, fChamberOverflowPercent );
	float fHeightPercent = GetHeightPercent( iChamber, fChamberOverflowPercent );
	float fChamberLeftPercent = GetChamberLeftPercent( iChamber );
	float fChamberRightPercent = GetChamberRightPercent( iChamber );

	// draw mask for vertical chambers
	rect.left	= -m_fMeterWidth/2 + fChamberLeftPercent*m_fMeterWidth-1;
	rect.top	= -m_fMeterHeight/2;
	rect.right	= -m_fMeterWidth/2 + fChamberRightPercent*m_fMeterWidth+1;
	rect.bottom	= -m_fMeterHeight/2 + fHeightPercent*m_fMeterHeight;

	rect.left  = MIN( rect.left,  + m_fMeterWidth/2 );
	rect.right = MIN( rect.right, + m_fMeterWidth/2 );

	m_quadMask.StretchTo( rect );
	m_quadMask.Draw();

	// draw mask for horizontal chambers
	rect.left	= -m_fMeterWidth/2 + fRightPercent*m_fMeterWidth; 
	rect.top	= -m_fMeterHeight/2;
	rect.right	= +m_fMeterWidth/2;
	rect.bottom	= +m_fMeterHeight/2;

	rect.left  = MIN( rect.left,  + m_fMeterWidth/2 );
	rect.right = MIN( rect.right, + m_fMeterWidth/2 );

	m_quadMask.StretchTo( rect );
	m_quadMask.Draw();
}