diff interpreters/src/th06/enemy.rs @ 787:7f9b3f5001c2

interpreters: Make Interpolator generic over N This was a workaround for Rust < 1.51 which didn’t support const generics yet, but we’ve had tat for close to five years now!
author Link Mauve <linkmauve@linkmauve.fr>
date Mon, 15 Dec 2025 11:34:58 +0100
parents 21b186be2590
children
line wrap: on
line diff
--- a/interpreters/src/th06/enemy.rs
+++ b/interpreters/src/th06/enemy.rs
@@ -3,7 +3,7 @@
 use touhou_formats::th06::anm0::Anm0;
 use touhou_formats::th06::ecl::Rank;
 use crate::th06::anm0::{Sprite, AnmRunner};
-use crate::th06::interpolator::{Interpolator1, Interpolator2};
+use crate::th06::interpolator::Interpolator;
 use touhou_utils::prng::Prng;
 use std::cell::RefCell;
 use std::collections::HashMap;
@@ -304,8 +304,8 @@
     options: Vec<Element>,
 
     // Interpolators.
-    pub(crate) interpolator: Option<Interpolator2<f32>>,
-    pub(crate) speed_interpolator: Option<Interpolator1<f32>>,
+    pub(crate) interpolator: Option<Interpolator<f32, 2>>,
+    pub(crate) speed_interpolator: Option<Interpolator<f32, 1>>,
 
     // Misc stuff, do we need them?
     pub(crate) anm0: Weak<RefCell<[Anm0; 2]>>,