Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3310 for code


Ignore:
Timestamp:
Jul 19, 2009, 12:27:53 PM (15 years ago)
Author:
rgrieder
Message:

Optimisations in the pathway of the input. Nobody will ever notice the difference in performance (immeasurable), but I love the beauty of having all my template code inlined when it even decreases code size (because the code gets inlined exactly once).

Location:
code/branches/core4/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/core/input/InputDevice.h

    r3286 r3310  
    181181    protected:
    182182        //! Common code for all button pressed events (updates pressed buttons list and calls the input states)
    183         void buttonPressed(ButtonTypeParam button)
     183        FORCEINLINE void buttonPressed(ButtonTypeParam button)
    184184        {
    185185            // check whether the button already is in the list (can happen when focus was lost)
     
    198198
    199199        //! Common code for all button released events (updates pressed buttons list and calls the input states)
    200         void buttonReleased(ButtonTypeParam button)
     200        FORCEINLINE void buttonReleased(ButtonTypeParam button)
    201201        {
    202202            // remove the button from the pressedButtons_ list
  • code/branches/core4/src/core/input/InputManager.cc

    r3291 r3310  
    177177        paramList.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
    178178#if defined(ORXONOX_PLATFORM_WINDOWS)
    179         //paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
    180         //paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND")));
    181         //paramList.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE")));
    182         //paramList.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND")));
     179        paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
     180        paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND")));
     181        paramList.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE")));
     182        paramList.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND")));
    183183#elif defined(ORXONOX_PLATFORM_LINUX)
    184184        paramList.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
  • code/branches/core4/src/core/input/InputState.h

    r3292 r3310  
    174174    };
    175175
    176     inline void InputState::update(float dt)
     176    FORCEINLINE void InputState::update(float dt)
    177177    {
    178178        for (unsigned int i = 0; i < handlers_.size(); ++i)
     
    181181    }
    182182
    183     inline void InputState::update(float dt, unsigned int device)
     183    FORCEINLINE void InputState::update(float dt, unsigned int device)
    184184    {
    185185        switch (device)
     
    203203
    204204    template <typename EventType, class Traits>
    205     inline void InputState::buttonEvent(unsigned int device, const typename Traits::ButtonTypeParam button)
     205    FORCEINLINE void InputState::buttonEvent(unsigned int device, const typename Traits::ButtonTypeParam button)
    206206    {
    207207        assert(device < handlers_.size());
     
    210210    }
    211211
    212     inline void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
     212    FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
    213213    {
    214214        if (handlers_[mouseIndex_s] != NULL)
     
    216216    }
    217217
    218     inline void InputState::mouseScrolled(int abs, int rel)
     218    FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
    219219    {
    220220        if (handlers_[mouseIndex_s] != NULL)
     
    222222    }
    223223
    224     inline void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value)
     224    FORCEINLINE void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value)
    225225    {
    226226        assert(device < handlers_.size());
  • code/branches/core4/src/core/input/Mouse.cc

    r3293 r3310  
    4545    {
    4646        RegisterRootObject(Mouse);
    47         this->windowResized(this->getWindowHeight(), this->getWindowHeight());
     47        this->windowResized(this->getWindowWidth(), this->getWindowHeight());
    4848
    4949#ifdef ORXONOX_PLATFORM_LINUX
  • code/branches/core4/src/orxonox/gui/GUIManager.cc

    r3293 r3310  
    420420    void GUIManager::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
    421421    {
    422         guiSystem_->injectMouseMove(static_cast<float>(rel.x), static_cast<float>(rel.y));
     422        //guiSystem_->injectMouseMove(static_cast<float>(rel.x), static_cast<float>(rel.y));
     423        guiSystem_->injectMousePosition(static_cast<float>(abs.x), static_cast<float>(abs.y));
    423424    }
    424425    void GUIManager::mouseScrolled(int abs, int rel)
Note: See TracChangeset for help on using the changeset viewer.