Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 26, 2010, 12:09:12 AM (14 years ago)
Author:
landauf
Message:

adapted all console commands to the new interface

File:
1 edited

Legend:

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

    r7204 r7219  
    6262    SetCommandLineSwitch(keyboard_no_grab).information("Whether not to exclusively grab the keyboard");
    6363
     64    static const std::string __CC_InputManager_name = "InputManager";
     65    static const std::string __CC_calibrate_name = "calibrate";
     66    static const std::string __CC_reload_name = "reload";
     67
     68    _SetConsoleCommand(__CC_InputManager_name, __CC_calibrate_name, &InputManager::calibrate).addShortcut();
     69    _SetConsoleCommand(__CC_InputManager_name, __CC_reload_name,    &InputManager::reload   );
     70
    6471    // Abuse of this source file for the InputHandler
    6572    InputHandler InputHandler::EMPTY;
     
    118125        this->updateActiveStates();
    119126
    120         // calibrate console command
    121         this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&InputManager::calibrate, this), "calibrate"), true);
    122         // reload console command
    123         this->getIdentifier()->addConsoleCommand(createConsoleCommand(createFunctor(&InputManager::reload, this), "reload"), false);
     127        _ModifyConsoleCommand(__CC_InputManager_name, __CC_calibrate_name).setObject(this);
     128        _ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(this);
    124129
    125130        CCOUT(4) << "Construction complete." << std::endl;
     
    287292        if (!(internalState_ & Bad))
    288293            this->destroyDevices();
     294
     295        // Reset console commands
     296        _ModifyConsoleCommand(__CC_InputManager_name, __CC_calibrate_name).setObject(0);
     297        _ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(0);
    289298
    290299        CCOUT(3) << "Destruction complete." << std::endl;
Note: See TracChangeset for help on using the changeset viewer.