diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-02-20 06:49:24 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-02-20 06:49:24 +0000 |
commit | 3d32a2e2b6d6986ba2f84b01d071ad87c091d543 (patch) | |
tree | edfecb049ba97267343cc174570ecc7c3b4d6caf /guilib/GUIWindowManager.cpp | |
parent | 2a7c5c5c461d6fa86046090fbe9e559ab725d65b (diff) |
cleanup: Merged CGUIWindowManager::Render() and CGUIWindowManager::RenderDialogs()
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27996 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIWindowManager.cpp')
-rw-r--r-- | guilib/GUIWindowManager.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/guilib/GUIWindowManager.cpp b/guilib/GUIWindowManager.cpp index e161adeb29..6b82842aac 100644 --- a/guilib/GUIWindowManager.cpp +++ b/guilib/GUIWindowManager.cpp @@ -473,6 +473,11 @@ bool CGUIWindowManager::OnAction(const CAction &action) return false; } +bool RenderOrderSortFunction(CGUIWindow *first, CGUIWindow *second) +{ + return first->GetRenderOrder() < second->GetRenderOrder(); +} + void CGUIWindowManager::Render() { assert(g_application.IsCurrentThread()); @@ -480,6 +485,16 @@ void CGUIWindowManager::Render() CGUIWindow* pWindow = GetWindow(GetActiveWindow()); if (pWindow) pWindow->Render(); + + // we render the dialogs based on their render order. + vector<CGUIWindow *> renderList = m_activeDialogs; + stable_sort(renderList.begin(), renderList.end(), RenderOrderSortFunction); + + for (iDialog it = renderList.begin(); it != renderList.end(); ++it) + { + if ((*it)->IsDialogRunning()) + (*it)->Render(); + } } void CGUIWindowManager::FrameMove() @@ -496,26 +511,6 @@ void CGUIWindowManager::FrameMove() (*it)->FrameMove(); } -bool RenderOrderSortFunction(CGUIWindow *first, CGUIWindow *second) -{ - return first->GetRenderOrder() < second->GetRenderOrder(); -} - -void CGUIWindowManager::RenderDialogs() -{ - CSingleLock lock(g_graphicsContext); - // find the window with the lowest render order - vector<CGUIWindow *> renderList = m_activeDialogs; - stable_sort(renderList.begin(), renderList.end(), RenderOrderSortFunction); - - // iterate through and render if they're running - for (iDialog it = renderList.begin(); it != renderList.end(); ++it) - { - if ((*it)->IsDialogRunning()) - (*it)->Render(); - } -} - CGUIWindow* CGUIWindowManager::GetWindow(int id) const { if (id == WINDOW_INVALID) |