Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 29, 2015, 6:18:30 PM (9 years ago)
Author:
landauf
Message:

cleanup: no need to pass/return WeakPtrs to/from functions. normal pointers are enough.

Location:
code/branches/core7/src/modules/invader
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/modules/invader/Invader.cc

    r9961 r10557  
    8787            for (int i = 0; i < 7; i++)
    8888            {
    89                 WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
     89                BigExplosion* chunk = new BigExplosion(this->center_->getContext());
    9090                chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
    9191                chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
     
    9999    }
    100100
    101     WeakPtr<InvaderShip> Invader::getPlayer()
     101    InvaderShip* Invader::getPlayer()
    102102    {
    103103        if (player == NULL)
     
    116116        for (int i = 0; i < (3*log10(static_cast<double>(level)) + 1); i++)
    117117        {
    118             WeakPtr<InvaderEnemy> newPawn;
     118            InvaderEnemy* newPawn;
    119119            if (rand() % 42/(1 + level*level) == 0)
    120120            {
  • code/branches/core7/src/modules/invader/Invader.h

    r9943 r10557  
    7878        private:
    7979            void toggleShowLevel(){bShowLevel = !bShowLevel;}
    80             WeakPtr<InvaderShip> getPlayer();
     80            InvaderShip* getPlayer();
    8181            WeakPtr<InvaderCenterPoint> center_;
    8282            WeakPtr<InvaderShip> player;
  • code/branches/core7/src/modules/invader/InvaderEnemy.cc

    r9961 r10557  
    6969    }
    7070
    71     WeakPtr<Invader> InvaderEnemy::getGame()
     71    Invader* InvaderEnemy::getGame()
    7272    {
    7373        if (game == NULL)
  • code/branches/core7/src/modules/invader/InvaderEnemy.h

    r9943 r10557  
    4949            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    5050            virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator);
    51             virtual void setPlayer(WeakPtr<InvaderShip> player){this->player = player;}
     51            virtual void setPlayer(InvaderShip* player){this->player = player;}
    5252
    5353            int level;
    5454        protected:
    55             WeakPtr<Invader> getGame();
     55            Invader* getGame();
    5656            WeakPtr<Invader> game;
    5757            WeakPtr<InvaderShip> player;
  • code/branches/core7/src/modules/invader/InvaderShip.cc

    r9943 r10557  
    9191
    9292        // Camera
    93         WeakPtr<Camera> camera = this->getCamera();
     93        Camera* camera = this->getCamera();
    9494        if (camera != NULL)
    9595        {
     
    142142    {
    143143        // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint;
    144         WeakPtr<InvaderEnemy> enemy = orxonox_cast<InvaderEnemy*>(otherObject);
    145         WeakPtr<Projectile> shot = orxonox_cast<Projectile*>(otherObject);
     144        InvaderEnemy* enemy = orxonox_cast<InvaderEnemy*>(otherObject);
     145        Projectile* shot = orxonox_cast<Projectile*>(otherObject);
    146146        // ensure that this gets only called once per enemy.
    147147        if (enemy != NULL && lastEnemy != enemy)
     
    171171    }
    172172
    173     WeakPtr<Invader> InvaderShip::getGame()
     173    Invader* InvaderShip::getGame()
    174174    {
    175175        if (game == NULL)
  • code/branches/core7/src/modules/invader/InvaderShip.h

    r9943 r10557  
    7070            virtual void death();
    7171        private:
    72             WeakPtr<Invader> getGame();
     72            Invader* getGame();
    7373            WeakPtr<Invader> game;
    7474            Camera* camera;
  • code/branches/core7/src/modules/invader/InvaderWeapon.cc

    r10216 r10557  
    6868        // Create the projectile.projectile
    6969        projectile = new Projectile(this->getContext());
    70         WeakPtr<Model> model = new Model(projectile->getContext());
     70        Model* model = new Model(projectile->getContext());
    7171        model->setMeshSource(mesh_);
    7272        model->setCastShadows(false);
Note: See TracChangeset for help on using the changeset viewer.