Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 24, 2008, 10:40:22 PM (16 years ago)
Author:
rgrieder
Message:
  • privatised InputState c'tors
  • added destruction code for GUIManager
  • fixed some issues and bugs
  • found 2400 memory leaks ;)
  • haven't done anything about it
  • converted GUIManager to Ogre Singleton
  • added NULL checkers in Loader
Location:
code/branches/gui/src/core/input
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/core/input/ExtendedInputState.h

    r1642 r1646  
    4747    class _CoreExport ExtendedInputState : public InputState
    4848    {
     49        friend class InputManager;
     50        friend class ClassFactory<ExtendedInputState>;
     51
    4952    public:
    50         ExtendedInputState();
    51         ~ExtendedInputState() { }
    52 
    5353        bool addKeyHandler        (KeyHandler* handler);
    5454        bool removeKeyHandler     (KeyHandler* handler);
     
    6868
    6969    private:
     70        ExtendedInputState();
     71        ~ExtendedInputState() { }
     72
    7073        void tickInput(float dt);
    7174        void tickInput(float dt, unsigned int device);
  • code/branches/gui/src/core/input/InputManager.cc

    r1645 r1646  
    429429                    (*rit).second->onLeave();
    430430                }
    431                 activeStates_.clear();
    432                 _updateActiveStates();
     431                //activeStates_.clear();
     432                //_updateActiveStates();
    433433
    434434                // destroy all input states
     
    438438                }
    439439
    440                 stateEmpty_ = 0;
    441                 stateCalibrator_ = 0;
    442                 stateDetector_ = 0;
     440                //stateEmpty_ = 0;
     441                //stateCalibrator_ = 0;
     442                //stateDetector_ = 0;
    443443
    444444                // destroy the devices
     
    448448
    449449                // 0 joy sticks now
    450                 _redimensionLists();
     450                //_redimensionLists();
    451451
    452452                OIS::InputManager::destroyInputSystem(inputSystem_);
    453                 inputSystem_ = 0;
     453                //inputSystem_ = 0;
    454454
    455455                CCOUT(3) << "Destroying done." << std::endl;
     
    509509    {
    510510        assert(state);
     511        std::map<int, InputState*>::iterator it = this->activeStates_.find(state->getPriority());
     512        if (it != this->activeStates_.end())
     513        {
     514            this->activeStates_.erase(it);
     515            _updateActiveStates();
     516        }
    511517        inputStatesByPriority_.erase(state->getPriority());
    512518        inputStatesByName_.erase(state->getName());
  • code/branches/gui/src/core/input/InputState.h

    r1642 r1646  
    5151
    5252    public:
    53         InputState() : priority_(0), executorOnEnter_(0), executorOnLeave_(0)
    54         { RegisterObject(InputState); }
    55         virtual ~InputState() { }
    56 
    5753        const std::string& getName() const { return name_; }
    5854        int getPriority()            const { return priority_; }
     
    9389
    9490    protected:
     91        InputState() : priority_(0), executorOnEnter_(0), executorOnLeave_(0)
     92        { RegisterObject(InputState); }
     93        virtual ~InputState() { }
     94
    9595        virtual void numberOfJoySticksChanged(unsigned int n) = 0;
    9696        void setInputDeviceEnabled(unsigned int device, bool bEnabled)
  • code/branches/gui/src/core/input/SimpleInputState.h

    r1642 r1646  
    4545    class _CoreExport SimpleInputState : public InputState
    4646    {
     47        friend class InputManager;
     48        friend class ClassFactory<SimpleInputState>;
     49
    4750    public:
    48         SimpleInputState();
    49         ~SimpleInputState() { }
    50 
    5151        void setKeyHandler        (KeyHandler* handler) { keyHandler_ = handler; update(); }
    5252        void setMouseHandler      (MouseHandler* handler) { mouseHandler_ = handler; update(); }
     
    5757
    5858    private:
     59        SimpleInputState();
     60        ~SimpleInputState() { }
     61
    5962        void tickInput(float dt);
    6063        void tickInput(float dt, unsigned int device);
Note: See TracChangeset for help on using the changeset viewer.