Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/libraries/core/input/InputState.h

    r8729 r11054  
    3535#include <string>
    3636#include <vector>
    37 #include <boost/function.hpp>
    38 #include <boost/bind.hpp>
     37#include <functional>
    3938
    4039#include "util/tribool.h"
     
    4443
    4544#define INPUT_STATE_PUSH_CALL(deviceIndex, functionName, ...) \
    46     InputManager::getInstance().pushCall(boost::function<void ()>(boost::bind(&InputHandler::functionName, handlers_[deviceIndex], __VA_ARGS__)))
     45    InputManager::getInstance().pushCall(std::function<void ()>(std::bind(&InputHandler::functionName, handlers_[deviceIndex], __VA_ARGS__)))
    4746
    4847namespace orxonox
     
    156155    private:
    157156        InputState(const std::string& name, bool bAlwaysGetsInput, bool bTransparent, InputStatePriority priority);
    158         ~InputState() { }
    159 
    160         void JoyStickQuantityChanged(const std::vector<JoyStick*>& joyStickList);
     157        ~InputState() = default;
     158
     159        virtual void JoyStickQuantityChanged(const std::vector<JoyStick*>& joyStickList) override;
    161160
    162161        //! Sets the priority (only to be used by the InputManager!)
     
    179178    {
    180179        for (unsigned int i = 0; i < handlers_.size(); ++i)
    181             if (handlers_[i] != NULL)
     180            if (handlers_[i] != nullptr)
    182181                INPUT_STATE_PUSH_CALL(i, allDevicesUpdated, dt);
    183182    }
     
    188187        {
    189188        case InputDeviceEnumerator::Keyboard:
    190             if (handlers_[keyboardIndex_s] != NULL)
     189            if (handlers_[keyboardIndex_s] != nullptr)
    191190                INPUT_STATE_PUSH_CALL(keyboardIndex_s, keyboardUpdated, dt);
    192191            break;
    193192
    194193        case InputDeviceEnumerator::Mouse:
    195             if (handlers_[mouseIndex_s] != NULL)
     194            if (handlers_[mouseIndex_s] != nullptr)
    196195                INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseUpdated, dt);
    197196            break;
    198197
    199198        default: // joy sticks
    200             if (handlers_[device] != NULL)
     199            if (handlers_[device] != nullptr)
    201200                INPUT_STATE_PUSH_CALL(device, joyStickUpdated, device - firstJoyStickIndex_s, dt);
    202201            break;
     
    208207    {
    209208        assert(device < handlers_.size());
    210         if (handlers_[device] != NULL)
     209        if (handlers_[device] != nullptr)
    211210        {
    212211            // We have to store the function pointer to tell the compiler about its actual type because of overloading
    213212            void (InputHandler::*function)(unsigned int, ButtonTypeParam, EventType) = &InputHandler::buttonEvent<ButtonTypeParam>;
    214             InputManager::getInstance().pushCall(boost::function<void ()>(boost::bind(function, handlers_[device], device, button, EventType())));
     213            InputManager::getInstance().pushCall(std::function<void ()>(std::bind(function, handlers_[device], device, button, EventType())));
    215214        }
    216215    }
     
    218217    ORX_FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
    219218    {
    220         if (handlers_[mouseIndex_s] != NULL)
     219        if (handlers_[mouseIndex_s] != nullptr)
    221220            INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseMoved, abs, rel, clippingSize);
    222221    }
     
    224223    ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
    225224    {
    226         if (handlers_[mouseIndex_s] != NULL)
     225        if (handlers_[mouseIndex_s] != nullptr)
    227226            INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseScrolled, abs, rel);
    228227    }
     
    231230    {
    232231        assert(device < handlers_.size());
    233         if (handlers_[device] != NULL)
     232        if (handlers_[device] != nullptr)
    234233            INPUT_STATE_PUSH_CALL(device, axisMoved, device - firstJoyStickIndex_s, axis, value);
    235234    }
Note: See TracChangeset for help on using the changeset viewer.