-Fix viewport converting the scren in grayness, fixes #3406

This commit is contained in:
Juan Linietsky 2016-01-22 18:54:43 -03:00
parent e7eb332799
commit 9d571d8eac

View file

@ -331,20 +331,24 @@ void Viewport::_notification(int p_what) {
} }
} }
parent=NULL;
Node *parent_node=get_parent();
while(parent_node) {
parent = parent_node->cast_to<Viewport>();
if (parent)
break;
parent_node=parent_node->get_parent();
}
if (!render_target) if (!render_target)
_vp_enter_tree(); _vp_enter_tree();
this->parent=NULL;
Node *parent=get_parent();
if (parent) {
while(parent && !(this->parent=parent->cast_to<Viewport>())) {
parent=parent->get_parent();
}
}
current_canvas=find_world_2d()->get_canvas(); current_canvas=find_world_2d()->get_canvas();
VisualServer::get_singleton()->viewport_set_scenario(viewport,find_world()->get_scenario()); VisualServer::get_singleton()->viewport_set_scenario(viewport,find_world()->get_scenario());