Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9302


Ignore:
Timestamp:
Jun 17, 2012, 6:24:06 PM (12 years ago)
Author:
landauf
Message:

small cleanup. calling addTemplate() only once instead of twice

Location:
code/branches/presentation2012merge/src/modules/pickup
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/modules/pickup/PickupRepresentation.cc

    r8858 r9302  
    151151        Returns a pointer to the StaticEntity.
    152152    */
    153     StaticEntity* PickupRepresentation::getSpawnerRepresentation(PickupSpawner* spawner)
     153    StaticEntity* PickupRepresentation::createSpawnerRepresentation(PickupSpawner* spawner)
    154154    {
    155155        if(this->spawnerRepresentation_ == NULL)
     
    158158            if(this->spawnerTemplate_ == "")
    159159            {
    160                 orxout(verbose, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
     160                orxout(internal_warning, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
    161161                // If neither spawnerRepresentation nor spawnerTemplate was specified
    162162                return this->getDefaultSpawnerRepresentation(spawner);
     
    165165        }
    166166
    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;
    174172    }
    175173
  • code/branches/presentation2012merge/src/modules/pickup/PickupRepresentation.h

    r7547 r9302  
    141141                { if(index == 0) return this->pickup_; return NULL; }
    142142
    143             StaticEntity* getSpawnerRepresentation(PickupSpawner* spawner); //!< Get a spawnerRepresentation for a specific PickupSpawner.
     143            StaticEntity* createSpawnerRepresentation(PickupSpawner* spawner); //!< Create a spawnerRepresentation for a specific PickupSpawner.
    144144
    145145        protected:
  • code/branches/presentation2012merge/src/modules/pickup/PickupSpawner.cc

    r9279 r9302  
    9696        {
    9797            PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier());
    98             this->attach(representation->getSpawnerRepresentation(this));
     98            this->attach(representation->createSpawnerRepresentation(this));
    9999            this->setActive(true);
    100100        }
     
    150150        {
    151151            PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier());
    152             this->attach(representation->getSpawnerRepresentation(this));
     152            this->attach(representation->createSpawnerRepresentation(this));
    153153            this->setActive(true);
    154154        }
Note: See TracChangeset for help on using the changeset viewer.