[rendering] fixed split resolution in view mode setting and fix display zoom mode
authorgimli <ebsi4711@gmail.com>
Sun, 21 Oct 2012 10:26:45 +0000 (12:26 +0200)
committergimli <ebsi4711@gmail.com>
Sun, 21 Oct 2012 10:26:45 +0000 (12:26 +0200)
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.

xbmc/cores/VideoRenderers/BaseRenderer.cpp
xbmc/video/windows/GUIWindowFullScreen.cpp

index 91786ec..1e06436 100644 (file)
@@ -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;
 
index dfbcf77..06180ea 100644 (file)
@@ -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);