Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 4, 2012, 10:50:28 PM (12 years ago)
Author:
landauf
Message:

use orxonox_cast instead of dynamic_cast wherever possible

Location:
code/branches/presentation2012merge/src/orxonox
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/orxonox/controllers/NewHumanController.cc

    r9016 r9279  
    298298        //Used in HumanController for formationFlight
    299299        HumanController::hit(originator,contactpoint,damage);
    300        
     300
    301301        if (this->showDamageOverlay_ && !this->controlPaused_ && this->controllableEntity_ && !this->controllableEntity_->isInMouseLook())
    302302        {
     
    397397                try
    398398                {
    399                     wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
     399                    wePtr = orxonox_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
    400400                }
    401401                catch (...)
  • code/branches/presentation2012merge/src/orxonox/gamestates/GSRoot.cc

    r8858 r9279  
    7676        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it)
    7777        {
    78             if (dynamic_cast<Synchronisable*>(*it))
    79                 orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << dynamic_cast<Synchronisable*>(*it)->getObjectID() << endl;
     78            Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(*it);
     79            if (synchronisable)
     80                orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;
    8081            else
    8182                orxout(debug_output) << "object: " << it->getIdentifier()->getName() << endl;
  • code/branches/presentation2012merge/src/orxonox/gametypes/Dynamicmatch.cc

    r8858 r9279  
    151151
    152152                //Give new pig boost
    153                 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
     153                SpaceShip* spaceship = orxonox_cast<SpaceShip*>(victim);
    154154                this->grantPigBoost(spaceship);
    155155            }
     
    245245                }
    246246                //Give new pig boost
    247                 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
     247                SpaceShip* spaceship = orxonox_cast<SpaceShip*>(victim);
    248248                this->grantPigBoost(spaceship);
    249249            }
     
    426426    {
    427427        std::map<PlayerInfo*, int>::const_iterator it_player = this->playerParty_.find(player);
    428         Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
     428        Pawn* pawn = orxonox_cast<Pawn*>(player->getControllableEntity());
    429429            if (pawn)
    430430            {
  • code/branches/presentation2012merge/src/orxonox/gametypes/LastManStanding.cc

    r8858 r9279  
    211211            if(!player->getControllableEntity())
    212212                return;
    213             Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
     213            Pawn* pawn = orxonox_cast<Pawn*>(player->getControllableEntity());
    214214            if(!pawn)
    215215                return;
  • code/branches/presentation2012merge/src/orxonox/gametypes/LastTeamStanding.cc

    r8858 r9279  
    283283            if(!player->getControllableEntity())
    284284                return;
    285             Pawn* pawn = dynamic_cast<Pawn*>(player->getControllableEntity());
     285            Pawn* pawn = orxonox_cast<Pawn*>(player->getControllableEntity());
    286286            if(!pawn)
    287287                return;
  • code/branches/presentation2012merge/src/orxonox/interfaces/Pickupable.cc

    r8866 r9279  
    338338        this->clone(item);
    339339
    340         Pickupable* pickup = dynamic_cast<Pickupable*>(item);
     340        Pickupable* pickup = orxonox_cast<Pickupable*>(item);
    341341
    342342        orxout(verbose, context::pickups) << "Pickupable (&" << this << ") cloned. Clone is new Pickupable (&" << pickup << ")." << endl;
  • code/branches/presentation2012merge/src/orxonox/worldentities/ControllableEntity.cc

    r9272 r9279  
    266266                this->cameraPositionRootNode_->_update(true, false); // update the camera node because otherwise the camera will drag back in position which looks strange
    267267
    268                 NewHumanController* controller = dynamic_cast<NewHumanController*>(this->getController());
     268                NewHumanController* controller = orxonox_cast<NewHumanController*>(this->getController());
    269269                if (controller)
    270270                    controller->centerCursor();
Note: See TracChangeset for help on using the changeset viewer.