Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/input/KeyBinder.h

    r11052 r11071  
    3636#include <vector>
    3737#include <map>
    38 #include <boost/shared_ptr.hpp>
     38#include <memory>
    3939
    4040#include "InputHandler.h"
     
    8585        void compilePointerLists();
    8686        // from JoyStickQuantityListener interface
    87         virtual void JoyStickQuantityChanged(const std::vector<JoyStick*>& joyStickList);
    88 
    89         void allDevicesUpdated(float dt);
    90         void mouseUpdated(float dt);
    91         void joyStickUpdated(unsigned int joyStick, float dt);
     87        virtual void JoyStickQuantityChanged(const std::vector<JoyStick*>& joyStickList) override;
     88
     89        virtual void allDevicesUpdated(float dt) override;
     90        virtual void mouseUpdated(float dt) override;
     91        virtual void joyStickUpdated(unsigned int joyStick, float dt) override;
    9292        // internal
    9393        void tickHalfAxis(HalfAxis& halfAxis);
    9494
    95         void buttonPressed (const KeyEvent& evt);
    96         void buttonReleased(const KeyEvent& evt);
    97         void buttonHeld    (const KeyEvent& evt);
    98 
    99         void buttonPressed (MouseButtonCode::ByEnum button);
    100         void buttonReleased(MouseButtonCode::ByEnum button);
    101         void buttonHeld    (MouseButtonCode::ByEnum button);
    102         void mouseMoved    (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
    103         void mouseScrolled (int abs, int rel);
    104 
    105         void buttonPressed (unsigned int device, JoyStickButtonCode::ByEnum button);
    106         void buttonReleased(unsigned int device, JoyStickButtonCode::ByEnum button);
    107         void buttonHeld    (unsigned int device, JoyStickButtonCode::ByEnum button);
    108         void axisMoved     (unsigned int device, unsigned int axis, float value);
     95        virtual void buttonPressed (const KeyEvent& evt) override;
     96        virtual void buttonReleased(const KeyEvent& evt) override;
     97        virtual void buttonHeld    (const KeyEvent& evt) override;
     98
     99        virtual void buttonPressed (MouseButtonCode::ByEnum button) override;
     100        virtual void buttonReleased(MouseButtonCode::ByEnum button) override;
     101        virtual void buttonHeld    (MouseButtonCode::ByEnum button) override;
     102        virtual void mouseMoved    (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) override;
     103        virtual void mouseScrolled (int abs, int rel) override;
     104
     105        virtual void buttonPressed (unsigned int device, JoyStickButtonCode::ByEnum button) override;
     106        virtual void buttonReleased(unsigned int device, JoyStickButtonCode::ByEnum button) override;
     107        virtual void buttonHeld    (unsigned int device, JoyStickButtonCode::ByEnum button) override;
     108        virtual void axisMoved     (unsigned int device, unsigned int axis, float value) override;
    109109
    110110    protected: // variables
     
    128128        };
    129129        //! Actual key bindings for joy stick buttons
    130         std::vector<shared_ptr<JoyStickButtonVector> > joyStickButtons_;
     130        std::vector<std::shared_ptr<JoyStickButtonVector>> joyStickButtons_;
    131131        //! Helper class to use something like std:vector<HalfAxis[48]>
    132132        struct JoyStickAxisVector
     
    136136        };
    137137        //! Actual key bindings for joy stick axes (and sliders)
    138         std::vector<shared_ptr<JoyStickAxisVector> > joyStickAxes_;
     138        std::vector<std::shared_ptr<JoyStickAxisVector>> joyStickAxes_;
    139139
    140140        //! Pointer map with all Buttons, including half axes
     
    143143        std::vector<HalfAxis*> allHalfAxes_;
    144144        //! Maps input commands to all Button names, including half axes
    145         std::map< std::string, std::vector<std::string> > allCommands_;
     145        std::map< std::string, std::vector<std::string>> allCommands_;
    146146
    147147        /**
     
    160160        //! Name of the file used in this KeyBinder (constant!)
    161161        const std::string filename_;
    162         //! Config file used. NULL in case of KeyDetector. Also indicates whether we've already loaded.
     162        //! Config file used. nullptr in case of KeyDetector. Also indicates whether we've already loaded.
    163163        ConfigFile* configFile_;
    164164        //! Config file from the data directory that only serves as fallback
     
    227227    {
    228228        // execute all buffered bindings (additional parameter)
    229         for (unsigned int i = 0; i < paramCommandBuffer_.size(); i++)
     229        for (BufferedParamCommand* command : paramCommandBuffer_)
    230230        {
    231             paramCommandBuffer_[i]->rel_ *= dt;
    232             paramCommandBuffer_[i]->execute();
     231            command->rel_ *= dt;
     232            command->execute();
    233233        }
    234234
    235235        // always reset the relative movement of the mouse
    236         for (unsigned int i = 0; i < MouseAxisCode::numberOfAxes * 2; i++)
    237             mouseAxes_[i].relVal_ = 0.0f;
     236        for (HalfAxis& axis : mouseAxes_)
     237            axis.relVal_ = 0.0f;
    238238    }
    239239}// tolua_export
Note: See TracChangeset for help on using the changeset viewer.