Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 28, 2009, 9:31:24 PM (15 years ago)
Author:
landauf
Message:

replaced most occurrences of setObject(o) in combination with createFunctor(f) with the more convenient createFunctor(f, o)

Location:
code/branches/core5/src/libraries/core/input
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/input/InputManager.cc

    r5796 r5829  
    109109        InputState* detector = createInputState("detector", false, false, InputStatePriority::Detector);
    110110        // Create a callback to avoid buttonHeld events after the key has been detected
    111         FunctorMember<InputManager>* bufferFunctor = createFunctor(&InputManager::clearBuffers);
    112         bufferFunctor->setObject(this);
    113         detector->setLeaveFunctor(bufferFunctor);
     111        detector->setLeaveFunctor(createFunctor(&InputManager::clearBuffers, this));
    114112        keyDetector_ = new KeyDetector();
    115113        detector->setHandler(keyDetector_);
     
    124122        this->updateActiveStates();
    125123
    126         {
    127             // calibrate console command
    128             FunctorMember<InputManager>* functor = createFunctor(&InputManager::calibrate);
    129             functor->setObject(this);
    130             this->getIdentifier()->addConsoleCommand(createConsoleCommand(functor, "calibrate"), true);
    131         }
    132         {
    133             // reload console command
    134             FunctorMember<InputManager>* functor = createFunctor(&InputManager::reload);
    135             functor->setObject(this);
    136             this->getIdentifier()->addConsoleCommand(createConsoleCommand(functor, "reload"), false);
    137         }
     124        // calibrate console command
     125        this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&InputManager::calibrate, this), "calibrate"), true);
     126        // reload console command
     127        this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&InputManager::reload, this), "reload"), false);
    138128
    139129        CCOUT(4) << "Construction complete." << std::endl;
  • code/branches/core5/src/libraries/core/input/Mouse.cc

    r5738 r5829  
    4848
    4949#ifdef ORXONOX_PLATFORM_LINUX
    50         {
    51             // Mouse grab console command
    52             FunctorMember<Mouse>* functor = createFunctor(&Mouse::grab);
    53             functor->setObject(this);
    54             this->getIdentifier()->addConsoleCommand(createConsoleCommand(functor, "grab"), false);
    55         }
    56         {
    57             // Mouse ungrab console command
    58             FunctorMember<Mouse>* functor = createFunctor(&Mouse::ungrab);
    59             functor->setObject(this);
    60             this->getIdentifier()->addConsoleCommand(createConsoleCommand(functor, "ungrab"), false);
    61         }
     50        // Mouse grab console command
     51        this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&Mouse::grab, this), "grab"), false);
     52        // Mouse ungrab console command
     53        this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&Mouse::ungrab, this), "ungrab"), false);
    6254#endif
    6355    }
Note: See TracChangeset for help on using the changeset viewer.