Changeset 5839 for code/branches/core5
- Timestamp:
- Sep 30, 2009, 12:42:28 PM (15 years ago)
- Location:
- code/branches/core5/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/core/BaseObject.cc
r5821 r5839 46 46 #include "XMLNameListener.h" 47 47 #include "XMLPort.h" 48 #include "network/NetworkPrereqs.h" 48 49 49 50 namespace orxonox … … 74 75 this->setFile(this->creator_->getFile()); 75 76 this->setNamespace(this->creator_->getNamespace()); 76 this->setScene(this->creator_->getScene() );77 this->setScene(this->creator_->getScene(), this->creator_->getSceneID()); 77 78 this->setGametype(this->creator_->getGametype()); 78 79 } … … 82 83 this->namespace_ = 0; 83 84 this->scene_ = 0; 85 this->sceneID_ = OBJECTID_UNKNOWN; 84 86 this->gametype_ = 0; 85 87 } -
code/branches/core5/src/libraries/core/BaseObject.h
r5829 r5839 135 135 inline BaseObject* getCreator() const { return this->creator_; } 136 136 137 inline void setScene(const SmartPtr<Scene>& scene ) { this->scene_ = scene; }137 inline void setScene(const SmartPtr<Scene>& scene, uint32_t sceneID) { this->scene_ = scene; this->sceneID_=sceneID; } 138 138 inline const SmartPtr<Scene>& getScene() const { return this->scene_; } 139 inline virtual uint32_t getSceneID() const { return this->sceneID_; } 139 140 140 141 inline void setGametype(const SmartPtr<Gametype>& gametype) … … 202 203 std::list<BaseObject*> events_; 203 204 std::map<std::string, EventContainer*> eventContainers_; 205 uint32_t sceneID_; 204 206 }; 205 207 -
code/branches/core5/src/libraries/network/synchronisable/Synchronisable.cc
r5797 r5839 72 72 73 73 // get creator id 74 this->creatorID = OBJECTID_UNKNOWN; 75 76 searchcreatorID: 74 if( creator ) 75 this->creatorID = creator->getSceneID(); 76 else 77 this->creatorID = OBJECTID_UNKNOWN; 78 79 /*searchcreatorID: 77 80 if (creator) 78 81 { … … 80 83 if (synchronisable_creator && synchronisable_creator->objectMode_) 81 84 { 82 this->creatorID = synchronisable_creator->get ObjectID();85 this->creatorID = synchronisable_creator->getScene()->getObjectID(); 83 86 } 84 87 else if (creator != creator->getCreator()) … … 87 90 goto searchcreatorID; 88 91 } 89 } 92 }*/ 90 93 } 91 94 … … 173 176 assert(no); 174 177 no->objectID=header.getObjectID(); 175 no->creatorID=header.getCreatorID(); //TODO: remove this178 //no->creatorID=header.getCreatorID(); //TODO: remove this 176 179 no->classID=header.getClassID(); 180 assert(no->creatorID == header.getCreatorID()); 181 //assert(no->classID == header.getClassID()); 177 182 COUT(4) << "fabricate objectID: " << no->objectID << " classID: " << no->classID << std::endl; 178 183 // update data and create object/entity... -
code/branches/core5/src/orxonox/Scene.cc
r5813 r5839 55 55 RegisterObject(Scene); 56 56 57 this->setScene(SmartPtr<Scene>(this, false) );57 this->setScene(SmartPtr<Scene>(this, false), OBJECTID_UNKNOWN); 58 58 this->bShadows_ = true; 59 59 … … 283 283 { 284 284 this->objects_.push_back(object); 285 object->setScene(this );285 object->setScene(this, this->getObjectID()); 286 286 } 287 287 -
code/branches/core5/src/orxonox/Scene.h
r5813 r5839 73 73 inline Radar* getRadar() 74 74 { return this->radar_; } 75 76 inline virtual uint32_t getSceneID() const { return this->getObjectID(); } 75 77 76 78 virtual void tick(float dt);
Note: See TracChangeset
for help on using the changeset viewer.