Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6745


Ignore:
Timestamp:
Apr 16, 2010, 1:42:28 PM (15 years ago)
Author:
rgrieder
Message:

Branch now compiling with GCC as well: Added an removed a few typenames and other stuff

Location:
code/branches/gamestates2/src/libraries/core/input
Files:
3 edited

Legend:

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

    r6662 r6745  
    159159            for (unsigned int iB = 0; iB < pressedButtons_.size(); ++iB)
    160160                for (unsigned int iS = 0; iS < inputStates_.size(); ++iS)
    161                     inputStates_[iS]->buttonEvent<ButtonEvent::THold, Traits::ButtonTypeParam>(
     161                    inputStates_[iS]->buttonEvent<ButtonEvent::THold, typename Traits::ButtonTypeParam>(
    162162                        this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(pressedButtons_[iB]));
    163163
     
    196196            // Call states
    197197            for (unsigned int i = 0; i < inputStates_.size(); ++i)
    198                 inputStates_[i]->buttonEvent<ButtonEvent::TPress, Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
     198                inputStates_[i]->buttonEvent<ButtonEvent::TPress, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
    199199        }
    200200
     
    218218            // Call states
    219219            for (unsigned int i = 0; i < inputStates_.size(); ++i)
    220                 inputStates_[i]->buttonEvent<ButtonEvent::TRelease, Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
     220                inputStates_[i]->buttonEvent<ButtonEvent::TRelease, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
    221221        }
    222222
  • code/branches/gamestates2/src/libraries/core/input/InputHandler.h

    r6662 r6745  
    118118        template<class T> void buttonEvent(unsigned int device, T button, ButtonEvent::THold)
    119119            { this->buttonHeld(button); }
    120         template<> void buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::TPress)
    121             { this->buttonPressed(device - InputDeviceEnumerator::FirstJoyStick, button); }
    122         template<> void buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::TRelease)
    123             { this->buttonReleased(device - InputDeviceEnumerator::FirstJoyStick, button); }
    124         template<> void buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::THold)
    125             { this->buttonHeld(device - InputDeviceEnumerator::FirstJoyStick, button); }
    126120
    127121        virtual void buttonPressed (const KeyEvent& evt) { }
     
    149143        static InputHandler EMPTY;
    150144    };
     145
     146    template<> inline void InputHandler::buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::TPress)
     147        { this->buttonPressed(device - InputDeviceEnumerator::FirstJoyStick, button); }
     148    template<> inline void InputHandler::buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::TRelease)
     149        { this->buttonReleased(device - InputDeviceEnumerator::FirstJoyStick, button); }
     150    template<> inline void InputHandler::buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::THold)
     151        { this->buttonHeld(device - InputDeviceEnumerator::FirstJoyStick, button); }
    151152}
    152153
  • code/branches/gamestates2/src/libraries/core/input/InputState.h

    r6662 r6745  
    205205
    206206    template <typename EventType, class ButtonTypeParam>
    207     FORCEINLINE void InputState::buttonEvent(unsigned int device, typename ButtonTypeParam button)
     207    FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button)
    208208    {
    209209        assert(device < handlers_.size());
Note: See TracChangeset for help on using the changeset viewer.