Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2009, 8:20:07 PM (15 years ago)
Author:
rgrieder
Message:

Merged core5 branch back to the trunk.
Key features include clean level unloading and an extended XML event system.

Two important notes:
Delete your keybindings.ini files! * or you will still get parser errors when loading the key bindings.
Delete build_dir/lib/modules/libgamestates.module! * or orxonox won't start.
Best thing to do is to delete the build folder ;)

Location:
code/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/pickup/DroppedItem.cc

    r5781 r5929  
    5656        if (this->item_)
    5757        {
    58             for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); it++)
     58            for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
    5959            {
    6060                Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
     
    6969        {
    7070            COUT(3) << "DroppedItem '" << this->item_->getPickupIdentifier() << "' picked up." << std::endl;
    71             delete this;
     71            this->destroy();
    7272        }
    7373    }
     
    7676        if (this->timeToLive_ > 0)
    7777        {
    78             ExecutorMember<DroppedItem>* exec = createExecutor(createFunctor(&DroppedItem::timerCallback));
    79             this->timer_.setTimer(this->timeToLive_, false, this, exec, false);
     78            this->timer_.setTimer(this->timeToLive_, false, createExecutor(createFunctor(&DroppedItem::timerCallback, this)), false);
    8079        }
    8180    }
     
    8584        {
    8685            COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << "'" << std::endl;
    87             delete this->item_;
     86            this->item_->destroy();
    8887        }
    8988
    90         delete this;
     89        this->destroy();
    9190    }
    9291
  • code/trunk/src/orxonox/pickup/DroppedItem.h

    r5781 r5929  
    7777        BaseItem* item_;
    7878
    79         Timer<DroppedItem> timer_;
     79        Timer timer_;
    8080    };
    8181}
  • code/trunk/src/orxonox/pickup/ModifierPickup.cc

    r5781 r5929  
    101101            if (this->duration_ > 0.0f)
    102102            {
    103                 ExecutorMember<ModifierPickup>* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback));
     103                Executor* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback, this));
    104104                executor->setDefaultValues(pawn);
    105                 this->timer_.setTimer(this->duration_, false, this, executor);
     105                this->timer_.setTimer(this->duration_, false, executor);
    106106            }
    107107
     
    139139                this->timer_.stopTimer();
    140140
    141             delete this;
     141            this->destroy();
    142142
    143143            return true;
  • code/trunk/src/orxonox/pickup/ModifierPickup.h

    r5781 r5929  
    129129
    130130        void timerCallback(Pawn* pawn);     //!< Method called when the timer runs out.
     131       
    131132    private:
    132133        float getAdditiveModifier(ModifierType::Value type) const;               //!< Get the additive modifier for a given ModifierType.
     
    138139        std::map<ModifierType::Value, float> multiplicativeModifiers_;           //!< Map of multiplicative modifiers, indexed by ModifierType.
    139140
    140         float duration_;                                                        //!< Duration of this pickup's effect (0 for unlimited).
    141         Timer<ModifierPickup> timer_;                                           //!< Timer used if the pickup's effect has a time limit.
     141        float duration_;                                                         //!< Duration of this pickup's effect (0 for unlimited).
     142        Timer timer_;                                                            //!< Timer used if the pickup's effect has a time limit.
    142143    };
    143144}
  • code/trunk/src/orxonox/pickup/PickupSpawner.cc

    r5781 r5929  
    9191            asItem->addTemplate(this->itemTemplate_);
    9292            PickupInventory::getImageForItem(asItem);
    93             delete newObject;
     93            newObject->destroy();
    9494        }
    9595
     
    127127        if (this->isActive())
    128128        {
    129             for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); it++)
     129            for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
    130130            {
    131131                Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
     
    166166                    if (this->respawnTime_ > 0.0f)
    167167                    {
    168                         ExecutorMember<PickupSpawner>* executor = createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback));
    169                         this->respawnTimer_.setTimer(this->respawnTime_, false, this, executor);
     168                        this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
    170169
    171170                        this->setActive(false);
     
    174173                }
    175174                else
    176                     delete newObject;
     175                    newObject->destroy();
    177176            }
    178177        }
  • code/trunk/src/orxonox/pickup/PickupSpawner.h

    r5781 r5929  
    114114
    115115        float respawnTime_;                     //!< Time after which this gets re-actived.
    116         Timer<PickupSpawner> respawnTimer_;     //!< Timer used for re-activating.
     116        Timer respawnTimer_;                    //!< Timer used for re-activating.
    117117    };
    118118}
  • code/trunk/src/orxonox/pickup/items/HealthImmediate.cc

    r5781 r5929  
    6767        {
    6868            pawn->addHealth(this->recoveredHealth_);
    69             delete this;
     69            this->destroy();
    7070        }
    7171
  • code/trunk/src/orxonox/pickup/items/HealthUsable.cc

    r5781 r5929  
    8282
    8383            this->removeFrom(pawn);
    84             delete this;
     84            this->destroy();
    8585        }
    8686    }
  • code/trunk/src/orxonox/pickup/items/Jump.cc

    r5781 r5929  
    8484        {
    8585            this->removeFrom(pawn);
    86             delete this;
     86            this->destroy();
    8787        }
    8888    }
Note: See TracChangeset for help on using the changeset viewer.