Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

found another old console command

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

Legend:

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

    r7204 r7220  
    4141namespace orxonox
    4242{
     43#ifdef ORXONOX_PLATFORM_LINUX
     44    static const std::string __CC_Mouse_name = "Mouse";
     45    static const std::string __CC_grab_name = "grab";
     46    static const std::string __CC_ungrab_name = "ungrab";
     47
     48    _SetConsoleCommand(__CC_Mouse_name, __CC_grab_name,   &Mouse::grab);
     49    _SetConsoleCommand(__CC_Mouse_name, __CC_ungrab_name, &Mouse::ungrab);
     50#endif
     51
    4352    Mouse::Mouse(unsigned int id, OIS::InputManager* oisInputManager)
    4453        : super(id, oisInputManager)
     
    4857
    4958#ifdef ORXONOX_PLATFORM_LINUX
    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);
     59        _ModifyConsoleCommand(__CC_Mouse_name, __CC_grab_name).setObject(this);
     60        _ModifyConsoleCommand(__CC_Mouse_name, __CC_ungrab_name).setObject(this);
     61#endif
     62    }
     63
     64    Mouse::~Mouse()
     65    {
     66#ifdef ORXONOX_PLATFORM_LINUX
     67        _ModifyConsoleCommand(__CC_Mouse_name, __CC_grab_name).setObject(0);
     68        _ModifyConsoleCommand(__CC_Mouse_name, __CC_ungrab_name).setObject(0);
    5469#endif
    5570    }
  • code/branches/consolecommands3/src/libraries/core/input/Mouse.h

    r5781 r7220  
    6464        //! Only sets the clipping size. Initialising is done in the base class.
    6565        Mouse(unsigned int id, OIS::InputManager* oisInputManager);
    66         ~Mouse() { }
     66        ~Mouse();
    6767
    6868#ifdef ORXONOX_PLATFORM_LINUX
Note: See TracChangeset for help on using the changeset viewer.