diff --git a/include/avnd/binding/ossia/geometry.hpp b/include/avnd/binding/ossia/geometry.hpp index 60b4646c..45de687e 100644 --- a/include/avnd/binding/ossia/geometry.hpp +++ b/include/avnd/binding/ossia/geometry.hpp @@ -378,11 +378,13 @@ void mesh_from_ossia(const ossia::geometry& src, T& dst) for(const ossia::geometry::binding& in : src.bindings) { using value_type = typename decltype(dst.bindings)::value_type; + using stride_type = decltype(value_type::stride); + using step_rate_type = decltype(value_type::step_rate); + using classification_type = decltype(value_type::classification); dst.bindings.push_back({ - .stride = in.stride, - .step_rate = in.step_rate, - .classification - = static_cast(in.classification) // FIXME + .stride = static_cast(in.stride), + .step_rate = static_cast(in.step_rate), + .classification = static_cast(in.classification) }); } @@ -390,11 +392,15 @@ void mesh_from_ossia(const ossia::geometry& src, T& dst) for(const ossia::geometry::attribute& in : src.attributes) { using value_type = typename decltype(dst.attributes)::value_type; + using binding_type = decltype(value_type::binding); + using location_type = decltype(value_type::location); + using format_type = decltype(value_type::format); + using offset_type = decltype(value_type::offset); dst.attributes.push_back( - {.binding = in.binding, - .location = static_cast(in.location), - .format = static_cast(in.format), // FIXME - .offset = in.offset}); + {.binding = static_cast(in.binding), + .location = static_cast(in.location), + .format = static_cast(in.format), + .offset = static_cast(in.offset)}); } } diff --git a/include/avnd/wrappers/controls.hpp b/include/avnd/wrappers/controls.hpp index ae256bf8..fa0d7474 100644 --- a/include/avnd/wrappers/controls.hpp +++ b/include/avnd/wrappers/controls.hpp @@ -14,6 +14,26 @@ namespace avnd { +// Was a lambda but turned into a function +// because MSVC: +// error C2039: 'effect': is not a member of 'examples::helpers::SpriteReader' + +template +static constexpr inline void init_controls_impl(F& state, T& ctl) +{ + if constexpr(avnd::has_range) + { + static_constexpr auto c = avnd::get_range(); + // clang-format off + if_possible(ctl.value = c.values[c.init].second) // For {string,value} enums + else if_possible(ctl.value = c.values[c.init]) // For string enums + else if_possible(ctl.value = c.init); // Default case + // clang-format on + } + + if_possible(ctl.update(state.effect)); +} + template static constexpr void init_controls(F& state) { @@ -25,19 +45,8 @@ static constexpr void init_controls(F& state) } else { - avnd::for_each_field_ref(state.inputs, [&](T& ctl) { - if constexpr(avnd::has_range) - { - static_constexpr auto c = avnd::get_range(); - // clang-format off - if_possible(ctl.value = c.values[c.init].second) // For {string,value} enums - else if_possible(ctl.value = c.values[c.init]) // For string enums - else if_possible(ctl.value = c.init); // Default case - // clang-format on - } - - if_possible(ctl.update(state.effect)); - }); + avnd::for_each_field_ref( + state.inputs, [&](T& ctl) { init_controls_impl(state, ctl); }); } } diff --git a/include/avnd/wrappers/process_execution.hpp b/include/avnd/wrappers/process_execution.hpp index cb7feb76..146d2163 100644 --- a/include/avnd/wrappers/process_execution.hpp +++ b/include/avnd/wrappers/process_execution.hpp @@ -91,7 +91,9 @@ auto current_tick(avnd::effect_container& implementation, const Tick& tick_da requires { t.signature; } && requires { tick_data.signature(); }) { auto [num, denom] = tick_data.signature(); - t.signature = {num, denom}; + auto& [tnum, tdenom] = t.signature; + tnum = num; + tdenom = denom; } if_possible(t.position_in_frames = tick_data.position_in_frames()); if_possible(t.position_in_seconds = tick_data.position_in_seconds());