aboutsummaryrefslogtreecommitdiff
path: root/guilib
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-02-13 22:33:08 +0000
committerjmarshallnz <jmarshallnz@svn>2010-02-13 22:33:08 +0000
commit3fed3fbfd3bb875e149525de8b08b3214f425b02 (patch)
treef887254a17b23d4e65db25bf8e954d4c3dacaaad /guilib
parentc74f39d9ff5f3757ac4a826b53e2c2c50ec359f3 (diff)
cleanup: use a CPoint temporary instead of two floats
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27738 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r--guilib/GUIBaseContainer.cpp13
-rw-r--r--guilib/GUIPanelContainer.cpp13
2 files changed, 12 insertions, 14 deletions
diff --git a/guilib/GUIBaseContainer.cpp b/guilib/GUIBaseContainer.cpp
index 59e1e13f94..9407dafff3 100644
--- a/guilib/GUIBaseContainer.cpp
+++ b/guilib/GUIBaseContainer.cpp
@@ -86,9 +86,8 @@ void CGUIBaseContainer::Render()
FreeMemory(CorrectOffset(offset - cacheBefore, 0), CorrectOffset(offset + m_itemsPerPage + 1 + cacheAfter, 0));
g_graphicsContext.SetClipRegion(m_posX, m_posY, m_width, m_height);
- float posX = m_posX + m_renderOffset.x;
- float posY = m_posY + m_renderOffset.y;
- float pos = (m_orientation == VERTICAL) ? posY : posX;
+ CPoint origin = CPoint(m_posX, m_posY) + m_renderOffset;
+ float pos = (m_orientation == VERTICAL) ? origin.y : origin.x;
float end = (m_orientation == VERTICAL) ? m_posY + m_height : m_posX + m_width;
// we offset our draw position to take into account scrolling and whether or not our focused
@@ -120,9 +119,9 @@ void CGUIBaseContainer::Render()
else
{
if (m_orientation == VERTICAL)
- RenderItem(posX, pos, item.get(), false);
+ RenderItem(origin.x, pos, item.get(), false);
else
- RenderItem(pos, posY, item.get(), false);
+ RenderItem(pos, origin.y, item.get(), false);
}
}
// increment our position
@@ -133,9 +132,9 @@ void CGUIBaseContainer::Render()
if (focusedItem)
{
if (m_orientation == VERTICAL)
- RenderItem(posX, focusedPos, focusedItem.get(), true);
+ RenderItem(origin.x, focusedPos, focusedItem.get(), true);
else
- RenderItem(focusedPos, posY, focusedItem.get(), true);
+ RenderItem(focusedPos, origin.y, focusedItem.get(), true);
}
g_graphicsContext.RestoreClipRegion();
diff --git a/guilib/GUIPanelContainer.cpp b/guilib/GUIPanelContainer.cpp
index 0a8bbd52dd..9fd012c81e 100644
--- a/guilib/GUIPanelContainer.cpp
+++ b/guilib/GUIPanelContainer.cpp
@@ -58,9 +58,8 @@ void CGUIPanelContainer::Render()
FreeMemory(CorrectOffset(offset - cacheBefore, 0), CorrectOffset(offset + cacheAfter + m_itemsPerPage + 1, 0));
g_graphicsContext.SetClipRegion(m_posX, m_posY, m_width, m_height);
- float posX = m_posX + m_renderOffset.x;
- float posY = m_posY + m_renderOffset.y;
- float pos = (m_orientation == VERTICAL) ? posY : posX;
+ CPoint origin = CPoint(m_posX, m_posY) + m_renderOffset;
+ float pos = (m_orientation == VERTICAL) ? origin.y : origin.x;
float end = (m_orientation == VERTICAL) ? m_posY + m_height : m_posX + m_width;
pos += (offset - cacheBefore) * m_layout->Size(m_orientation) - m_scrollOffset;
end += cacheAfter * m_layout->Size(m_orientation);
@@ -88,9 +87,9 @@ void CGUIPanelContainer::Render()
else
{
if (m_orientation == VERTICAL)
- RenderItem(posX + col * m_layout->Size(HORIZONTAL), pos, item.get(), false);
+ RenderItem(origin.x + col * m_layout->Size(HORIZONTAL), pos, item.get(), false);
else
- RenderItem(pos, posY + col * m_layout->Size(VERTICAL), item.get(), false);
+ RenderItem(pos, origin.y + col * m_layout->Size(VERTICAL), item.get(), false);
}
}
// increment our position
@@ -107,9 +106,9 @@ void CGUIPanelContainer::Render()
if (focusedItem)
{
if (m_orientation == VERTICAL)
- RenderItem(posX + focusedCol * m_layout->Size(HORIZONTAL), focusedPos, focusedItem.get(), true);
+ RenderItem(origin.x + focusedCol * m_layout->Size(HORIZONTAL), focusedPos, focusedItem.get(), true);
else
- RenderItem(focusedPos, posY + focusedCol * m_layout->Size(VERTICAL), focusedItem.get(), true);
+ RenderItem(focusedPos, origin.y + focusedCol * m_layout->Size(VERTICAL), focusedItem.get(), true);
}
g_graphicsContext.RestoreClipRegion();