Commit: 5b3033f6f9932d3fed6f76c7596f40c41da22ca4
Author: Joshua Leung
Date:   Wed Dec 17 15:32:36 2014 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB5b3033f6f9932d3fed6f76c7596f40c41da22ca4

WIP: Refining debug code to figure out if operations lookup is really working 
correctly

===================================================================

M       source/blender/depsgraph/intern/depsnode_component.cpp
M       source/blender/depsgraph/intern/depsnode_component.h

===================================================================

diff --git a/source/blender/depsgraph/intern/depsnode_component.cpp 
b/source/blender/depsgraph/intern/depsnode_component.cpp
index 81b71e7..1f13523 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cpp
+++ b/source/blender/depsgraph/intern/depsnode_component.cpp
@@ -101,8 +101,11 @@ OperationDepsNode 
*ComponentDepsNode::find_operation(eDepsOperation_Code opcode,
 {
        OperationIDKey key(opcode, name);
        
-       printf("===\nfind_operation: %s, %d, %s\n", this->identifier().c_str(), 
opcode, name.c_str());
-       key.print_info();
+       printf("===\nfind_operation: %s -> (%d, %s) = (%s)\n", 
this->identifier().c_str(), opcode, name.c_str(), key.identifier().c_str());
+       
+       for (OperationMap::const_iterator it2 = this->operations.begin(); it2 
!= this->operations.end(); ++it2) {
+               printf("  %s : %s\n", it2->first.identifier().c_str(), 
it2->second->identifier().c_str());
+       }
        
        OperationMap::const_iterator it = this->operations.find(key);
        printf("found = %p\n===\n", (it != this->operations.end()) ? it->second 
: NULL);
@@ -118,7 +121,9 @@ OperationDepsNode 
*ComponentDepsNode::add_operation(eDepsOperation_Type optype,
                op_node = (OperationDepsNode 
*)factory->create_node(this->owner->id, "", name);
                
                /* register */
-               this->operations[OperationIDKey(opcode, name)] = op_node;
+               OperationIDKey key(opcode, name);
+               this->operations[key] = op_node;
+               
                op_node->owner = this;
        }
        
diff --git a/source/blender/depsgraph/intern/depsnode_component.h 
b/source/blender/depsgraph/intern/depsnode_component.h
index d29a106..30e5a22 100644
--- a/source/blender/depsgraph/intern/depsnode_component.h
+++ b/source/blender/depsgraph/intern/depsnode_component.h
@@ -66,9 +66,12 @@ struct ComponentDepsNode : public DepsNode {
                   opcode(opcode), name(name)
                {}
                
-               void print_info() const
+               string identifier() const
                {
-                       printf("OperationIDKey(%d, %s)\n", opcode, 
name.c_str());
+                       char codebuf[5];
+                       sprintf(codebuf, "%d", opcode);
+                       
+                       return string("OperationIDKey(") + codebuf + ", " + 
name + ")";
                }
                
                bool operator==(const OperationIDKey &other) const

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to