Permalink
Browse files

[rbp] include refresh rate in resolution check so we see all and get …

…the right one
  • Loading branch information...
1 parent 05cee69 commit c853cb6614ac8367fa3c7ace04a943af84882199 @huceke huceke committed Aug 10, 2012
Showing with 8 additions and 5 deletions.
  1. +2 −2 xbmc/settings/GUIWindowSettingsCategory.cpp
  2. +5 −3 xbmc/windowing/WinSystem.cpp
  3. +1 −0 xbmc/windowing/WinSystem.h
@@ -2276,12 +2276,12 @@ void CGUIWindowSettingsCategory::FillInResolutions(CStdString strSetting, Displa
for (unsigned int idx = 0; idx < resolutions.size(); idx++)
{
CStdString strRes;
- strRes.Format("%dx%d", resolutions[idx].width, resolutions[idx].height);
+ strRes.Format("%dx%d @%dHz", resolutions[idx].width, resolutions[idx].height, resolutions[idx].refresh);
pControl->AddLabel(strRes, resolutions[idx].ResInfo_Index);
RESOLUTION_INFO res1 = g_settings.m_ResInfo[res];
RESOLUTION_INFO res2 = g_settings.m_ResInfo[resolutions[idx].ResInfo_Index];
- if (res1.iScreen == res2.iScreen && res1.iWidth == res2.iWidth && res1.iHeight == res2.iHeight)
+ if (res1.iScreen == res2.iScreen && res1.iWidth == res2.iWidth && res1.iHeight == res2.iHeight && (int)res1.fRefreshRate == (int)res2.fRefreshRate)
spinres = (RESOLUTION) resolutions[idx].ResInfo_Index;
}
}
@@ -107,19 +107,21 @@ static void AddResolution(vector<RESOLUTION_WHR> &resolutions, unsigned int addi
{
int width = g_settings.m_ResInfo[addindex].iWidth;
int height = g_settings.m_ResInfo[addindex].iHeight;
+ int refresh = g_settings.m_ResInfo[addindex].fRefreshRate + 0.5;
for (unsigned int idx = 0; idx < resolutions.size(); idx++)
- if (resolutions[idx].width == width && resolutions[idx].height == height)
+ if (resolutions[idx].width == width && resolutions[idx].height == height && resolutions[idx].refresh == refresh)
return; // already taken care of.
- RESOLUTION_WHR res = {width, height, addindex};
+ RESOLUTION_WHR res = {width, height, refresh, addindex};
resolutions.push_back(res);
}
static bool resSortPredicate (RESOLUTION_WHR i, RESOLUTION_WHR j)
{
return ( i.width < j.width
- || (i.width == j.width && i.height < j.height));
+ || (i.width == j.width && i.height < j.height)
+ || (i.width == j.width && i.height == j.height && i.refresh < j.refresh));
}
vector<RESOLUTION_WHR> CWinSystemBase::ScreenResolutions(int screen)
@@ -41,6 +41,7 @@ struct RESOLUTION_WHR
{
int width;
int height;
+ int refresh;
int ResInfo_Index;
};

0 comments on commit c853cb6

Please sign in to comment.