Changeset 9302
- Timestamp:
- Jun 17, 2012, 6:24:06 PM (13 years ago)
- Location:
- code/branches/presentation2012merge/src/modules/pickup
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/modules/pickup/PickupRepresentation.cc
r8858 r9302 151 151 Returns a pointer to the StaticEntity. 152 152 */ 153 StaticEntity* PickupRepresentation:: getSpawnerRepresentation(PickupSpawner* spawner)153 StaticEntity* PickupRepresentation::createSpawnerRepresentation(PickupSpawner* spawner) 154 154 { 155 155 if(this->spawnerRepresentation_ == NULL) … … 158 158 if(this->spawnerTemplate_ == "") 159 159 { 160 orxout( verbose, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;160 orxout(internal_warning, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl; 161 161 // If neither spawnerRepresentation nor spawnerTemplate was specified 162 162 return this->getDefaultSpawnerRepresentation(spawner); … … 165 165 } 166 166 167 StaticEntity* representation = this->spawnerRepresentation_; 168 representation->setVisible(true); 169 170 this->addTemplate(this->spawnerTemplate_); 171 this->spawnerRepresentation_->setVisible(false); 172 173 return representation; 167 this->spawnerRepresentation_->setVisible(true); 168 StaticEntity* temp = this->spawnerRepresentation_; 169 this->spawnerRepresentation_ = NULL; 170 171 return temp; 174 172 } 175 173 -
code/branches/presentation2012merge/src/modules/pickup/PickupRepresentation.h
r7547 r9302 141 141 { if(index == 0) return this->pickup_; return NULL; } 142 142 143 StaticEntity* getSpawnerRepresentation(PickupSpawner* spawner); //!< Geta spawnerRepresentation for a specific PickupSpawner.143 StaticEntity* createSpawnerRepresentation(PickupSpawner* spawner); //!< Create a spawnerRepresentation for a specific PickupSpawner. 144 144 145 145 protected: -
code/branches/presentation2012merge/src/modules/pickup/PickupSpawner.cc
r9279 r9302 96 96 { 97 97 PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier()); 98 this->attach(representation-> getSpawnerRepresentation(this));98 this->attach(representation->createSpawnerRepresentation(this)); 99 99 this->setActive(true); 100 100 } … … 150 150 { 151 151 PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier()); 152 this->attach(representation-> getSpawnerRepresentation(this));152 this->attach(representation->createSpawnerRepresentation(this)); 153 153 this->setActive(true); 154 154 }
Note: See TracChangeset
for help on using the changeset viewer.