示例#1
0
// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CScreenDisplay::UpdateResolutionColor()
//
//	PURPOSE:	update the color of the resolution based on memory usage
//
// ----------------------------------------------------------------------- //
void CScreenDisplay::UpdateResolutionColor()
{
	if( !m_pResolutionCtrl) return;

	if( CPerformanceMgr::Instance().ArePerformanceCapsValid() )
	{
		float fMemoryUsed	= CPerformanceMgr::Instance().EstimateVideoMemoryUsage();
		float fMemoryTotal	= (float)CPerformanceMgr::Instance().GetPerformanceStats().m_nGPUMemory;
		if ( fMemoryUsed > fMemoryTotal )
		{
			m_pResolutionCtrl->SetColor( m_nWarningColor );
		}
		else
		{
			m_pResolutionCtrl->SetColor( m_NonSelectedColor );
		}
	}

	ScreenDisplayResolution res = GetCurrentSelectedResolution();
	uint32 testWidth = (res.m_dwHeight * 4 / 3);
	if (res.m_dwWidth != testWidth)
	{
		m_pWarning->Show(true);
	}
	else
	{
		m_pWarning->Show(false);

	}


}
LTBOOL CFolderDisplay::OnRButtonUp(int x, int y)
{
	// Get the control that the click was on
	int nControlIndex=0;
	if (GetControlUnderPoint(x, y, &nControlIndex))
	{
		CLTGUICtrl* pCtrl = GetControl(nControlIndex);
		if (m_pCaptureCtrl && pCtrl != m_pCaptureCtrl)
            return LTFALSE;

		// If the mouse is over the same control now as it was when the down message was called
		// then send the "left" message to the control.
		if (nControlIndex == m_nRMouseDownItemSel)
		{
			if (pCtrl->IsEnabled())
			{
				if (GetSelectedControl() == m_pRendererCtrl)
				{

					// Get the current resolution
					FolderDisplayResolution currentResolution=GetCurrentSelectedResolution();
                    LTBOOL handled = pCtrl->OnRButtonUp(x,y);
					if (handled)
					{
						SetupResolutionCtrl();
						// Set the resolution for the control
						SetCurrentCtrlResolution(currentResolution);
					}
					return handled;
				}
				else if (pCtrl == m_pHardwareCursor)
				{
					return OnLeft();
				}
				else
				{
					SetSelection(nControlIndex);
					return CBaseFolder::OnRButtonUp(x,y);
				}
			}
		}
	}
	else
	{
		m_nRMouseDownItemSel= kNoSelection;
	}
    return LTFALSE;
}
示例#3
0
// Override the right control
void CMenuDisplay::OnRight()
{
	// Get the current resolution
	MenuDisplayResolution currentResolution=GetCurrentSelectedResolution();

	CMenuBase::OnRight();

	// If the renderer control is selected, rebuild the resolutions control
	if (GetCurrentItem() == m_pRendererCtrl)
	{
		SetupResolutionCtrl();

		// Set the resolution for the control
		SetCurrentCtrlResolution(currentResolution);
	}
}