mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-24 04:46:48 +01:00
More null checks.
This commit is contained in:
parent
ecd2be23a6
commit
729950b86a
@ -61,6 +61,11 @@ void MMMaterial::initialize() {
|
||||
|
||||
for (int i = 0; i < nodes.size(); ++i) {
|
||||
Ref<MMNode> n = nodes[i];
|
||||
|
||||
if (!n.is_valid()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
n->init_properties();
|
||||
n->connect("changed", this, "on_node_changed");
|
||||
}
|
||||
@ -68,6 +73,8 @@ void MMMaterial::initialize() {
|
||||
}
|
||||
|
||||
void MMMaterial::add_node(const Ref<MMNode> &node) {
|
||||
ERR_FAIL_COND(!node.is_valid());
|
||||
|
||||
nodes.push_back(node);
|
||||
Ref<MMNode> n = node;
|
||||
n->connect("changed", this, "on_node_changed");
|
||||
@ -85,13 +92,15 @@ void MMMaterial::remove_node(const Ref<MMNode> &node) {
|
||||
for (int j = 0; j < nodes.size(); ++j) {
|
||||
Ref<MMNode> n = nodes[j];
|
||||
|
||||
if (n.is_valid()) {
|
||||
for (int k = 0; k < n->input_properties.size(); ++k) {
|
||||
Ref<MMNodeUniversalProperty> ip = n->input_properties[k];
|
||||
if (!n.is_valid()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ip->get_input_property() == op) {
|
||||
ip->set_input_property(Ref<MMNodeUniversalProperty>());
|
||||
}
|
||||
for (int k = 0; k < n->input_properties.size(); ++k) {
|
||||
Ref<MMNodeUniversalProperty> ip = n->input_properties[k];
|
||||
|
||||
if (ip->get_input_property() == op) {
|
||||
ip->set_input_property(Ref<MMNodeUniversalProperty>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,11 +27,6 @@ void MMNode::set_input_properties(const Vector<Variant> &val) {
|
||||
input_properties.clear();
|
||||
for (int i = 0; i < val.size(); i++) {
|
||||
Ref<MMNode> e = Ref<MMNode>(val[i]);
|
||||
|
||||
if (!e.is_valid()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
input_properties.push_back(e);
|
||||
}
|
||||
}
|
||||
@ -48,11 +43,6 @@ void MMNode::set_output_properties(const Vector<Variant> &val) {
|
||||
output_properties.clear();
|
||||
for (int i = 0; i < val.size(); i++) {
|
||||
Ref<MMNode> e = Ref<MMNode>(val[i]);
|
||||
|
||||
if (!e.is_valid()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
output_properties.push_back(e);
|
||||
}
|
||||
}
|
||||
@ -86,6 +76,10 @@ bool MMNode::render(const Ref<MMMaterial> &material) {
|
||||
for (int i = 0; i < input_properties.size(); ++i) {
|
||||
Ref<MMNodeUniversalProperty> p = input_properties[i];
|
||||
|
||||
if (!p.is_valid()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (p->get_input_property().is_valid() && p->get_input_property()->get_owner()->get_dirty()) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user