Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/objects/Planet.cc

    r9675 r10624  
    8585
    8686        SUPER(Planet, tick, dt);
    87     }
    88 
    89     void Planet::init()
    90     {
    9187    }
    9288
  • code/trunk/src/modules/objects/Planet.h

    r9667 r10624  
    5252            virtual ~Planet();
    5353
    54             void init();
    5554            virtual void tick(float dt);
    5655
  • code/trunk/src/modules/objects/Script.cc

    r9667 r10624  
    3737#include "core/XMLPort.h"
    3838#include "network/Host.h"
    39 #include "network/NetworkFunction.h"
     39#include "network/NetworkFunctionIncludes.h"
    4040
    4141#include "PlayerManager.h"
     
    198198                for(std::map<unsigned int, PlayerInfo*>::const_iterator it = clients.begin(); it != clients.end(); it++)
    199199                {
    200                     callStaticNetworkFunction(Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());
     200                    callStaticNetworkFunction(&Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());
    201201                    if(this->times_ != Script::INF) // Decrement the number of remaining executions.
    202202                    {
     
    210210            else
    211211            {
    212                 callStaticNetworkFunction(Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
     212                callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
    213213                if(this->times_ != Script::INF) // Decrement the number of remaining executions.
    214214                    this->remainingExecutions_--;
     
    248248        if(GameMode::isServer() && this->isOnLoad())
    249249        {
    250             callStaticNetworkFunction(Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
     250            callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
    251251        }
    252252    }
  • code/trunk/src/modules/objects/SpaceBoundaries.cc

    r9941 r10624  
    210210        for( std::list<WeakPtr<Pawn> >::iterator current = pawnsIn_.begin(); current != pawnsIn_.end(); current++ )
    211211        {
    212             Pawn* currentPawn = current->get();
     212            Pawn* currentPawn = *current;
    213213            if( currentPawn && currentPawn->getNode() )
    214214            {
  • code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc

    r10189 r10624  
    4040namespace orxonox
    4141{
    42     RegisterAbstractClass(AbstractRadiusHeightCollisionShape).inheritsFrom(Class(CollisionShape));
     42    RegisterAbstractClass(AbstractRadiusHeightCollisionShape).inheritsFrom<CollisionShape>();
    4343
    4444    /**
  • code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc

    r9667 r10624  
    5858    }
    5959
    60     BoxCollisionShape::~BoxCollisionShape()
    61     {
    62         // TODO: Move to CollisionShape?
    63         if (this->isInitialized())
    64             delete this->collisionShape_;
    65     }
    66 
    6760    void BoxCollisionShape::registerVariables()
    6861    {
  • code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h

    r9667 r10624  
    5858        public:
    5959            BoxCollisionShape(Context* context);
    60             virtual ~BoxCollisionShape();
    6160
    6261            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
  • code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc

    r10189 r10624  
    5454    }
    5555
    56     ConeCollisionShape::~ConeCollisionShape()
    57     {
    58         if (this->isInitialized())
    59             delete this->collisionShape_;
    60     }
    61 
    6256    /**
    6357    @brief
  • code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h

    r10189 r10624  
    5656        public:
    5757            ConeCollisionShape(Context* context);
    58             virtual ~ConeCollisionShape();
    5958
    6059        private:
  • code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.cc

    r10262 r10624  
    5454    }
    5555
    56     CylinderCollisionShape::~CylinderCollisionShape()
    57     {
    58         if (this->isInitialized())
    59             delete this->collisionShape_;
    60     }
    61 
    6256    /**
    6357    @brief
  • code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.h

    r10262 r10624  
    5353        public:
    5454            CylinderCollisionShape(Context* context);
    55             virtual ~CylinderCollisionShape();
    5655
    5756        private:
  • code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc

    r9667 r10624  
    5959    }
    6060
    61     PlaneCollisionShape::~PlaneCollisionShape()
    62     {
    63         if (this->isInitialized())
    64             delete this->collisionShape_;
    65     }
    66 
    6761    void PlaneCollisionShape::registerVariables()
    6862    {
  • code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h

    r9667 r10624  
    5858        public:
    5959            PlaneCollisionShape(Context* context);
    60             virtual ~PlaneCollisionShape();
    6160
    6261            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
  • code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc

    r9667 r10624  
    5858    }
    5959
    60     SphereCollisionShape::~SphereCollisionShape()
    61     {
    62         if (this->isInitialized())
    63             delete this->collisionShape_;
    64     }
    65 
    6660    void SphereCollisionShape::registerVariables()
    6761    {
  • code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h

    r9667 r10624  
    5656        public:
    5757            SphereCollisionShape(Context* context);
    58             virtual ~SphereCollisionShape();
    5958
    6059            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
  • code/trunk/src/modules/objects/triggers/CheckPoint.cc

    r9667 r10624  
    9393        DistanceTrigger::triggered(bIsTriggered);
    9494
    95         Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype().get());
     95        Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype());
    9696        if (gametype)
    9797        {
  • code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc

    r9667 r10624  
    100100
    101101        // Check for objects that were in range but no longer are. Iterate through all objects, that are in range.
    102         for(std::map<WorldEntity*, WeakPtr<WorldEntity>* >::iterator it = this->range_.begin(); it != this->range_.end(); )
     102        for(std::set<WeakPtr<WorldEntity> >::iterator it = this->range_.begin(); it != this->range_.end(); )
    103103        {
    104             WorldEntity* entity = it->second->get();
    105             WorldEntity* key = it->first;
    106             it++; // Incrementing the iterator in advance, since we don't need the current anymore and we potentially are going to delete the current element thus invalidating the iterator.
     104            WorldEntity* entity = *it;
     105
    107106            // If the entity no longer exists.
    108107            if(entity == NULL)
    109108            {
    110                 this->removeFromRange(key);
     109                this->range_.erase(it++);
    111110                continue;
    112111            }
     
    116115            if (distanceVec.length() > this->distance_)
    117116            {
    118                 // If for some reason the entity could not be removed.
    119                 if(!this->removeFromRange(key))
    120                     continue;
     117                this->range_.erase(it++);
    121118
    122119                // If no queue has been created, yet.
     
    129126                state->originator = entity;
    130127                queue->push(state);
     128            }
     129            else
     130            {
     131                ++it;
    131132            }
    132133        }
     
    260261    bool DistanceMultiTrigger::addToRange(WorldEntity* entity)
    261262    {
    262         WeakPtr<WorldEntity>* weakptr = new WeakPtr<WorldEntity>(entity);
    263         std::pair<std::map<WorldEntity*, WeakPtr<WorldEntity>* >::iterator, bool> pair = this->range_.insert(std::pair<WorldEntity*, WeakPtr<WorldEntity>* >(entity, weakptr));
    264 
    265         if(!pair.second)
    266         {
    267             delete weakptr;
    268             return false;
    269         }
    270 
    271         return true;
    272     }
    273 
    274     /**
    275     @brief
    276         Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.
    277     @param entity
    278         A pointer ot the entity.
    279     @return
    280         Returns true if successful.
    281     */
    282     bool DistanceMultiTrigger::removeFromRange(WorldEntity* entity)
    283     {
    284         WeakPtr<WorldEntity>* weakptr = this->range_.find(entity)->second;
    285         bool erased = this->range_.erase(entity) > 0;
    286         if(erased)
    287             delete weakptr;
    288         return erased;
    289     }
    290 
     263        std::pair<std::set<WeakPtr<WorldEntity> >::iterator, bool> pair = this->range_.insert(entity);
     264        return pair.second;
     265    }
    291266}
  • code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h

    r9667 r10624  
    140140
    141141            bool addToRange(WorldEntity* entity); // Add a given entity to the entities, that currently are in range of the DistanceMultiTrigger.
    142             bool removeFromRange(WorldEntity* entity); // Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.
    143142
    144143        private:
     
    154153            ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.
    155154
    156             std::map<WorldEntity*, WeakPtr<WorldEntity>* > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
     155            std::set<WeakPtr<WorldEntity> > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
    157156
    158157    };
  • code/trunk/src/modules/objects/triggers/DistanceTrigger.cc

    r9667 r10624  
    147147    {
    148148        // Check whether there is a cached object, it still exists and whether it is still in range, if so nothing further needs to be done.
    149         if(this->cache_.get() != NULL)
    150         {
    151             if((this->cache_.get()->getWorldPosition() - this->getWorldPosition()).length() < this->distance_)
     149        if(this->cache_ != NULL)
     150        {
     151            if((this->cache_->getWorldPosition() - this->getWorldPosition()).length() < this->distance_)
    152152                return true;
    153153            else
     
    213213               
    214214                // Add the entity to the cache.
    215                 this->cache_ = WeakPtr<WorldEntity>(entity);
     215                this->cache_ = entity;
    216216
    217217                return true;
  • code/trunk/src/modules/objects/triggers/Trigger.cc

    r9667 r10624  
    3838#include "core/GameMode.h"
    3939#include "core/XMLPort.h"
    40 #include "core/command/ConsoleCommand.h"
     40#include "core/command/ConsoleCommandIncludes.h"
    4141
    4242#include "Scene.h"
Note: See TracChangeset for help on using the changeset viewer.