Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 23, 2009, 7:28:48 PM (15 years ago)
Author:
rgrieder
Message:

Add a new core-feature: orxonox_cast<T>()
The functions casts objects like dynamic_cast, but uses the identifier instead for MSVC (much faster) and is just a redirection to dynamic_cast for GCC.
Also replaced almost all dynamic_casts (of course only those related to the class hierarchy).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/orxonox/objects/controllers/HumanController.cc

    r3196 r3223  
    161161        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    162162        {
    163             Pawn* pawn = dynamic_cast<Pawn*>(HumanController::localController_s->controllableEntity_);
     163            Pawn* pawn = orxonox_cast<Pawn>(HumanController::localController_s->controllableEntity_);
    164164            if (pawn)
    165165                pawn->kill();
     
    196196    {
    197197        if (HumanController::localController_s)
    198             return dynamic_cast<Pawn*>(HumanController::localController_s->getControllableEntity());
     198            return orxonox_cast<Pawn>(HumanController::localController_s->getControllableEntity());
    199199        else
    200200            return NULL;
Note: See TracChangeset for help on using the changeset viewer.