Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-09-03 15:38:15 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-09-03 15:38:15 +0400
commit0238d032b2d079dbdf8ae96a1128fc3c2e12f548 (patch)
treedfbaf3591be5e03cd47a0704cb363d3f28ec6bc6 /intern/cycles/render/graph.cpp
parentacebddeb235b13915e3034bce1fa9bab1d51e94b (diff)
Replaced dynamic_casts for node type checks by simple 'special type' identifiers. RTTI has to be disabled in cycles for OSL.
Diffstat (limited to 'intern/cycles/render/graph.cpp')
-rw-r--r--intern/cycles/render/graph.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 18e802b610d..6ed0812a239 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -55,6 +55,7 @@ ShaderNode::ShaderNode(const char *name_)
name = name_;
id = -1;
bump = SHADER_BUMP_NONE;
+ special_type = SHADER_SPECIAL_TYPE_NONE;
}
ShaderNode::~ShaderNode()
@@ -298,8 +299,8 @@ void ShaderGraph::copy_nodes(set<ShaderNode*>& nodes, map<ShaderNode*, ShaderNod
void ShaderGraph::remove_proxy_nodes(vector<bool>& removed)
{
foreach(ShaderNode *node, nodes) {
- ProxyNode *proxy = dynamic_cast<ProxyNode*>(node);
- if (proxy) {
+ if (node->special_type == SHADER_SPECIAL_TYPE_PROXY) {
+ ProxyNode *proxy = static_cast<ProxyNode*>(node);
ShaderInput *input = proxy->inputs[0];
ShaderOutput *output = proxy->outputs[0];
@@ -330,9 +331,8 @@ void ShaderGraph::remove_proxy_nodes(vector<bool>& removed)
}
/* remove useless mix closures nodes */
- MixClosureNode *mix = dynamic_cast<MixClosureNode*>(node);
-
- if(mix) {
+ if(node->special_type == SHADER_SPECIAL_TYPE_MIX_CLOSURE) {
+ MixClosureNode *mix = static_cast<MixClosureNode*>(node);
if(mix->outputs[0]->links.size() && mix->inputs[1]->link == mix->inputs[2]->link) {
ShaderOutput *output = mix->inputs[1]->link;
vector<ShaderInput*> inputs = mix->outputs[0]->links;