aboutsummaryrefslogtreecommitdiff
path: root/guilib
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-01-09 01:58:59 +0000
committerjmarshallnz <jmarshallnz@svn>2010-01-09 01:58:59 +0000
commit2e370e36232d786c71a86802ef64c301b977b940 (patch)
treee319c2f6c364eaa1b9584f3453abf75bbd18a0d0 /guilib
parent119888ed65f922e0c0af29765503295f02a2a66c (diff)
cleanup: removed unnecessary arguments from SetScalingResolution and SetRenderingResolution
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26565 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r--guilib/GUIFontManager.cpp4
-rw-r--r--guilib/GUIWindow.cpp8
-rw-r--r--guilib/GraphicContext.cpp13
-rw-r--r--guilib/GraphicContext.h4
4 files changed, 14 insertions, 15 deletions
diff --git a/guilib/GUIFontManager.cpp b/guilib/GUIFontManager.cpp
index e561de8dff..f32efe476b 100644
--- a/guilib/GUIFontManager.cpp
+++ b/guilib/GUIFontManager.cpp
@@ -65,7 +65,7 @@ CGUIFont* GUIFontManager::LoadTTF(const CStdString& strFontName, const CStdStrin
// set scaling resolution so that we can scale our font sizes correctly
// as fonts aren't scaled at render time (due to aliasing) we must scale
// the size of the fonts before they are drawn to bitmaps
- g_graphicsContext.SetScalingResolution(sourceRes, 0, 0, true);
+ g_graphicsContext.SetScalingResolution(sourceRes, true);
// adjust aspect ratio
if (sourceRes == RES_PAL_16x9 || sourceRes == RES_PAL60_16x9 || sourceRes == RES_NTSC_16x9 || sourceRes == RES_HDTV_480p_16x9)
@@ -188,7 +188,7 @@ void GUIFontManager::ReloadTTFFonts(void)
CStdString& strPath = fontInfo.fontFilePath;
CStdString& strFilename = fontInfo.fileName;
- g_graphicsContext.SetScalingResolution(fontInfo.sourceRes, 0, 0, true);
+ g_graphicsContext.SetScalingResolution(fontInfo.sourceRes, true);
if (fontInfo.sourceRes == RES_PAL_16x9 || fontInfo.sourceRes == RES_PAL60_16x9 || fontInfo.sourceRes == RES_NTSC_16x9 || fontInfo.sourceRes == RES_HDTV_480p_16x9)
aspect *= 0.75f;
diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp
index 7c86de713a..9c43d48fbc 100644
--- a/guilib/GUIWindow.cpp
+++ b/guilib/GUIWindow.cpp
@@ -134,7 +134,7 @@ bool CGUIWindow::Load(TiXmlDocument &xmlDoc)
// set the scaling resolution so that any control creation or initialisation can
// be done with respect to the correct aspect ratio
- g_graphicsContext.SetScalingResolution(m_coordsRes, 0, 0, m_needsScaling);
+ g_graphicsContext.SetScalingResolution(m_coordsRes, m_needsScaling);
// Resolve any includes that may be present
g_SkinInfo.ResolveIncludes(pRootElement);
@@ -312,7 +312,7 @@ void CGUIWindow::Render()
// to occur.
if (!m_bAllocated) return;
- g_graphicsContext.SetRenderingResolution(m_coordsRes, 0, 0, m_needsScaling);
+ g_graphicsContext.SetRenderingResolution(m_coordsRes, m_needsScaling);
unsigned int currentTime = CTimeUtils::GetFrameTime();
// render our window animation - returns false if it needs to stop rendering
@@ -380,7 +380,7 @@ CPoint CGUIWindow::GetOrigin()
// OnMouseAction - called by OnAction()
bool CGUIWindow::OnMouseAction()
{
- g_graphicsContext.SetScalingResolution(m_coordsRes, 0, 0, m_needsScaling);
+ g_graphicsContext.SetScalingResolution(m_coordsRes, m_needsScaling);
CPoint mousePoint(g_Mouse.GetLocation());
g_graphicsContext.InvertFinalCoords(mousePoint.x, mousePoint.y);
@@ -858,7 +858,7 @@ void CGUIWindow::SetDefaults()
CRect CGUIWindow::GetScaledBounds() const
{
CSingleLock lock(g_graphicsContext);
- g_graphicsContext.SetScalingResolution(m_coordsRes, 0, 0, m_needsScaling);
+ g_graphicsContext.SetScalingResolution(m_coordsRes, m_needsScaling);
CRect rect(m_posX, m_posY, m_posX + m_width, m_posY + m_height);
float z = 0;
g_graphicsContext.ScaleFinalCoords(rect.x1, rect.y1, z);
diff --git a/guilib/GraphicContext.cpp b/guilib/GraphicContext.cpp
index be74eeb8b5..34b0a0d1f1 100644
--- a/guilib/GraphicContext.cpp
+++ b/guilib/GraphicContext.cpp
@@ -525,7 +525,7 @@ void CGraphicContext::ApplyStateBlock()
g_Windowing.ApplyStateBlock();
}
-void CGraphicContext::SetScalingResolution(RESOLUTION res, float posX, float posY, bool needsScaling)
+void CGraphicContext::SetScalingResolution(RESOLUTION res, bool needsScaling)
{
Lock();
m_windowResolution = res;
@@ -569,21 +569,20 @@ void CGraphicContext::SetScalingResolution(RESOLUTION res, float posX, float pos
m_guiScaleX = fFromWidth / fToWidth;
m_guiScaleY = fFromHeight / fToHeight;
- TransformMatrix windowOffset = TransformMatrix::CreateTranslation(posX, posY);
TransformMatrix guiScaler = TransformMatrix::CreateScaler(fToWidth / fFromWidth, fToHeight / fFromHeight, fToHeight / fFromHeight);
TransformMatrix guiOffset = TransformMatrix::CreateTranslation(fToPosX, fToPosY);
- m_guiTransform = guiOffset * guiScaler * windowOffset;
+ m_guiTransform = guiOffset * guiScaler;
}
else
{
- m_guiTransform = TransformMatrix::CreateTranslation(posX, posY);
+ m_guiTransform.Reset();
m_guiScaleX = 1.0f;
m_guiScaleY = 1.0f;
}
// reset our origin and camera
while (m_origins.size())
m_origins.pop();
- m_origins.push(CPoint(posX, posY));
+ m_origins.push(CPoint(0, 0));
while (m_cameras.size())
m_cameras.pop();
m_cameras.push(CPoint(0.5f*m_iScreenWidth, 0.5f*m_iScreenHeight));
@@ -593,10 +592,10 @@ void CGraphicContext::SetScalingResolution(RESOLUTION res, float posX, float pos
Unlock();
}
-void CGraphicContext::SetRenderingResolution(RESOLUTION res, float posX, float posY, bool needsScaling)
+void CGraphicContext::SetRenderingResolution(RESOLUTION res, bool needsScaling)
{
Lock();
- SetScalingResolution(res, posX, posY, needsScaling);
+ SetScalingResolution(res, needsScaling);
UpdateCameraPosition(m_cameras.top());
Unlock();
}
diff --git a/guilib/GraphicContext.h b/guilib/GraphicContext.h
index 3f31028899..9dbe36489f 100644
--- a/guilib/GraphicContext.h
+++ b/guilib/GraphicContext.h
@@ -102,8 +102,8 @@ public:
void GetAllowedResolutions(std::vector<RESOLUTION> &res);
// output scaling
- void SetRenderingResolution(RESOLUTION res, float posX, float posY, bool needsScaling); ///< Sets scaling up for rendering
- void SetScalingResolution(RESOLUTION res, float posX, float posY, bool needsScaling); ///< Sets scaling up for skin loading etc.
+ void SetRenderingResolution(RESOLUTION res, bool needsScaling); ///< Sets scaling up for rendering
+ void SetScalingResolution(RESOLUTION res, bool needsScaling); ///< Sets scaling up for skin loading etc.
float GetScalingPixelRatio() const;
void Flip();
void InvertFinalCoords(float &x, float &y) const;