Skip to content
Browse files

[rendering] fixed split resolution in view mode setting and fix displ…

…ay zoom mode

When the GUI height is 720 and the Display height is 1080 we would set the zoom amount to 1.5. So we have to apply the split resolution scaling factor before we do the calculation.
  • Loading branch information...
1 parent 7e89d79 commit 6b54527ad789b8b0394837831d317949168ae684 @huceke committed Oct 21, 2012
Showing with 14 additions and 1 deletion.
  1. +8 −0 xbmc/cores/VideoRenderers/BaseRenderer.cpp
  2. +6 −1 xbmc/video/windows/GUIWindowFullScreen.cpp
View
8 xbmc/cores/VideoRenderers/BaseRenderer.cpp
@@ -582,6 +582,7 @@ void CBaseRenderer::SetViewMode(int viewMode)
RESOLUTION res = GetResolution();
float screenWidth = (float)(g_settings.m_ResInfo[res].Overscan.right - g_settings.m_ResInfo[res].Overscan.left);
float screenHeight = (float)(g_settings.m_ResInfo[res].Overscan.bottom - g_settings.m_ResInfo[res].Overscan.top);
+
if(m_iFlags & CONF_FLAGS_FORMAT_SBS)
screenWidth /= 2;
else if(m_iFlags & CONF_FLAGS_FORMAT_TB)
@@ -592,6 +593,13 @@ void CBaseRenderer::SetViewMode(int viewMode)
bool is43 = (sourceFrameRatio < 8.f/(3.f*sqrt(3.f)) &&
g_settings.m_currentVideoSettings.m_ViewMode == VIEW_MODE_NORMAL);
+ // Splitres scaling factor
+ float xscale = (float)g_settings.m_ResInfo[res].iScreenWidth / (float)g_settings.m_ResInfo[res].iWidth;
+ float yscale = (float)g_settings.m_ResInfo[res].iScreenHeight / (float)g_settings.m_ResInfo[res].iHeight;
+
+ screenWidth *= xscale;
+ screenHeight *= yscale;
+
g_settings.m_fVerticalShift = 0.0f;
g_settings.m_bNonLinStretch = false;
View
7 xbmc/video/windows/GUIWindowFullScreen.cpp
@@ -960,10 +960,15 @@ void CGUIWindowFullScreen::FrameMove()
g_application.m_pPlayer->GetVideoRect(SrcRect, DestRect);
g_application.m_pPlayer->GetVideoAspectRatio(fAR);
{
+ // Splitres scaling factor
+ RESOLUTION res = g_graphicsContext.GetVideoResolution();
+ float xscale = (float)g_settings.m_ResInfo[res].iScreenWidth / (float)g_settings.m_ResInfo[res].iWidth;
+ float yscale = (float)g_settings.m_ResInfo[res].iScreenHeight / (float)g_settings.m_ResInfo[res].iHeight;
+
CStdString strSizing;
strSizing.Format(g_localizeStrings.Get(245),
(int)SrcRect.Width(), (int)SrcRect.Height(),
- (int)DestRect.Width(), (int)DestRect.Height(),
+ (int)(DestRect.Width() * xscale), (int)(DestRect.Height() * yscale),
g_settings.m_fZoomAmount, fAR*g_settings.m_fPixelRatio,
g_settings.m_fPixelRatio, g_settings.m_fVerticalShift);
CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW2);

0 comments on commit 6b54527

Please sign in to comment.
Something went wrong with that request. Please try again.