- Timestamp:
- Sep 21, 2006, 7:10:42 PM (18 years ago)
- Location:
- branches/new_class_id/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/coord/p_node.cc
r9770 r9783 80 80 PRINTF(4)("delete %s::%s\n", this->getClassCName(), this->getCName()); 81 81 // remove the Node, delete it's children (if required). 82 PNode* last = NULL; 83 this->debugNode(0); 84 82 85 while(!this->children.empty()) 83 86 { 84 87 PNode* deleteNode = this->children.front(); 88 if (deleteNode == last) 89 { 90 PRINTF(1)("Node same as last that was tried to be deleted. FORCE delete of %p\n", deleteNode); 91 delete deleteNode; 92 continue; 93 } 85 94 if ((this->parentMode & PNODE_PROHIBIT_CHILD_DELETE) || 86 95 (deleteNode->parentMode & PNODE_PROHIBIT_DELETE_WITH_PARENT)) … … 108 117 delete deleteNode; 109 118 } 119 last = deleteNode; 110 120 } 111 121 … … 913 923 int childNodeCount = 0; 914 924 this->countChildNodes(childNodeCount); 915 925 printf("%p:", this); 916 926 PRINT(0)("PNode(%s::%s) - absCoord: (%0.2f, %0.2f, %0.2f), relCoord(%0.2f, %0.2f, %0.2f), direction(%0.2f, %0.2f, %0.2f) - %s - %d childs\n", 917 927 this->getClassCName(), -
branches/new_class_id/src/lib/util/loading/resource.cc
r9718 r9783 37 37 // delete what has to be deleted here 38 38 } 39 40 41 42 43 44 45 46 47 void Resource::KeepLevel::setKeepLevelName(unsigned int level, const std::string& name) 48 { 49 if (_keepLevelName.size() <= level) 50 _keepLevelName.resize(level+1); 51 _keepLevelName[level] = name; 52 } -
branches/new_class_id/src/lib/util/loading/resource.h
r9758 r9783 24 24 { 25 25 public: 26 void setKeepLevelName(unsigned int level, const std::string& name) 27 { 28 if (_keepLevelName.size() <= level) 29 _keepLevelName.resize(level+1); 30 _keepLevelName[level] = name; 31 } 26 void setKeepLevelName(unsigned int level, const std::string& name); 32 27 private: 33 28 std::vector<std::string> _keepLevelName; 34 29 }; 35 30 36 31 protected: 37 32 class Type 38 33 { 39 34 public: 40 Type(const ClassID& classID) : _ classID(classID) { };35 Type(const ClassID& classID) : _id(-1), _classID(classID) { }; 41 36 42 37 void addExtension(const std::string& extension); 43 38 39 const ClassID& storedClassID() const { return _classID; }; 40 int id() const { return _id; }; 41 const std::vector<std::string>& resourcePaths() const { return _resourcePaths; }; 42 43 44 void setID(int id); 45 44 46 private: 47 int _id; 45 48 const ClassID& _classID; 46 49 std::vector<std::string> _resourcePaths; … … 49 52 }; 50 53 54 class Pointer {}; 51 55 52 56 … … 55 59 virtual ~Resource(); 56 60 57 virtual bool load(std::string& fileName, const MultiType& param1, const MultiType& param2);61 bool loadResource(std::string& fileName, Resource::Pointer* ptr); 58 62 virtual bool reload(); 59 63 virtual bool unload(); 60 64 61 65 66 62 67 private: 68 std::string _loadString; //!< An identifier, to match when loading a File. 63 69 std::string _fileName; 64 70 MultiType _parameters[3]; //!< The Parameters given to this Resource. -
branches/new_class_id/src/world_entities/projectiles/projectile.cc
r9715 r9783 149 149 { 150 150 if (this->target == NULL) 151 this->target = new PNode(target, PNODE_ PARENT_MODE_DEFAULT | PNODE_REPARENT_ON_PARENTS_REMOVE);151 this->target = new PNode(target, PNODE_REPARENT_ON_PARENTS_REMOVE | PNODE_REPARENT_TO_NULL | PNODE_PROHIBIT_DELETE_WITH_PARENT); 152 152 else 153 153 this->target->setParent(target);
Note: See TracChangeset
for help on using the changeset viewer.