diff options
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) |