Skip to content

Commit

Permalink
Fixed|UI|libdeng2|Stereo 3D: Allow enabling UI composition during bus…
Browse files Browse the repository at this point in the history
…y mode

Fixes an issue where the display would remain black after launching
straight into a map with -g and -warp options.

Also, during libdeng2 Widget tree notification, handle the situation
when a widget is removed from the tree after a notification method
has been called on it.
  • Loading branch information
skyjake committed Dec 4, 2013
1 parent 910ac37 commit 0c7ffe4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 3 additions & 3 deletions doomsday/client/src/ui/clientwindow.cpp
Expand Up @@ -469,9 +469,6 @@ DENG2_OBSERVES(App, StartupComplete)
return Continue;
}

// Offscreen composition is only needed in Oculus Rift mode.
enableCompositor(VR::mode() == VR::MODE_OCULUS_RIFT);

// The canvas needs to be recreated when the GL format has changed
// (e.g., multisampling).
if(needRecreateCanvas)
Expand Down Expand Up @@ -767,6 +764,9 @@ void ClientWindow::draw()
// Don't run the main loop until after the paint event has been dealt with.
ClientApp::app().loop().pause();

// Offscreen composition is only needed in Oculus Rift mode.
d->enableCompositor(VR::mode() == VR::MODE_OCULUS_RIFT);

if(d->performDeferredTasks() == Instance::AbortFrame)
{
// Shouldn't draw right now.
Expand Down
18 changes: 13 additions & 5 deletions doomsday/libdeng2/src/widgets/widget.cpp
Expand Up @@ -396,12 +396,20 @@ Widget::NotifyArgs::Result Widget::notifyTree(NotifyArgs const &args)
{
// The list of children was modified; let's update the current
// index accordingly.
idx = d->children.indexOf(i);
int newIdx = d->children.indexOf(i);

// The current widget cannot be removed.
DENG2_ASSERT(idx >= 0);

i = d->children.at(idx);
// The current widget remains in the tree.
if(newIdx >= 0)
{
idx = newIdx;
i = d->children.at(newIdx);
}
else
{
// The current widget is gone. Continue with the same index.
idx--;
continue;
}
}

// Continue down the tree by notifying any children of this widget.
Expand Down

0 comments on commit 0c7ffe4

Please sign in to comment.