Skip to content

Commit

Permalink
[rendering] fixed split resolution in view mode setting and fix displ…
Browse files Browse the repository at this point in the history
…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
huceke committed Oct 21, 2012
1 parent 7e89d79 commit 6b54527
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions xbmc/cores/VideoRenderers/BaseRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;

Expand Down
7 changes: 6 additions & 1 deletion xbmc/video/windows/GUIWindowFullScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6b54527

Please sign in to comment.