Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 28, 2008, 11:57:27 PM (15 years ago)
Author:
rgrieder
Message:

Removed ugly joy stick calibration hack.
The calibration is now stored in joystick_calibration.ini for every joy stick you ever connect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/core/input/InputManager.h

    r2543 r2544  
    7171    struct JoyStickCalibration
    7272    {
    73         int zeroStates[24];
     73        int middleValue[24];
    7474        float positiveCoeff[24];
    7575        float negativeCoeff[24];
     
    146146        void _initialiseMouse();
    147147        void _initialiseJoySticks();
    148         void _configureNumberOfJoySticks();
     148        void _configureJoySticks();
     149
     150        void _loadCalibration();
     151        void _startCalibration();
     152        void _completeCalibration();
     153        void _evaluateCalibration();
    149154
    150155        void _destroyKeyboard();
     
    155160
    156161        void _reload(bool joyStickSupport);
    157 
    158         void _completeCalibration();
    159162
    160163        void _fireAxis(unsigned int iJoyStick, int axis, int value);
     
    179182
    180183        void setConfigValues();
     184        void _calibrationFileCallback();
    181185
    182186    private: // variables
     
    186190        std::vector<OIS::JoyStick*>         joySticks_;            //!< OIS joy sticks
    187191        unsigned int                        joySticksSize_;
     192        std::vector<std::string>            joyStickIDs_;          //!< Execution unique identification strings for the joy sticks
    188193        unsigned int                        devicesNum_;
    189194        size_t                              windowHnd_;            //!< Render window handle
     
    208213
    209214        // joystick calibration
    210         //std::vector<int> marginalsMaxConfig_;
    211         //std::vector<int> marginalsMinConfig_;
    212         int                                 marginalsMax_[24];
    213         int                                 marginalsMin_[24];
    214         bool                                bCalibrated_;
    215         bool                                bCalibrating_;
     215        std::vector<std::vector<int> >      joyStickMinValues_;
     216        std::vector<std::vector<int> >      joyStickMaxValues_;
     217        std::vector<std::vector<int> >      joyStickMiddleValues_;
     218        std::vector<ConfigValueContainer*>  calibrationConfigValueContainers_;
     219        std::vector<JoyStickCalibration>    joyStickCalibrations_;
    216220
    217221        unsigned int                        keyboardModifiers_;    //!< Bit mask representing keyboard modifiers.
    218222        std::vector<POVStates>              povStates_;            //!< Keeps track of the joy stick POV states.
    219223        std::vector<SliderStates>           sliderStates_;         //!< Keeps track of the possibly two slider axes.
    220         std::vector<JoyStickCalibration>    joySticksCalibration_;
    221224
    222225        std::vector<Key>                    keysDown_;
     
    224227        std::vector<std::vector<JoyStickButtonCode::ByEnum> >  joyStickButtonsDown_;
    225228
     229        // ConfigValues
     230        std::string                         calibrationFilename_;  //!< Joy stick calibration ini filename
    226231
    227232        static InputManager*                singletonRef_s;
Note: See TracChangeset for help on using the changeset viewer.