From 914d78b4a95d124c748573357e3b5c176cebad0f Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 30 Apr 2021 16:06:03 -0400 Subject: [PATCH] Removed clone in animations. Added GATs to animations to do so. --- voxygen/anim/src/biped_large/alpha.rs | 10 +++++----- voxygen/anim/src/biped_large/beam.rs | 6 +++--- voxygen/anim/src/biped_large/beta.rs | 10 +++++----- voxygen/anim/src/biped_large/blink.rs | 6 +++--- voxygen/anim/src/biped_large/charge.rs | 6 +++--- voxygen/anim/src/biped_large/dash.rs | 6 +++--- voxygen/anim/src/biped_large/equip.rs | 6 +++--- voxygen/anim/src/biped_large/idle.rs | 6 +++--- voxygen/anim/src/biped_large/jump.rs | 6 +++--- voxygen/anim/src/biped_large/leapmelee.rs | 6 +++--- voxygen/anim/src/biped_large/run.rs | 6 +++--- voxygen/anim/src/biped_large/shockwave.rs | 6 +++--- voxygen/anim/src/biped_large/shoot.rs | 12 ++++++------ voxygen/anim/src/biped_large/spin.rs | 6 +++--- voxygen/anim/src/biped_large/spinmelee.rs | 6 +++--- voxygen/anim/src/biped_large/stunned.rs | 8 ++++---- voxygen/anim/src/biped_large/summon.rs | 6 +++--- voxygen/anim/src/biped_large/wield.rs | 10 +++++----- voxygen/anim/src/biped_small/alpha.rs | 6 +++--- voxygen/anim/src/biped_small/dash.rs | 6 +++--- voxygen/anim/src/biped_small/idle.rs | 6 +++--- voxygen/anim/src/biped_small/run.rs | 6 +++--- voxygen/anim/src/biped_small/shoot.rs | 6 +++--- voxygen/anim/src/biped_small/stunned.rs | 6 +++--- voxygen/anim/src/biped_small/wield.rs | 6 +++--- voxygen/anim/src/bird_large/alpha.rs | 6 +++--- voxygen/anim/src/bird_large/breathe.rs | 6 +++--- voxygen/anim/src/bird_large/feed.rs | 6 +++--- voxygen/anim/src/bird_large/fly.rs | 6 +++--- voxygen/anim/src/bird_large/idle.rs | 6 +++--- voxygen/anim/src/bird_large/run.rs | 6 +++--- voxygen/anim/src/bird_large/shockwave.rs | 6 +++--- voxygen/anim/src/bird_large/shoot.rs | 6 +++--- voxygen/anim/src/bird_large/stunned.rs | 6 +++--- voxygen/anim/src/bird_large/swim.rs | 6 +++--- voxygen/anim/src/bird_medium/feed.rs | 6 +++--- voxygen/anim/src/bird_medium/fly.rs | 6 +++--- voxygen/anim/src/bird_medium/idle.rs | 6 +++--- voxygen/anim/src/bird_medium/run.rs | 6 +++--- voxygen/anim/src/character/alpha.rs | 6 +++--- voxygen/anim/src/character/beam.rs | 6 +++--- voxygen/anim/src/character/beta.rs | 6 +++--- voxygen/anim/src/character/block.rs | 6 +++--- voxygen/anim/src/character/chargeswing.rs | 6 +++--- voxygen/anim/src/character/climb.rs | 6 +++--- voxygen/anim/src/character/dance.rs | 6 +++--- voxygen/anim/src/character/dash.rs | 6 +++--- voxygen/anim/src/character/equip.rs | 6 +++--- voxygen/anim/src/character/glidewield.rs | 6 +++--- voxygen/anim/src/character/gliding.rs | 6 +++--- voxygen/anim/src/character/idle.rs | 6 +++--- voxygen/anim/src/character/jump.rs | 6 +++--- voxygen/anim/src/character/leapmelee.rs | 6 +++--- voxygen/anim/src/character/repeater.rs | 6 +++--- voxygen/anim/src/character/roll.rs | 6 +++--- voxygen/anim/src/character/run.rs | 6 +++--- voxygen/anim/src/character/shockwave.rs | 6 +++--- voxygen/anim/src/character/shoot.rs | 6 +++--- voxygen/anim/src/character/sit.rs | 6 +++--- voxygen/anim/src/character/sneak.rs | 6 +++--- voxygen/anim/src/character/spin.rs | 6 +++--- voxygen/anim/src/character/spinmelee.rs | 6 +++--- voxygen/anim/src/character/staggered.rs | 6 +++--- voxygen/anim/src/character/stand.rs | 6 +++--- voxygen/anim/src/character/stunned.rs | 6 +++--- voxygen/anim/src/character/swim.rs | 6 +++--- voxygen/anim/src/character/swimwield.rs | 6 +++--- voxygen/anim/src/character/talk.rs | 6 +++--- voxygen/anim/src/character/wield.rs | 6 +++--- voxygen/anim/src/dragon/fly.rs | 6 +++--- voxygen/anim/src/dragon/idle.rs | 6 +++--- voxygen/anim/src/dragon/run.rs | 6 +++--- voxygen/anim/src/fish_medium/idle.rs | 6 +++--- voxygen/anim/src/fish_medium/swim.rs | 6 +++--- voxygen/anim/src/fish_small/idle.rs | 6 +++--- voxygen/anim/src/fish_small/swim.rs | 6 +++--- voxygen/anim/src/golem/alpha.rs | 6 +++--- voxygen/anim/src/golem/idle.rs | 6 +++--- voxygen/anim/src/golem/run.rs | 6 +++--- voxygen/anim/src/golem/shockwave.rs | 6 +++--- voxygen/anim/src/golem/spinmelee.rs | 6 +++--- voxygen/anim/src/lib.rs | 13 +++++++------ voxygen/anim/src/object/beam.rs | 6 +++--- voxygen/anim/src/object/idle.rs | 6 +++--- voxygen/anim/src/object/shoot.rs | 6 +++--- voxygen/anim/src/quadruped_low/alpha.rs | 6 +++--- voxygen/anim/src/quadruped_low/beta.rs | 6 +++--- voxygen/anim/src/quadruped_low/breathe.rs | 6 +++--- voxygen/anim/src/quadruped_low/dash.rs | 6 +++--- voxygen/anim/src/quadruped_low/idle.rs | 6 +++--- voxygen/anim/src/quadruped_low/jump.rs | 6 +++--- voxygen/anim/src/quadruped_low/run.rs | 6 +++--- voxygen/anim/src/quadruped_low/shoot.rs | 6 +++--- voxygen/anim/src/quadruped_low/stunned.rs | 6 +++--- voxygen/anim/src/quadruped_low/tailwhip.rs | 6 +++--- voxygen/anim/src/quadruped_medium/alpha.rs | 6 +++--- voxygen/anim/src/quadruped_medium/beta.rs | 6 +++--- voxygen/anim/src/quadruped_medium/dash.rs | 6 +++--- voxygen/anim/src/quadruped_medium/feed.rs | 6 +++--- voxygen/anim/src/quadruped_medium/hoof.rs | 6 +++--- voxygen/anim/src/quadruped_medium/idle.rs | 6 +++--- voxygen/anim/src/quadruped_medium/jump.rs | 6 +++--- voxygen/anim/src/quadruped_medium/leapmelee.rs | 6 +++--- voxygen/anim/src/quadruped_medium/run.rs | 6 +++--- voxygen/anim/src/quadruped_medium/stunned.rs | 6 +++--- voxygen/anim/src/quadruped_small/alpha.rs | 6 +++--- voxygen/anim/src/quadruped_small/feed.rs | 6 +++--- voxygen/anim/src/quadruped_small/idle.rs | 6 +++--- voxygen/anim/src/quadruped_small/jump.rs | 6 +++--- voxygen/anim/src/quadruped_small/run.rs | 6 +++--- voxygen/anim/src/quadruped_small/stunned.rs | 6 +++--- voxygen/anim/src/ship/idle.rs | 6 +++--- voxygen/anim/src/theropod/alpha.rs | 6 +++--- voxygen/anim/src/theropod/beta.rs | 6 +++--- voxygen/anim/src/theropod/dash.rs | 6 +++--- voxygen/anim/src/theropod/idle.rs | 6 +++--- voxygen/anim/src/theropod/jump.rs | 6 +++--- voxygen/anim/src/theropod/run.rs | 6 +++--- voxygen/src/scene/figure/mod.rs | 2 +- 119 files changed, 369 insertions(+), 368 deletions(-) diff --git a/voxygen/anim/src/biped_large/alpha.rs b/voxygen/anim/src/biped_large/alpha.rs index b43b882417..df9b9a6796 100644 --- a/voxygen/anim/src/biped_large/alpha.rs +++ b/voxygen/anim/src/biped_large/alpha.rs @@ -11,9 +11,9 @@ use std::f32::consts::PI; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency = ( - (Option, Option), - (Option, Option), + type Dependency<'a> = ( + (Option, Option<&'a AbilitySpec>), + (Option, Option<&'a AbilitySpec>), Vec3, f32, Option, @@ -26,7 +26,7 @@ impl Animation for AlphaAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_alpha")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( (active_tool_kind, active_tool_spec), @@ -35,7 +35,7 @@ impl Animation for AlphaAnimation { _global_time, stage_section, acc_vel, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/beam.rs b/voxygen/anim/src/biped_large/beam.rs index 4f77542733..75633a0454 100644 --- a/voxygen/anim/src/biped_large/beam.rs +++ b/voxygen/anim/src/biped_large/beam.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct BeamAnimation; impl Animation for BeamAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, f32, @@ -23,9 +23,9 @@ impl Animation for BeamAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_beam")] #[allow(clippy::single_match)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section, acc_vel): Self::Dependency, + (active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section, acc_vel): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/beta.rs b/voxygen/anim/src/biped_large/beta.rs index 0e42f907a2..331ca0b243 100644 --- a/voxygen/anim/src/biped_large/beta.rs +++ b/voxygen/anim/src/biped_large/beta.rs @@ -11,9 +11,9 @@ use std::f32::consts::PI; pub struct BetaAnimation; impl Animation for BetaAnimation { - type Dependency = ( - (Option, Option), - (Option, Option), + type Dependency<'a> = ( + (Option, Option<&'a AbilitySpec>), + (Option, Option<&'a AbilitySpec>), Vec3, f32, Option, @@ -25,7 +25,7 @@ impl Animation for BetaAnimation { const UPDATE_FN: &'static [u8] = b"biped_large_beta\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_beta")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( (active_tool_kind, active_tool_spec), @@ -34,7 +34,7 @@ impl Animation for BetaAnimation { _global_time, stage_section, acc_vel, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/blink.rs b/voxygen/anim/src/biped_large/blink.rs index 5146c5d84c..3905e4a508 100644 --- a/voxygen/anim/src/biped_large/blink.rs +++ b/voxygen/anim/src/biped_large/blink.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct BlinkAnimation; impl Animation for BlinkAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, Vec3, @@ -23,9 +23,9 @@ impl Animation for BlinkAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_blink")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency, + (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/charge.rs b/voxygen/anim/src/biped_large/charge.rs index 6982fcb1ca..0ace47771e 100644 --- a/voxygen/anim/src/biped_large/charge.rs +++ b/voxygen/anim/src/biped_large/charge.rs @@ -7,7 +7,7 @@ use common::comp::item::ToolKind; pub struct ChargeAnimation; impl Animation for ChargeAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, f32, @@ -21,9 +21,9 @@ impl Animation for ChargeAnimation { const UPDATE_FN: &'static [u8] = b"biped_large_charge\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_charge")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, velocity, orientation, last_ori, _global_time): Self::Dependency, + (active_tool_kind, _second_tool_kind, velocity, orientation, last_ori, _global_time): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/dash.rs b/voxygen/anim/src/biped_large/dash.rs index 932ba3cd39..8257b9d075 100644 --- a/voxygen/anim/src/biped_large/dash.rs +++ b/voxygen/anim/src/biped_large/dash.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct DashAnimation; impl Animation for DashAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, Vec3, @@ -23,9 +23,9 @@ impl Animation for DashAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_dash")] #[allow(clippy::single_match)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency, + (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/equip.rs b/voxygen/anim/src/biped_large/equip.rs index d31485ca5e..b40ebd6ff2 100644 --- a/voxygen/anim/src/biped_large/equip.rs +++ b/voxygen/anim/src/biped_large/equip.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct EquipAnimation; impl Animation for EquipAnimation { - type Dependency = (Option, Option, f32, f32); + type Dependency<'a> = (Option, Option, f32, f32); type Skeleton = BipedLargeSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,9 +16,9 @@ impl Animation for EquipAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_equip")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, _velocity, _global_time): Self::Dependency, + (active_tool_kind, _second_tool_kind, _velocity, _global_time): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/idle.rs b/voxygen/anim/src/biped_large/idle.rs index 80a2e183de..62bbf6c87b 100644 --- a/voxygen/anim/src/biped_large/idle.rs +++ b/voxygen/anim/src/biped_large/idle.rs @@ -8,16 +8,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = (Option, Option, f32); + type Dependency<'a> = (Option, Option, f32); type Skeleton = BipedLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"biped_large_idle\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, global_time): Self::Dependency, + (active_tool_kind, _second_tool_kind, global_time): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/jump.rs b/voxygen/anim/src/biped_large/jump.rs index aa88dec809..e9586d068c 100644 --- a/voxygen/anim/src/biped_large/jump.rs +++ b/voxygen/anim/src/biped_large/jump.rs @@ -8,16 +8,16 @@ use std::f32::consts::PI; pub struct JumpAnimation; impl Animation for JumpAnimation { - type Dependency = (Option, Option, f32); + type Dependency<'a> = (Option, Option, f32); type Skeleton = BipedLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"biped_large_jump\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_jump")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, _global_time): Self::Dependency, + (active_tool_kind, _second_tool_kind, _global_time): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/leapmelee.rs b/voxygen/anim/src/biped_large/leapmelee.rs index e7eada8b2e..38634f8894 100644 --- a/voxygen/anim/src/biped_large/leapmelee.rs +++ b/voxygen/anim/src/biped_large/leapmelee.rs @@ -6,7 +6,7 @@ use common::{comp::item::ToolKind, states::utils::StageSection}; pub struct LeapAnimation; impl Animation for LeapAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, Vec3, @@ -20,9 +20,9 @@ impl Animation for LeapAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_leapmelee")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency, + (active_tool_kind, _second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/run.rs b/voxygen/anim/src/biped_large/run.rs index b6366f8b6f..2b8a6d67d5 100644 --- a/voxygen/anim/src/biped_large/run.rs +++ b/voxygen/anim/src/biped_large/run.rs @@ -18,14 +18,14 @@ type RunAnimationDependency = ( f32, ); impl Animation for RunAnimation { - type Dependency = RunAnimationDependency; + type Dependency<'a> = RunAnimationDependency; type Skeleton = BipedLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"biped_large_run\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( active_tool_kind, @@ -36,7 +36,7 @@ impl Animation for RunAnimation { global_time, avg_vel, acc_vel, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/shockwave.rs b/voxygen/anim/src/biped_large/shockwave.rs index 07d8d6b76f..e2ba47be04 100644 --- a/voxygen/anim/src/biped_large/shockwave.rs +++ b/voxygen/anim/src/biped_large/shockwave.rs @@ -7,7 +7,7 @@ use common::{comp::item::ToolKind, states::utils::StageSection}; pub struct ShockwaveAnimation; impl Animation for ShockwaveAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, f32, @@ -21,9 +21,9 @@ impl Animation for ShockwaveAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_shockwave")] #[allow(clippy::single_match)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section): Self::Dependency, + (_active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/shoot.rs b/voxygen/anim/src/biped_large/shoot.rs index 83a8efedd6..7656e766f6 100644 --- a/voxygen/anim/src/biped_large/shoot.rs +++ b/voxygen/anim/src/biped_large/shoot.rs @@ -10,9 +10,9 @@ use std::f32::consts::PI; pub struct ShootAnimation; -type ShootAnimationDependency = ( - (Option, Option), - (Option, Option), +type ShootAnimationDependency<'a> = ( + (Option, Option<&'a AbilitySpec>), + (Option, Option<&'a AbilitySpec>), Vec3, Vec3, Vec3, @@ -21,14 +21,14 @@ type ShootAnimationDependency = ( f32, ); impl Animation for ShootAnimation { - type Dependency = ShootAnimationDependency; + type Dependency<'a> = ShootAnimationDependency<'a>; type Skeleton = BipedLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"biped_large_shoot\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_shoot")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( (active_tool_kind, active_tool_spec), @@ -39,7 +39,7 @@ impl Animation for ShootAnimation { _global_time, stage_section, acc_vel, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/spin.rs b/voxygen/anim/src/biped_large/spin.rs index 873e816707..b5357f4738 100644 --- a/voxygen/anim/src/biped_large/spin.rs +++ b/voxygen/anim/src/biped_large/spin.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct SpinAnimation; impl Animation for SpinAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, f32, @@ -20,9 +20,9 @@ impl Animation for SpinAnimation { const UPDATE_FN: &'static [u8] = b"biped_large_spin\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_spin")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, _global_time, stage_section): Self::Dependency, + (active_tool_kind, _second_tool_kind, _global_time, stage_section): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/spinmelee.rs b/voxygen/anim/src/biped_large/spinmelee.rs index ea485d1665..c6f764db6f 100644 --- a/voxygen/anim/src/biped_large/spinmelee.rs +++ b/voxygen/anim/src/biped_large/spinmelee.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct SpinMeleeAnimation; impl Animation for SpinMeleeAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, Vec3, @@ -23,9 +23,9 @@ impl Animation for SpinMeleeAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_spinmelee")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency, + (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/stunned.rs b/voxygen/anim/src/biped_large/stunned.rs index d11cf37d61..87d8ab9538 100644 --- a/voxygen/anim/src/biped_large/stunned.rs +++ b/voxygen/anim/src/biped_large/stunned.rs @@ -11,8 +11,8 @@ use std::f32::consts::PI; pub struct StunnedAnimation; impl Animation for StunnedAnimation { - type Dependency = ( - (Option, Option), + type Dependency<'a> = ( + (Option, Option<&'a AbilitySpec>), Vec3, f32, Option, @@ -23,9 +23,9 @@ impl Animation for StunnedAnimation { const UPDATE_FN: &'static [u8] = b"biped_large_stunned\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_stunned")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - ((active_tool_kind, active_tool_spec), velocity, acc_vel, stage_section): Self::Dependency, + ((active_tool_kind, active_tool_spec), velocity, acc_vel, stage_section): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/summon.rs b/voxygen/anim/src/biped_large/summon.rs index 087800441e..ce462c10ba 100644 --- a/voxygen/anim/src/biped_large/summon.rs +++ b/voxygen/anim/src/biped_large/summon.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct SummonAnimation; impl Animation for SummonAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, Vec3, @@ -23,9 +23,9 @@ impl Animation for SummonAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_summon")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency, + (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/wield.rs b/voxygen/anim/src/biped_large/wield.rs index de542bb968..b1f4d90c70 100644 --- a/voxygen/anim/src/biped_large/wield.rs +++ b/voxygen/anim/src/biped_large/wield.rs @@ -8,9 +8,9 @@ use std::{f32::consts::PI, ops::Mul}; pub struct WieldAnimation; impl Animation for WieldAnimation { - type Dependency = ( - (Option, Option), - (Option, Option), + type Dependency<'a> = ( + (Option, Option<&'a AbilitySpec>), + (Option, Option<&'a AbilitySpec>), Vec3, f32, f32, @@ -21,9 +21,9 @@ impl Animation for WieldAnimation { const UPDATE_FN: &'static [u8] = b"biped_large_wield\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_wield")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - ((active_tool_kind, active_tool_spec), _second_tool, velocity, global_time, acc_vel): Self::Dependency, + ((active_tool_kind, active_tool_spec), _second_tool, velocity, global_time, acc_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_small/alpha.rs b/voxygen/anim/src/biped_small/alpha.rs index 05167722cd..69dc4b0f10 100644 --- a/voxygen/anim/src/biped_small/alpha.rs +++ b/voxygen/anim/src/biped_small/alpha.rs @@ -20,7 +20,7 @@ type AlphaAnimationDependency = ( ); impl Animation for AlphaAnimation { - type Dependency = AlphaAnimationDependency; + type Dependency<'a> = AlphaAnimationDependency; type Skeleton = BipedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -28,7 +28,7 @@ impl Animation for AlphaAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_alpha")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( active_tool_kind, @@ -40,7 +40,7 @@ impl Animation for AlphaAnimation { _acc_vel, stage_section, timer, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_small/dash.rs b/voxygen/anim/src/biped_small/dash.rs index 5d28232b1d..da2077dccb 100644 --- a/voxygen/anim/src/biped_small/dash.rs +++ b/voxygen/anim/src/biped_small/dash.rs @@ -19,7 +19,7 @@ type DashAnimationDependency = ( ); impl Animation for DashAnimation { - type Dependency = DashAnimationDependency; + type Dependency<'a> = DashAnimationDependency; type Skeleton = BipedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -27,7 +27,7 @@ impl Animation for DashAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_dash")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( velocity, @@ -38,7 +38,7 @@ impl Animation for DashAnimation { _acc_vel, stage_section, _timer, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_small/idle.rs b/voxygen/anim/src/biped_small/idle.rs index e179483db4..dde4419613 100644 --- a/voxygen/anim/src/biped_small/idle.rs +++ b/voxygen/anim/src/biped_small/idle.rs @@ -8,7 +8,7 @@ pub struct IdleAnimation; type IdleAnimationDependency = (Vec3, Vec3, Vec3, f32, Vec3); impl Animation for IdleAnimation { - type Dependency = IdleAnimationDependency; + type Dependency<'a> = IdleAnimationDependency; type Skeleton = BipedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,9 +16,9 @@ impl Animation for IdleAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency, + (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_small/run.rs b/voxygen/anim/src/biped_small/run.rs index a131a2adbb..560b32fd38 100644 --- a/voxygen/anim/src/biped_small/run.rs +++ b/voxygen/anim/src/biped_small/run.rs @@ -9,7 +9,7 @@ pub struct RunAnimation; type RunAnimationDependency = (Vec3, Vec3, Vec3, f32, Vec3, f32); impl Animation for RunAnimation { - type Dependency = RunAnimationDependency; + type Dependency<'a> = RunAnimationDependency; type Skeleton = BipedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -17,9 +17,9 @@ impl Animation for RunAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, global_time, _avg_vel, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, global_time, _avg_vel, acc_vel): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_small/shoot.rs b/voxygen/anim/src/biped_small/shoot.rs index 9bc703c8cb..4f5c52a20b 100644 --- a/voxygen/anim/src/biped_small/shoot.rs +++ b/voxygen/anim/src/biped_small/shoot.rs @@ -20,7 +20,7 @@ type ShootAnimationDependency = ( ); impl Animation for ShootAnimation { - type Dependency = ShootAnimationDependency; + type Dependency<'a> = ShootAnimationDependency; type Skeleton = BipedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -28,7 +28,7 @@ impl Animation for ShootAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_shoot")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( active_tool_kind, @@ -40,7 +40,7 @@ impl Animation for ShootAnimation { _acc_vel, stage_section, _timer, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_small/stunned.rs b/voxygen/anim/src/biped_small/stunned.rs index c48b385a09..437fc92753 100644 --- a/voxygen/anim/src/biped_small/stunned.rs +++ b/voxygen/anim/src/biped_small/stunned.rs @@ -21,7 +21,7 @@ type StunnedAnimationDependency = ( ); impl Animation for StunnedAnimation { - type Dependency = StunnedAnimationDependency; + type Dependency<'a> = StunnedAnimationDependency; type Skeleton = BipedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -29,7 +29,7 @@ impl Animation for StunnedAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_stunned")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( active_tool_kind, @@ -42,7 +42,7 @@ impl Animation for StunnedAnimation { wield_status, stage_section, timer, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_small/wield.rs b/voxygen/anim/src/biped_small/wield.rs index 2914e160de..0b642440fd 100644 --- a/voxygen/anim/src/biped_small/wield.rs +++ b/voxygen/anim/src/biped_small/wield.rs @@ -18,7 +18,7 @@ type WieldAnimationDependency = ( ); impl Animation for WieldAnimation { - type Dependency = WieldAnimationDependency; + type Dependency<'a> = WieldAnimationDependency; type Skeleton = BipedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -26,9 +26,9 @@ impl Animation for WieldAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_wield")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, velocity, _orientation, _last_ori, _global_time, _avg_vel, acc_vel): Self::Dependency, + (active_tool_kind, velocity, _orientation, _last_ori, _global_time, _avg_vel, acc_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/alpha.rs b/voxygen/anim/src/bird_large/alpha.rs index 99f5c56566..39f18af013 100644 --- a/voxygen/anim/src/bird_large/alpha.rs +++ b/voxygen/anim/src/bird_large/alpha.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency = (Option, Vec3, Vec3, bool); + type Dependency<'a> = (Option, Vec3, Vec3, bool); type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_alpha\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_alpha")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (stage_section, orientation, last_ori, on_ground): Self::Dependency, + (stage_section, orientation, last_ori, on_ground): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/breathe.rs b/voxygen/anim/src/bird_large/breathe.rs index 9d9c632619..518df0b4af 100644 --- a/voxygen/anim/src/bird_large/breathe.rs +++ b/voxygen/anim/src/bird_large/breathe.rs @@ -17,16 +17,16 @@ type BreatheAnimationDependency = ( ); impl Animation for BreatheAnimation { - type Dependency = BreatheAnimationDependency; + type Dependency<'a> = BreatheAnimationDependency; type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_breathe\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_breathe")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (global_time, orientation, last_ori, stage_section, timer, look_dir, on_ground): Self::Dependency, + (global_time, orientation, last_ori, stage_section, timer, look_dir, on_ground): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/feed.rs b/voxygen/anim/src/bird_large/feed.rs index 59daa60311..ccc6078cc5 100644 --- a/voxygen/anim/src/bird_large/feed.rs +++ b/voxygen/anim/src/bird_large/feed.rs @@ -7,16 +7,16 @@ use std::ops::Mul; pub struct FeedAnimation; impl Animation for FeedAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_feed\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_feed")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/fly.rs b/voxygen/anim/src/bird_large/fly.rs index 227be64ae0..9c042b87ae 100644 --- a/voxygen/anim/src/bird_large/fly.rs +++ b/voxygen/anim/src/bird_large/fly.rs @@ -6,16 +6,16 @@ use super::{ pub struct FlyAnimation; impl Animation for FlyAnimation { - type Dependency = (Vec3, Vec3, Vec3); + type Dependency<'a> = (Vec3, Vec3, Vec3); type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_fly\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_fly")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori): Self::Dependency, + (velocity, orientation, last_ori): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/idle.rs b/voxygen/anim/src/bird_large/idle.rs index ced671cb26..bcedcd54dc 100644 --- a/voxygen/anim/src/bird_large/idle.rs +++ b/voxygen/anim/src/bird_large/idle.rs @@ -7,16 +7,16 @@ use std::ops::Mul; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_idle\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/run.rs b/voxygen/anim/src/bird_large/run.rs index cde5f7aba5..e5f940d016 100644 --- a/voxygen/anim/src/bird_large/run.rs +++ b/voxygen/anim/src/bird_large/run.rs @@ -7,16 +7,16 @@ use std::f32::consts::PI; pub struct RunAnimation; impl Animation for RunAnimation { - type Dependency = (Vec3, Vec3, Vec3, f32); + type Dependency<'a> = (Vec3, Vec3, Vec3, f32); type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_run\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, acc_vel): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/shockwave.rs b/voxygen/anim/src/bird_large/shockwave.rs index c6dd88dd57..9208c62d42 100644 --- a/voxygen/anim/src/bird_large/shockwave.rs +++ b/voxygen/anim/src/bird_large/shockwave.rs @@ -8,16 +8,16 @@ pub struct ShockwaveAnimation; impl Animation for ShockwaveAnimation { #[allow(clippy::type_complexity)] - type Dependency = (Option, bool); + type Dependency<'a> = (Option, bool); type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_shockwave\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_shockwave")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (stage_section, on_ground): Self::Dependency, + (stage_section, on_ground): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/shoot.rs b/voxygen/anim/src/bird_large/shoot.rs index 23cd8c3f08..673afe07a5 100644 --- a/voxygen/anim/src/bird_large/shoot.rs +++ b/voxygen/anim/src/bird_large/shoot.rs @@ -9,16 +9,16 @@ pub struct ShootAnimation; type ShootAnimationDependency = (f32, Option, f32, Dir, bool); impl Animation for ShootAnimation { - type Dependency = ShootAnimationDependency; + type Dependency<'a> = ShootAnimationDependency; type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_shoot\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_shoot")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (global_time, stage_section, timer, look_dir, on_ground): Self::Dependency, + (global_time, stage_section, timer, look_dir, on_ground): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/stunned.rs b/voxygen/anim/src/bird_large/stunned.rs index 5377b3cdbb..68e016e104 100644 --- a/voxygen/anim/src/bird_large/stunned.rs +++ b/voxygen/anim/src/bird_large/stunned.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct StunnedAnimation; impl Animation for StunnedAnimation { - type Dependency = (f32, Option, f32); + type Dependency<'a> = (f32, Option, f32); type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_stunned\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_stunned")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (global_time, stage_section, timer): Self::Dependency, + (global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_large/swim.rs b/voxygen/anim/src/bird_large/swim.rs index f914cc20e6..f3eb1219cc 100644 --- a/voxygen/anim/src/bird_large/swim.rs +++ b/voxygen/anim/src/bird_large/swim.rs @@ -8,16 +8,16 @@ pub struct SwimAnimation; impl Animation for SwimAnimation { #[allow(clippy::type_complexity)] - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = BirdLargeSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_large_swim\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_swim")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_medium/feed.rs b/voxygen/anim/src/bird_medium/feed.rs index f717628af0..1760ac7798 100644 --- a/voxygen/anim/src/bird_medium/feed.rs +++ b/voxygen/anim/src/bird_medium/feed.rs @@ -7,7 +7,7 @@ use std::ops::Mul; pub struct FeedAnimation; impl Animation for FeedAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = BirdMediumSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -15,9 +15,9 @@ impl Animation for FeedAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_feed")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_medium/fly.rs b/voxygen/anim/src/bird_medium/fly.rs index 49ade48a95..5fefb3ffae 100644 --- a/voxygen/anim/src/bird_medium/fly.rs +++ b/voxygen/anim/src/bird_medium/fly.rs @@ -7,16 +7,16 @@ use std::f32::consts::PI; pub struct FlyAnimation; impl Animation for FlyAnimation { - type Dependency = (f32, f32); + type Dependency<'a> = (f32, f32); type Skeleton = BirdMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_medium_fly\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_fly")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - _global_time: Self::Dependency, + _global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_medium/idle.rs b/voxygen/anim/src/bird_medium/idle.rs index f96992a739..d11b599c3c 100644 --- a/voxygen/anim/src/bird_medium/idle.rs +++ b/voxygen/anim/src/bird_medium/idle.rs @@ -7,7 +7,7 @@ use std::ops::Mul; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = BirdMediumSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -15,9 +15,9 @@ impl Animation for IdleAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/bird_medium/run.rs b/voxygen/anim/src/bird_medium/run.rs index fbde0b410d..9f1dd93ac1 100644 --- a/voxygen/anim/src/bird_medium/run.rs +++ b/voxygen/anim/src/bird_medium/run.rs @@ -7,16 +7,16 @@ use std::f32::consts::PI; pub struct RunAnimation; impl Animation for RunAnimation { - type Dependency = (f32, f32); + type Dependency<'a> = (f32, f32); type Skeleton = BirdMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"bird_medium_run\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, _global_time): Self::Dependency, + (_velocity, _global_time): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/alpha.rs b/voxygen/anim/src/character/alpha.rs index b9a3cb25b0..8e6431d54f 100644 --- a/voxygen/anim/src/character/alpha.rs +++ b/voxygen/anim/src/character/alpha.rs @@ -16,7 +16,7 @@ type AlphaAnimationDependency = ( Option, ); impl Animation for AlphaAnimation { - type Dependency = AlphaAnimationDependency; + type Dependency<'a> = AlphaAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -24,9 +24,9 @@ impl Animation for AlphaAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_alpha")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, stage_section, ability_info): Self::Dependency, + (hands, stage_section, ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/beam.rs b/voxygen/anim/src/character/beam.rs index 1741d78b5f..fc6d6bbde9 100644 --- a/voxygen/anim/src/character/beam.rs +++ b/voxygen/anim/src/character/beam.rs @@ -12,7 +12,7 @@ pub struct BeamAnimation; impl Animation for BeamAnimation { #[allow(clippy::type_complexity)] - type Dependency = ( + type Dependency<'a> = ( Option, (Option, Option), f32, @@ -26,9 +26,9 @@ impl Animation for BeamAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_beam")] #[allow(clippy::single_match)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (ability_info, hands, _global_time, velocity, stage_section): Self::Dependency, + (ability_info, hands, _global_time, velocity, stage_section): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/beta.rs b/voxygen/anim/src/character/beta.rs index 933878d288..a0b17eb0fb 100644 --- a/voxygen/anim/src/character/beta.rs +++ b/voxygen/anim/src/character/beta.rs @@ -17,16 +17,16 @@ type BetaAnimationDependency = ( Option, ); impl Animation for BetaAnimation { - type Dependency = BetaAnimationDependency; + type Dependency<'a> = BetaAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"character_beta\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_beta")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency, + (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/block.rs b/voxygen/anim/src/character/block.rs index cd2aa87336..92f7c3a034 100644 --- a/voxygen/anim/src/character/block.rs +++ b/voxygen/anim/src/character/block.rs @@ -19,16 +19,16 @@ type BlockAnimationDependency = ( Option, ); impl Animation for BlockAnimation { - type Dependency = BlockAnimationDependency; + type Dependency<'a> = BlockAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"character_block\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_block")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, active_tool_kind, second_tool_kind,velocity, _global_time, stage_section): Self::Dependency, + (hands, active_tool_kind, second_tool_kind,velocity, _global_time, stage_section): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/chargeswing.rs b/voxygen/anim/src/character/chargeswing.rs index 305d964555..25f5743e87 100644 --- a/voxygen/anim/src/character/chargeswing.rs +++ b/voxygen/anim/src/character/chargeswing.rs @@ -17,7 +17,7 @@ type ChargeswingAnimationDependency = ( ); impl Animation for ChargeswingAnimation { - type Dependency = ChargeswingAnimationDependency; + type Dependency<'a> = ChargeswingAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -25,9 +25,9 @@ impl Animation for ChargeswingAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_chargeswing")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency, + (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/climb.rs b/voxygen/anim/src/character/climb.rs index 721f3e0182..b920e9c123 100644 --- a/voxygen/anim/src/character/climb.rs +++ b/voxygen/anim/src/character/climb.rs @@ -8,7 +8,7 @@ use std::{f32::consts::PI, ops::Mul}; pub struct ClimbAnimation; impl Animation for ClimbAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, Vec3, @@ -21,9 +21,9 @@ impl Animation for ClimbAnimation { const UPDATE_FN: &'static [u8] = b"character_climb\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_climb")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, velocity, _orientation, global_time): Self::Dependency, + (_active_tool_kind, _second_tool_kind, velocity, _orientation, global_time): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/dance.rs b/voxygen/anim/src/character/dance.rs index 2b37170947..f3239d0f5a 100644 --- a/voxygen/anim/src/character/dance.rs +++ b/voxygen/anim/src/character/dance.rs @@ -8,16 +8,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct DanceAnimation; impl Animation for DanceAnimation { - type Dependency = (Option, Option, f32); + type Dependency<'a> = (Option, Option, f32); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"character_dance\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_dance")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, global_time): Self::Dependency, + (_active_tool_kind, _second_tool_kind, global_time): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/dash.rs b/voxygen/anim/src/character/dash.rs index 9f986f978d..b9f8d0d0f8 100644 --- a/voxygen/anim/src/character/dash.rs +++ b/voxygen/anim/src/character/dash.rs @@ -17,7 +17,7 @@ type DashAnimationDependency = ( Option, ); impl Animation for DashAnimation { - type Dependency = DashAnimationDependency; + type Dependency<'a> = DashAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -25,9 +25,9 @@ impl Animation for DashAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_dash")] #[allow(clippy::single_match)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, _global_time, stage_section, ability_info): Self::Dependency, + (hands, _global_time, stage_section, ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/equip.rs b/voxygen/anim/src/character/equip.rs index 1b01ec063b..7eca936bad 100644 --- a/voxygen/anim/src/character/equip.rs +++ b/voxygen/anim/src/character/equip.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct EquipAnimation; impl Animation for EquipAnimation { - type Dependency = (Option, Option, f32, f32); + type Dependency<'a> = (Option, Option, f32, f32); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,9 +16,9 @@ impl Animation for EquipAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_equip")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, _second_tool_kind, _velocity, _global_time): Self::Dependency, + (active_tool_kind, _second_tool_kind, _velocity, _global_time): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/glidewield.rs b/voxygen/anim/src/character/glidewield.rs index ac7cb6f85f..8118fb117b 100644 --- a/voxygen/anim/src/character/glidewield.rs +++ b/voxygen/anim/src/character/glidewield.rs @@ -6,7 +6,7 @@ use super::{ pub struct GlideWieldAnimation; impl Animation for GlideWieldAnimation { - type Dependency = (); + type Dependency<'a> = (); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -14,9 +14,9 @@ impl Animation for GlideWieldAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_glidewield")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - _: Self::Dependency, + _: Self::Dependency<'a>, _anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/gliding.rs b/voxygen/anim/src/character/gliding.rs index 996d745140..7bacb1fe9d 100644 --- a/voxygen/anim/src/character/gliding.rs +++ b/voxygen/anim/src/character/gliding.rs @@ -9,7 +9,7 @@ pub struct GlidingAnimation; type GlidingAnimationDependency = (Vec3, Quaternion, Quaternion, f32, f32); impl Animation for GlidingAnimation { - type Dependency = GlidingAnimationDependency; + type Dependency<'a> = GlidingAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -17,9 +17,9 @@ impl Animation for GlidingAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_gliding")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, glider_orientation, global_time, acc_vel): Self::Dependency, + (velocity, orientation, glider_orientation, global_time, acc_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/idle.rs b/voxygen/anim/src/character/idle.rs index 51f700b35a..4b8464241d 100644 --- a/voxygen/anim/src/character/idle.rs +++ b/voxygen/anim/src/character/idle.rs @@ -9,7 +9,7 @@ pub struct IdleAnimation; impl Animation for IdleAnimation { #[allow(clippy::type_complexity)] - type Dependency = ( + type Dependency<'a> = ( Option, Option, (Option, Option), @@ -21,9 +21,9 @@ impl Animation for IdleAnimation { const UPDATE_FN: &'static [u8] = b"character_idle\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, second_tool_kind, hands, global_time): Self::Dependency, + (active_tool_kind, second_tool_kind, hands, global_time): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/jump.rs b/voxygen/anim/src/character/jump.rs index 1a2788e703..5125600540 100644 --- a/voxygen/anim/src/character/jump.rs +++ b/voxygen/anim/src/character/jump.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct JumpAnimation; impl Animation for JumpAnimation { #[allow(clippy::type_complexity)] - type Dependency = ( + type Dependency<'a> = ( Option, Option, (Option, Option), @@ -24,9 +24,9 @@ impl Animation for JumpAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_jump")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, second_tool_kind, hands, velocity, orientation, last_ori, global_time): Self::Dependency, + (active_tool_kind, second_tool_kind, hands, velocity, orientation, last_ori, global_time): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/leapmelee.rs b/voxygen/anim/src/character/leapmelee.rs index 66d8ffd8b0..dc66ab1d9b 100644 --- a/voxygen/anim/src/character/leapmelee.rs +++ b/voxygen/anim/src/character/leapmelee.rs @@ -16,7 +16,7 @@ type LeapAnimationDependency = ( Option, ); impl Animation for LeapAnimation { - type Dependency = LeapAnimationDependency; + type Dependency<'a> = LeapAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -24,9 +24,9 @@ impl Animation for LeapAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_leapmelee")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency, + (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/repeater.rs b/voxygen/anim/src/character/repeater.rs index 506f9cfe5d..1ca3884ded 100644 --- a/voxygen/anim/src/character/repeater.rs +++ b/voxygen/anim/src/character/repeater.rs @@ -10,7 +10,7 @@ pub struct RepeaterAnimation; impl Animation for RepeaterAnimation { #[allow(clippy::type_complexity)] - type Dependency = ( + type Dependency<'a> = ( Option, (Option, Option), Vec3, @@ -24,9 +24,9 @@ impl Animation for RepeaterAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_repeater")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (ability_info, hands, _velocity, _global_time, stage_section): Self::Dependency, + (ability_info, hands, _velocity, _global_time, stage_section): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/roll.rs b/voxygen/anim/src/character/roll.rs index bd3b5f095f..7b7d53a3d9 100644 --- a/voxygen/anim/src/character/roll.rs +++ b/voxygen/anim/src/character/roll.rs @@ -17,7 +17,7 @@ type RollAnimationDependency = ( ); impl Animation for RollAnimation { - type Dependency = RollAnimationDependency; + type Dependency<'a> = RollAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -25,9 +25,9 @@ impl Animation for RollAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_roll")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, orientation, last_ori, _global_time, stage_section): Self::Dependency, + (_active_tool_kind, _second_tool_kind, orientation, last_ori, _global_time, stage_section): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/run.rs b/voxygen/anim/src/character/run.rs index be92f7d247..561c28b9c8 100644 --- a/voxygen/anim/src/character/run.rs +++ b/voxygen/anim/src/character/run.rs @@ -20,7 +20,7 @@ type RunAnimationDependency = ( ); impl Animation for RunAnimation { - type Dependency = RunAnimationDependency; + type Dependency<'a> = RunAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -28,7 +28,7 @@ impl Animation for RunAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( active_tool_kind, @@ -40,7 +40,7 @@ impl Animation for RunAnimation { global_time, avg_vel, acc_vel, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/shockwave.rs b/voxygen/anim/src/character/shockwave.rs index 763a43616c..db2c557c8f 100644 --- a/voxygen/anim/src/character/shockwave.rs +++ b/voxygen/anim/src/character/shockwave.rs @@ -14,7 +14,7 @@ pub struct ShockwaveAnimation; impl Animation for ShockwaveAnimation { #[allow(clippy::type_complexity)] - type Dependency = ( + type Dependency<'a> = ( Option, (Option, Option), f32, @@ -28,9 +28,9 @@ impl Animation for ShockwaveAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_shockwave")] #[allow(clippy::single_match)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_ability_info, hands, _global_time, velocity, stage_section): Self::Dependency, + (_ability_info, hands, _global_time, velocity, stage_section): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/shoot.rs b/voxygen/anim/src/character/shoot.rs index c30fbf8651..b1a7cbb720 100644 --- a/voxygen/anim/src/character/shoot.rs +++ b/voxygen/anim/src/character/shoot.rs @@ -22,7 +22,7 @@ type ShootAnimationDependency = ( Option, ); impl Animation for ShootAnimation { - type Dependency = ShootAnimationDependency; + type Dependency<'a> = ShootAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -30,7 +30,7 @@ impl Animation for ShootAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_shoot")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( ability_info, @@ -41,7 +41,7 @@ impl Animation for ShootAnimation { look_dir, _global_time, stage_section, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/sit.rs b/voxygen/anim/src/character/sit.rs index b25cf67135..b620143c9c 100644 --- a/voxygen/anim/src/character/sit.rs +++ b/voxygen/anim/src/character/sit.rs @@ -8,16 +8,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct SitAnimation; impl Animation for SitAnimation { - type Dependency = (Option, Option, f32); + type Dependency<'a> = (Option, Option, f32); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"character_sit\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_sit")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, global_time): Self::Dependency, + (_active_tool_kind, _second_tool_kind, global_time): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/sneak.rs b/voxygen/anim/src/character/sneak.rs index 13897e5a0a..45fddf971d 100644 --- a/voxygen/anim/src/character/sneak.rs +++ b/voxygen/anim/src/character/sneak.rs @@ -8,7 +8,7 @@ use std::{f32::consts::PI, ops::Mul}; pub struct SneakAnimation; impl Animation for SneakAnimation { - type Dependency = (Option, Vec3, Vec3, Vec3, f32); + type Dependency<'a> = (Option, Vec3, Vec3, Vec3, f32); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,9 +16,9 @@ impl Animation for SneakAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_sneak")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency, + (_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/spin.rs b/voxygen/anim/src/character/spin.rs index 1db1dc2113..112d9806f6 100644 --- a/voxygen/anim/src/character/spin.rs +++ b/voxygen/anim/src/character/spin.rs @@ -18,16 +18,16 @@ type SpinAnimationDependency = ( Option, ); impl Animation for SpinAnimation { - type Dependency = SpinAnimationDependency; + type Dependency<'a> = SpinAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"character_spin\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_spin")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency, + (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/spinmelee.rs b/voxygen/anim/src/character/spinmelee.rs index b85ccea681..c49bee2d49 100644 --- a/voxygen/anim/src/character/spinmelee.rs +++ b/voxygen/anim/src/character/spinmelee.rs @@ -18,7 +18,7 @@ type SpinMeleeAnimationDependency = ( Option, ); impl Animation for SpinMeleeAnimation { - type Dependency = SpinMeleeAnimationDependency; + type Dependency<'a> = SpinMeleeAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -26,9 +26,9 @@ impl Animation for SpinMeleeAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_spinmelee")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency, + (hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/staggered.rs b/voxygen/anim/src/character/staggered.rs index c59a5b7a7b..0597fccce0 100644 --- a/voxygen/anim/src/character/staggered.rs +++ b/voxygen/anim/src/character/staggered.rs @@ -20,7 +20,7 @@ type StaggeredAnimationDependency = ( bool, ); impl Animation for StaggeredAnimation { - type Dependency = StaggeredAnimationDependency; + type Dependency<'a> = StaggeredAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -28,7 +28,7 @@ impl Animation for StaggeredAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_staggered")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( active_tool_kind, @@ -39,7 +39,7 @@ impl Animation for StaggeredAnimation { stage_section, timer, wield_status, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/stand.rs b/voxygen/anim/src/character/stand.rs index 5a634d4ab4..f1829e666e 100644 --- a/voxygen/anim/src/character/stand.rs +++ b/voxygen/anim/src/character/stand.rs @@ -9,7 +9,7 @@ pub struct StandAnimation; impl Animation for StandAnimation { #[allow(clippy::type_complexity)] - type Dependency = ( + type Dependency<'a> = ( Option, Option, (Option, Option), @@ -22,9 +22,9 @@ impl Animation for StandAnimation { const UPDATE_FN: &'static [u8] = b"character_stand\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_stand")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, second_tool_kind, hands, global_time, avg_vel): Self::Dependency, + (active_tool_kind, second_tool_kind, hands, global_time, avg_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/stunned.rs b/voxygen/anim/src/character/stunned.rs index 01aeff63f1..081ec79199 100644 --- a/voxygen/anim/src/character/stunned.rs +++ b/voxygen/anim/src/character/stunned.rs @@ -20,7 +20,7 @@ type StunnedAnimationDependency = ( bool, ); impl Animation for StunnedAnimation { - type Dependency = StunnedAnimationDependency; + type Dependency<'a> = StunnedAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -28,7 +28,7 @@ impl Animation for StunnedAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_stunned")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( active_tool_kind, @@ -39,7 +39,7 @@ impl Animation for StunnedAnimation { stage_section, timer, wield_status, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/swim.rs b/voxygen/anim/src/character/swim.rs index 6556313598..358dc06f63 100644 --- a/voxygen/anim/src/character/swim.rs +++ b/voxygen/anim/src/character/swim.rs @@ -19,7 +19,7 @@ type SwimAnimationDependency = ( ); impl Animation for SwimAnimation { - type Dependency = SwimAnimationDependency; + type Dependency<'a> = SwimAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -27,7 +27,7 @@ impl Animation for SwimAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_swim")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( active_tool_kind, @@ -38,7 +38,7 @@ impl Animation for SwimAnimation { last_ori, global_time, avg_vel, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/swimwield.rs b/voxygen/anim/src/character/swimwield.rs index d5e0fe87cd..20dc7953ea 100644 --- a/voxygen/anim/src/character/swimwield.rs +++ b/voxygen/anim/src/character/swimwield.rs @@ -9,7 +9,7 @@ pub struct SwimWieldAnimation; impl Animation for SwimWieldAnimation { #[allow(clippy::type_complexity)] - type Dependency = ( + type Dependency<'a> = ( Option, Option, (Option, Option), @@ -23,9 +23,9 @@ impl Animation for SwimWieldAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_swimwield")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (active_tool_kind, second_tool_kind, hands, velocity, global_time): Self::Dependency, + (active_tool_kind, second_tool_kind, hands, velocity, global_time): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/talk.rs b/voxygen/anim/src/character/talk.rs index 3383a68a69..ec2a303b2a 100644 --- a/voxygen/anim/src/character/talk.rs +++ b/voxygen/anim/src/character/talk.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct TalkAnimation; impl Animation for TalkAnimation { - type Dependency = (Option, Option, f32, f32, Dir); + type Dependency<'a> = (Option, Option, f32, f32, Dir); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,9 +16,9 @@ impl Animation for TalkAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_talk")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, _velocity, _global_time, look_dir): Self::Dependency, + (_active_tool_kind, _second_tool_kind, _velocity, _global_time, look_dir): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/wield.rs b/voxygen/anim/src/character/wield.rs index 8ac758c417..36974076d3 100644 --- a/voxygen/anim/src/character/wield.rs +++ b/voxygen/anim/src/character/wield.rs @@ -21,7 +21,7 @@ type WieldAnimationDependency = ( f32, ); impl Animation for WieldAnimation { - type Dependency = WieldAnimationDependency; + type Dependency<'a> = WieldAnimationDependency; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -29,7 +29,7 @@ impl Animation for WieldAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_wield")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( active_tool_kind, @@ -40,7 +40,7 @@ impl Animation for WieldAnimation { look_dir, velocity, global_time, - ): Self::Dependency, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/dragon/fly.rs b/voxygen/anim/src/dragon/fly.rs index 3d4670386f..fb5f1f9169 100644 --- a/voxygen/anim/src/dragon/fly.rs +++ b/voxygen/anim/src/dragon/fly.rs @@ -7,16 +7,16 @@ use std::f32::consts::PI; pub struct FlyAnimation; impl Animation for FlyAnimation { - type Dependency = (f32, f32); + type Dependency<'a> = (f32, f32); type Skeleton = DragonSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"dragon_fly\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "dragon_fly")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - _global_time: Self::Dependency, + _global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/dragon/idle.rs b/voxygen/anim/src/dragon/idle.rs index 22789771e2..28628b316a 100644 --- a/voxygen/anim/src/dragon/idle.rs +++ b/voxygen/anim/src/dragon/idle.rs @@ -7,16 +7,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = DragonSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"dragon_idle\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "dragon_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/dragon/run.rs b/voxygen/anim/src/dragon/run.rs index a3846f3bbc..8356f8acd8 100644 --- a/voxygen/anim/src/dragon/run.rs +++ b/voxygen/anim/src/dragon/run.rs @@ -7,16 +7,16 @@ use std::f32::consts::PI; pub struct RunAnimation; impl Animation for RunAnimation { - type Dependency = (f32, Vec3, Vec3, f32, Vec3); + type Dependency<'a> = (f32, Vec3, Vec3, f32, Vec3); type Skeleton = DragonSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"dragon_run\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "dragon_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, orientation, last_ori, _global_time, avg_vel): Self::Dependency, + (_velocity, orientation, last_ori, _global_time, avg_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/fish_medium/idle.rs b/voxygen/anim/src/fish_medium/idle.rs index e99b7d285a..fafb57efb5 100644 --- a/voxygen/anim/src/fish_medium/idle.rs +++ b/voxygen/anim/src/fish_medium/idle.rs @@ -9,7 +9,7 @@ pub struct IdleAnimation; type IdleAnimationDependency = (Vec3, Vec3, Vec3, f32, Vec3); impl Animation for IdleAnimation { - type Dependency = IdleAnimationDependency; + type Dependency<'a> = IdleAnimationDependency; type Skeleton = FishMediumSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -17,9 +17,9 @@ impl Animation for IdleAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "fish_medium_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency, + (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/fish_medium/swim.rs b/voxygen/anim/src/fish_medium/swim.rs index 02b3539fc1..657bb27bbd 100644 --- a/voxygen/anim/src/fish_medium/swim.rs +++ b/voxygen/anim/src/fish_medium/swim.rs @@ -9,7 +9,7 @@ pub struct SwimAnimation; type SwimAnimationDependency = (Vec3, Vec3, Vec3, f32, Vec3, f32); impl Animation for SwimAnimation { - type Dependency = SwimAnimationDependency; + type Dependency<'a> = SwimAnimationDependency; type Skeleton = FishMediumSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -17,9 +17,9 @@ impl Animation for SwimAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "fish_medium_swim")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency<'a>, _anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/fish_small/idle.rs b/voxygen/anim/src/fish_small/idle.rs index 0f28fc9b9d..c1fca1f348 100644 --- a/voxygen/anim/src/fish_small/idle.rs +++ b/voxygen/anim/src/fish_small/idle.rs @@ -9,7 +9,7 @@ pub struct IdleAnimation; type IdleAnimationDependency = (Vec3, Vec3, Vec3, f32, Vec3); impl Animation for IdleAnimation { - type Dependency = IdleAnimationDependency; + type Dependency<'a> = IdleAnimationDependency; type Skeleton = FishSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -17,9 +17,9 @@ impl Animation for IdleAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "fish_small_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency, + (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/fish_small/swim.rs b/voxygen/anim/src/fish_small/swim.rs index c0d0c1e30b..8f1d94fe85 100644 --- a/voxygen/anim/src/fish_small/swim.rs +++ b/voxygen/anim/src/fish_small/swim.rs @@ -9,7 +9,7 @@ pub struct SwimAnimation; type SwimAnimationDependency = (Vec3, Vec3, Vec3, f32, Vec3, f32); impl Animation for SwimAnimation { - type Dependency = SwimAnimationDependency; + type Dependency<'a> = SwimAnimationDependency; type Skeleton = FishSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -17,9 +17,9 @@ impl Animation for SwimAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "fish_small_swim")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency<'a>, _anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/golem/alpha.rs b/voxygen/anim/src/golem/alpha.rs index 4a722e744d..d6a9241161 100644 --- a/voxygen/anim/src/golem/alpha.rs +++ b/voxygen/anim/src/golem/alpha.rs @@ -7,7 +7,7 @@ use common::states::utils::StageSection; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency = (Option, f32, f32); + type Dependency<'a> = (Option, f32, f32); type Skeleton = GolemSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -15,9 +15,9 @@ impl Animation for AlphaAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "golem_alpha")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (stage_section, global_time, timer): Self::Dependency, + (stage_section, global_time, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/golem/idle.rs b/voxygen/anim/src/golem/idle.rs index 5f170b8144..4bf88aa388 100644 --- a/voxygen/anim/src/golem/idle.rs +++ b/voxygen/anim/src/golem/idle.rs @@ -7,7 +7,7 @@ use std::{f32::consts::PI, ops::Mul}; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = GolemSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -15,9 +15,9 @@ impl Animation for IdleAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "golem_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/golem/run.rs b/voxygen/anim/src/golem/run.rs index bc5ba1aecf..d9f0fe504a 100644 --- a/voxygen/anim/src/golem/run.rs +++ b/voxygen/anim/src/golem/run.rs @@ -7,7 +7,7 @@ use std::f32::consts::PI; pub struct RunAnimation; impl Animation for RunAnimation { - type Dependency = (Vec3, Vec3, Vec3, f32, f32); + type Dependency<'a> = (Vec3, Vec3, Vec3, f32, f32); type Skeleton = GolemSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -15,9 +15,9 @@ impl Animation for RunAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "golem_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, _global_time, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, _global_time, acc_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/golem/shockwave.rs b/voxygen/anim/src/golem/shockwave.rs index 9b40a15c85..bd7ea583ff 100644 --- a/voxygen/anim/src/golem/shockwave.rs +++ b/voxygen/anim/src/golem/shockwave.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct ShockwaveAnimation; impl Animation for ShockwaveAnimation { - type Dependency = (Option, f32, f32); + type Dependency<'a> = (Option, f32, f32); type Skeleton = GolemSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,9 +16,9 @@ impl Animation for ShockwaveAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "golem_shockwave")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (stage_section, velocity, _global_time): Self::Dependency, + (stage_section, velocity, _global_time): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/golem/spinmelee.rs b/voxygen/anim/src/golem/spinmelee.rs index 9dd87b305d..e49daeadcf 100644 --- a/voxygen/anim/src/golem/spinmelee.rs +++ b/voxygen/anim/src/golem/spinmelee.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; pub struct SpinMeleeAnimation; impl Animation for SpinMeleeAnimation { - type Dependency = Option; + type Dependency<'a> = Option; type Skeleton = GolemSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,9 +16,9 @@ impl Animation for SpinMeleeAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "golem_spinmelee")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - stage_section: Self::Dependency, + stage_section: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/lib.rs b/voxygen/anim/src/lib.rs index 45d7e65e87..733c4ec174 100644 --- a/voxygen/anim/src/lib.rs +++ b/voxygen/anim/src/lib.rs @@ -1,5 +1,6 @@ #![feature(const_generics)] #![feature(or_patterns)] +#![feature(generic_associated_types)] #![allow(incomplete_features)] #[cfg(all(feature = "be-dyn-lib", feature = "use-dyn-lib"))] compile_error!("Can't use both \"be-dyn-lib\" and \"use-dyn-lib\" features at once"); @@ -137,15 +138,15 @@ pub fn compute_matrices( pub trait Animation { type Skeleton: Skeleton; - type Dependency; + type Dependency<'a>; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8]; /// Returns a new skeleton that is generated by the animation. - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( _skeleton: &Self::Skeleton, - _dependency: Self::Dependency, + _dependency: Self::Dependency<'a>, _anim_time: f32, _rate: &mut f32, _skeleton_attr: &<::Skeleton as Skeleton>::Attr, @@ -153,9 +154,9 @@ pub trait Animation { /// Calls `update_skeleton_inner` either directly or via `libloading` to /// generate the new skeleton. - fn update_skeleton( + fn update_skeleton<'a>( skeleton: &Self::Skeleton, - dependency: Self::Dependency, + dependency: Self::Dependency<'a>, anim_time: f32, rate: &mut f32, skeleton_attr: &<::Skeleton as Skeleton>::Attr, @@ -172,7 +173,7 @@ pub trait Animation { let update_fn: libloading::Symbol< fn( &Self::Skeleton, - Self::Dependency, + Self::Dependency<'a>, f32, &mut f32, &::Attr, diff --git a/voxygen/anim/src/object/beam.rs b/voxygen/anim/src/object/beam.rs index 92a1eca9d5..99b3024e41 100644 --- a/voxygen/anim/src/object/beam.rs +++ b/voxygen/anim/src/object/beam.rs @@ -15,7 +15,7 @@ type BeamAnimationDependency = ( Body, ); impl Animation for BeamAnimation { - type Dependency = BeamAnimationDependency; + type Dependency<'a> = BeamAnimationDependency; type Skeleton = ObjectSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -23,9 +23,9 @@ impl Animation for BeamAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "object_beam")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, _stage_section, _body): Self::Dependency, + (_active_tool_kind, _second_tool_kind, _stage_section, _body): Self::Dependency<'a>, _anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/object/idle.rs b/voxygen/anim/src/object/idle.rs index 95e96112b7..42cdcd6832 100644 --- a/voxygen/anim/src/object/idle.rs +++ b/voxygen/anim/src/object/idle.rs @@ -7,7 +7,7 @@ use common::comp::item::ToolKind; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = (Option, Option, f32); + type Dependency<'a> = (Option, Option, f32); type Skeleton = ObjectSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -15,9 +15,9 @@ impl Animation for IdleAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "object_idle")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, _global_time): Self::Dependency, + (_active_tool_kind, _second_tool_kind, _global_time): Self::Dependency<'a>, _anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/object/shoot.rs b/voxygen/anim/src/object/shoot.rs index 04dc211259..32bcb56542 100644 --- a/voxygen/anim/src/object/shoot.rs +++ b/voxygen/anim/src/object/shoot.rs @@ -15,7 +15,7 @@ type ShootAnimationDependency = ( Body, ); impl Animation for ShootAnimation { - type Dependency = ShootAnimationDependency; + type Dependency<'a> = ShootAnimationDependency; type Skeleton = ObjectSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -23,9 +23,9 @@ impl Animation for ShootAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "object_shoot")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, stage_section, body): Self::Dependency, + (_active_tool_kind, _second_tool_kind, stage_section, body): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/alpha.rs b/voxygen/anim/src/quadruped_low/alpha.rs index e60efa6091..1fb1812632 100644 --- a/voxygen/anim/src/quadruped_low/alpha.rs +++ b/voxygen/anim/src/quadruped_low/alpha.rs @@ -8,16 +8,16 @@ use common::states::utils::StageSection; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_alpha\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_alpha")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/beta.rs b/voxygen/anim/src/quadruped_low/beta.rs index 1b8bf831a9..d09eb8933f 100644 --- a/voxygen/anim/src/quadruped_low/beta.rs +++ b/voxygen/anim/src/quadruped_low/beta.rs @@ -8,16 +8,16 @@ use common::states::utils::StageSection; pub struct BetaAnimation; impl Animation for BetaAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_beta\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_beta")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/breathe.rs b/voxygen/anim/src/quadruped_low/breathe.rs index 3840db8b3c..c70f4bdb9a 100644 --- a/voxygen/anim/src/quadruped_low/breathe.rs +++ b/voxygen/anim/src/quadruped_low/breathe.rs @@ -9,16 +9,16 @@ use std::f32::consts::PI; pub struct BreatheAnimation; impl Animation for BreatheAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_breathe\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_breathe")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, global_time, stage_section, timer): Self::Dependency, + (velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/dash.rs b/voxygen/anim/src/quadruped_low/dash.rs index 255500cbe0..c555ddee0b 100644 --- a/voxygen/anim/src/quadruped_low/dash.rs +++ b/voxygen/anim/src/quadruped_low/dash.rs @@ -9,16 +9,16 @@ use std::f32::consts::PI; pub struct DashAnimation; impl Animation for DashAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_dash\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_dash")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/idle.rs b/voxygen/anim/src/quadruped_low/idle.rs index df51694acc..c0601d27d4 100644 --- a/voxygen/anim/src/quadruped_low/idle.rs +++ b/voxygen/anim/src/quadruped_low/idle.rs @@ -7,16 +7,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_idle\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/jump.rs b/voxygen/anim/src/quadruped_low/jump.rs index b4b9914adb..faf2c80c2e 100644 --- a/voxygen/anim/src/quadruped_low/jump.rs +++ b/voxygen/anim/src/quadruped_low/jump.rs @@ -6,16 +6,16 @@ use super::{ pub struct JumpAnimation; impl Animation for JumpAnimation { - type Dependency = (f32, f32); + type Dependency<'a> = (f32, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_jump\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_jump")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - _global_time: Self::Dependency, + _global_time: Self::Dependency<'a>, _anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/run.rs b/voxygen/anim/src/quadruped_low/run.rs index 241db14e60..e70620e5b4 100644 --- a/voxygen/anim/src/quadruped_low/run.rs +++ b/voxygen/anim/src/quadruped_low/run.rs @@ -7,16 +7,16 @@ use std::f32::consts::PI; pub struct RunAnimation; impl Animation for RunAnimation { - type Dependency = (f32, Vec3, Vec3, f32, Vec3, f32); + type Dependency<'a> = (f32, Vec3, Vec3, f32, Vec3, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_run\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/shoot.rs b/voxygen/anim/src/quadruped_low/shoot.rs index 4d0ea35ff0..3348541285 100644 --- a/voxygen/anim/src/quadruped_low/shoot.rs +++ b/voxygen/anim/src/quadruped_low/shoot.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct ShootAnimation; impl Animation for ShootAnimation { - type Dependency = (f32, f32, Option); + type Dependency<'a> = (f32, f32, Option); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_shoot\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_shoot")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, _global_time, stage_section): Self::Dependency, + (velocity, _global_time, stage_section): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/stunned.rs b/voxygen/anim/src/quadruped_low/stunned.rs index 6218f7cc42..eb677b9f13 100644 --- a/voxygen/anim/src/quadruped_low/stunned.rs +++ b/voxygen/anim/src/quadruped_low/stunned.rs @@ -8,16 +8,16 @@ use common::states::utils::StageSection; pub struct StunnedAnimation; impl Animation for StunnedAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_stunned\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_stunned")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_low/tailwhip.rs b/voxygen/anim/src/quadruped_low/tailwhip.rs index f691af7150..5cb36a14f2 100644 --- a/voxygen/anim/src/quadruped_low/tailwhip.rs +++ b/voxygen/anim/src/quadruped_low/tailwhip.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct TailwhipAnimation; impl Animation for TailwhipAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_tailwhip\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_tailwhip")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/alpha.rs b/voxygen/anim/src/quadruped_medium/alpha.rs index d1c7ac8072..65de540295 100644 --- a/voxygen/anim/src/quadruped_medium/alpha.rs +++ b/voxygen/anim/src/quadruped_medium/alpha.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_alpha\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_alpha")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, global_time, stage_section, timer): Self::Dependency, + (velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/beta.rs b/voxygen/anim/src/quadruped_medium/beta.rs index 09b5a817c5..94d4e761b7 100644 --- a/voxygen/anim/src/quadruped_medium/beta.rs +++ b/voxygen/anim/src/quadruped_medium/beta.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct BetaAnimation; impl Animation for BetaAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_beta\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_beta")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, global_time, stage_section, timer): Self::Dependency, + (velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/dash.rs b/voxygen/anim/src/quadruped_medium/dash.rs index 10027b6292..64e7efdd64 100644 --- a/voxygen/anim/src/quadruped_medium/dash.rs +++ b/voxygen/anim/src/quadruped_medium/dash.rs @@ -9,16 +9,16 @@ use std::f32::consts::PI; pub struct DashAnimation; impl Animation for DashAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_dash\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_dash")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/feed.rs b/voxygen/anim/src/quadruped_medium/feed.rs index 75589aeba1..c5b608b945 100644 --- a/voxygen/anim/src/quadruped_medium/feed.rs +++ b/voxygen/anim/src/quadruped_medium/feed.rs @@ -7,16 +7,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct FeedAnimation; impl Animation for FeedAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_feed\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_feed")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/hoof.rs b/voxygen/anim/src/quadruped_medium/hoof.rs index 1aa8f53b7f..7adf0c9403 100644 --- a/voxygen/anim/src/quadruped_medium/hoof.rs +++ b/voxygen/anim/src/quadruped_medium/hoof.rs @@ -8,16 +8,16 @@ use std::f32::consts::PI; pub struct HoofAnimation; impl Animation for HoofAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_hoof\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_hoof")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, global_time, stage_section, timer): Self::Dependency, + (velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/idle.rs b/voxygen/anim/src/quadruped_medium/idle.rs index 231ed7fb82..12d954cda9 100644 --- a/voxygen/anim/src/quadruped_medium/idle.rs +++ b/voxygen/anim/src/quadruped_medium/idle.rs @@ -7,16 +7,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_idle\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/jump.rs b/voxygen/anim/src/quadruped_medium/jump.rs index 50753cf3a6..d03ca09a69 100644 --- a/voxygen/anim/src/quadruped_medium/jump.rs +++ b/voxygen/anim/src/quadruped_medium/jump.rs @@ -6,16 +6,16 @@ use super::{ pub struct JumpAnimation; impl Animation for JumpAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_jump\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_jump")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - _global_time: Self::Dependency, + _global_time: Self::Dependency<'a>, _anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/leapmelee.rs b/voxygen/anim/src/quadruped_medium/leapmelee.rs index f89950c6c6..9af1ddfcd9 100644 --- a/voxygen/anim/src/quadruped_medium/leapmelee.rs +++ b/voxygen/anim/src/quadruped_medium/leapmelee.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct LeapMeleeAnimation; impl Animation for LeapMeleeAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_leapmelee\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_leapmelee")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/run.rs b/voxygen/anim/src/quadruped_medium/run.rs index ed907d3273..fcef48daeb 100644 --- a/voxygen/anim/src/quadruped_medium/run.rs +++ b/voxygen/anim/src/quadruped_medium/run.rs @@ -7,16 +7,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct RunAnimation; impl Animation for RunAnimation { - type Dependency = (f32, Vec3, Vec3, f32, Vec3, f32); + type Dependency<'a> = (f32, Vec3, Vec3, f32, Vec3, f32); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_run\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, global_time, avg_vel, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, global_time, avg_vel, acc_vel): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_medium/stunned.rs b/voxygen/anim/src/quadruped_medium/stunned.rs index 87ff05da27..1e51088e68 100644 --- a/voxygen/anim/src/quadruped_medium/stunned.rs +++ b/voxygen/anim/src/quadruped_medium/stunned.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct StunnedAnimation; impl Animation for StunnedAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_stunned\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_stunned")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_small/alpha.rs b/voxygen/anim/src/quadruped_small/alpha.rs index d2de36e5b7..fd46a10240 100644 --- a/voxygen/anim/src/quadruped_small/alpha.rs +++ b/voxygen/anim/src/quadruped_small/alpha.rs @@ -8,16 +8,16 @@ use common::states::utils::StageSection; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_small_alpha\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_small_alpha")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_small/feed.rs b/voxygen/anim/src/quadruped_small/feed.rs index de98243678..f4588c78e5 100644 --- a/voxygen/anim/src/quadruped_small/feed.rs +++ b/voxygen/anim/src/quadruped_small/feed.rs @@ -7,16 +7,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct FeedAnimation; impl Animation for FeedAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = QuadrupedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_small_feed\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_small_feed")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_small/idle.rs b/voxygen/anim/src/quadruped_small/idle.rs index f21d5963e2..88c9d34de5 100644 --- a/voxygen/anim/src/quadruped_small/idle.rs +++ b/voxygen/anim/src/quadruped_small/idle.rs @@ -7,16 +7,16 @@ use std::{f32::consts::PI, ops::Mul}; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = QuadrupedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_small_idle\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_small_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_small/jump.rs b/voxygen/anim/src/quadruped_small/jump.rs index 465d75ac65..9647b52007 100644 --- a/voxygen/anim/src/quadruped_small/jump.rs +++ b/voxygen/anim/src/quadruped_small/jump.rs @@ -6,16 +6,16 @@ use super::{ pub struct JumpAnimation; impl Animation for JumpAnimation { - type Dependency = (f32, f32); + type Dependency<'a> = (f32, f32); type Skeleton = QuadrupedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_small_jump\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_small_jump")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, _global_time): Self::Dependency, + (_velocity, _global_time): Self::Dependency<'a>, _anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_small/run.rs b/voxygen/anim/src/quadruped_small/run.rs index 591c6dc4a5..15e33f001e 100644 --- a/voxygen/anim/src/quadruped_small/run.rs +++ b/voxygen/anim/src/quadruped_small/run.rs @@ -7,16 +7,16 @@ use std::f32::consts::PI; pub struct RunAnimation; impl Animation for RunAnimation { - type Dependency = (f32, Vec3, Vec3, f32, Vec3, f32); + type Dependency<'a> = (f32, Vec3, Vec3, f32, Vec3, f32); type Skeleton = QuadrupedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_small_run\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_small_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/quadruped_small/stunned.rs b/voxygen/anim/src/quadruped_small/stunned.rs index d99c23dab2..bf2cfab502 100644 --- a/voxygen/anim/src/quadruped_small/stunned.rs +++ b/voxygen/anim/src/quadruped_small/stunned.rs @@ -8,16 +8,16 @@ use common::states::utils::StageSection; pub struct StunnedAnimation; impl Animation for StunnedAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = QuadrupedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_small_stunned\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_small_stunned")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/ship/idle.rs b/voxygen/anim/src/ship/idle.rs index dc819c8988..915196a0fb 100644 --- a/voxygen/anim/src/ship/idle.rs +++ b/voxygen/anim/src/ship/idle.rs @@ -7,7 +7,7 @@ use common::comp::item::ToolKind; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = ( + type Dependency<'a> = ( Option, Option, f32, @@ -22,9 +22,9 @@ impl Animation for IdleAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "ship_idle")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, _global_time, acc_vel, orientation, last_ori): Self::Dependency, + (_active_tool_kind, _second_tool_kind, _global_time, acc_vel, orientation, last_ori): Self::Dependency<'a>, _anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/theropod/alpha.rs b/voxygen/anim/src/theropod/alpha.rs index a420a9832f..ba96806833 100644 --- a/voxygen/anim/src/theropod/alpha.rs +++ b/voxygen/anim/src/theropod/alpha.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = TheropodSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"theropod_alpha\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_alpha")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/theropod/beta.rs b/voxygen/anim/src/theropod/beta.rs index bdcfebfc57..f3dba2e2bc 100644 --- a/voxygen/anim/src/theropod/beta.rs +++ b/voxygen/anim/src/theropod/beta.rs @@ -8,16 +8,16 @@ use common::states::utils::StageSection; pub struct BetaAnimation; impl Animation for BetaAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = TheropodSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"theropod_beta\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_beta")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/theropod/dash.rs b/voxygen/anim/src/theropod/dash.rs index e028f8f4c2..c93d76ae5f 100644 --- a/voxygen/anim/src/theropod/dash.rs +++ b/voxygen/anim/src/theropod/dash.rs @@ -7,16 +7,16 @@ use common::states::utils::StageSection; pub struct DashAnimation; impl Animation for DashAnimation { - type Dependency = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, Option, f32); type Skeleton = TheropodSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"theropod_dash\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_dash")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency, + (_velocity, global_time, stage_section, timer): Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/theropod/idle.rs b/voxygen/anim/src/theropod/idle.rs index 1f49f8e197..e91b1b895a 100644 --- a/voxygen/anim/src/theropod/idle.rs +++ b/voxygen/anim/src/theropod/idle.rs @@ -6,16 +6,16 @@ use std::ops::Mul; pub struct IdleAnimation; impl Animation for IdleAnimation { - type Dependency = f32; + type Dependency<'a> = f32; type Skeleton = TheropodSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"theropod_idle\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_idle")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - global_time: Self::Dependency, + global_time: Self::Dependency<'a>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/theropod/jump.rs b/voxygen/anim/src/theropod/jump.rs index fae7303037..fde92cdc0f 100644 --- a/voxygen/anim/src/theropod/jump.rs +++ b/voxygen/anim/src/theropod/jump.rs @@ -5,16 +5,16 @@ use super::super::vek::*; pub struct JumpAnimation; impl Animation for JumpAnimation { - type Dependency = (f32, Vec3, Vec3, f32, Vec3); + type Dependency<'a> = (f32, Vec3, Vec3, f32, Vec3); type Skeleton = TheropodSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"theropod_jump\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_jump")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency, + (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency<'a>, _anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/theropod/run.rs b/voxygen/anim/src/theropod/run.rs index c446e87184..8d54e31d76 100644 --- a/voxygen/anim/src/theropod/run.rs +++ b/voxygen/anim/src/theropod/run.rs @@ -6,16 +6,16 @@ use std::f32::consts::PI; pub struct RunAnimation; impl Animation for RunAnimation { - type Dependency = (Vec3, Vec3, Vec3, f32, Vec3, f32); + type Dependency<'a> = (Vec3, Vec3, Vec3, f32, Vec3, f32); type Skeleton = TheropodSkeleton; #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"theropod_run\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_run")] - fn update_skeleton_inner( + fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index f36314894d..daf7fbf5cd 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -731,7 +731,7 @@ impl FigureMgr { .and_then(|i| i.equipped(equip_slot)) .map(|i| { if let ItemKind::Tool(tool) = i.kind() { - (Some(tool.kind), Some(tool.hands), i.ability_set().cloned()) + (Some(tool.kind), Some(tool.hands), i.ability_set()) } else { (None, None, None) }