diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-16 02:58:43 +0100 | 
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-16 06:45:48 +0100 | 
| commit | 9282f42525ffabe812fae2d614050bf91b610df9 (patch) | |
| tree | 7a402eab9dde649c6137bccb5c5901c8fe4f5c9b | |
| parent | 4701f4748f0484e7dd75a6883bb7651697cc1e71 (diff) | |
logic/mappings: fix silly ctor
| -rw-r--r-- | logic/main-settings.hpp | 2 | ||||
| -rw-r--r-- | logic/mappings.cpp | 11 | ||||
| -rw-r--r-- | logic/mappings.hpp | 12 | 
3 files changed, 13 insertions, 12 deletions
| diff --git a/logic/main-settings.hpp b/logic/main-settings.hpp index 3ea68bca..00fbe9cc 100644 --- a/logic/main-settings.hpp +++ b/logic/main-settings.hpp @@ -39,7 +39,7 @@ struct OTR_LOGIC_EXPORT main_settings final      bundle b, b_map;      axis_opts a_x, a_y, a_z;      axis_opts a_yaw, a_pitch, a_roll; -    std::vector<axis_opts*> all_axis_opts; +    axis_opts* all_axis_opts[6];      value<bool> tcomp_p, tcomp_disable_tx, tcomp_disable_ty, tcomp_disable_tz;      value<bool> tcomp_disable_src_yaw, tcomp_disable_src_pitch, tcomp_disable_src_roll;      value<bool> tray_enabled, tray_start; diff --git a/logic/mappings.cpp b/logic/mappings.cpp index 81bade4b..57673540 100644 --- a/logic/mappings.cpp +++ b/logic/mappings.cpp @@ -23,3 +23,14 @@ void Map::load()      spline_alt.reload();  } + +Mappings::Mappings(axis_opts_impl::axis_opts** opts) : +    axes { +        { "spline-X",       "alt-spline-X",    *opts[TX] }, +        { "spline-Y",       "alt-spline-Y",    *opts[TY] }, +        { "spline-Z",       "alt-spline-Z",    *opts[TZ] }, +        { "spline-yaw",     "alt-spline-yaw",  *opts[Yaw] }, +        { "spline-pitch",   "alt-spline-pitch",*opts[Pitch] }, +        { "spline-roll",    "alt-spline-roll", *opts[Roll] } +    } +{} diff --git a/logic/mappings.hpp b/logic/mappings.hpp index 7bb5f9af..d08ae29c 100644 --- a/logic/mappings.hpp +++ b/logic/mappings.hpp @@ -29,17 +29,7 @@ class OTR_LOGIC_EXPORT Mappings final  private:      Map axes[6];  public: -    template<typename t> -    Mappings(t& opts) : -        axes { -            { "spline-X", "alt-spline-X", *opts[TX] }, -            { "spline-Y", "alt-spline-Y", *opts[TY] }, -            { "spline-Z", "alt-spline-Z", *opts[TZ] }, -            { "spline-yaw", "alt-spline-yaw", *opts[Yaw] }, -            { "spline-pitch", "alt-spline-pitch", *opts[Pitch] }, -            { "spline-roll", "alt-spline-roll", *opts[Roll] } -        } -    {} +    Mappings(axis_opts** opts);      Map& operator()(int i) { return axes[i]; }      const Map& operator()(int i) const { return axes[i]; } | 
