diff interpreters/src/th06/std.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/std.rs
+++ b/interpreters/src/th06/std.rs
@@ -1,7 +1,7 @@
 //! Interpreter of STD files.
 
 use touhou_formats::th06::std::{Stage, Call, Instruction};
-use crate::th06::interpolator::{Interpolator3, Formula};
+use crate::th06::interpolator::{Interpolator, Formula};
 use touhou_utils::math::{Mat4, setup_camera};
 use std::cell::RefCell;
 use std::rc::Rc;
@@ -12,8 +12,8 @@
     pub stage: Rc<RefCell<Stage>>,
     frame: u32,
 
-    position: Interpolator3<f32>,
-    direction: Interpolator3<f32>,
+    position: Interpolator<f32, 3>,
+    direction: Interpolator<f32, 3>,
 
     /// XXX: no pub.
     pub fog_color: [f32; 4],
@@ -29,8 +29,8 @@
         StageRunner {
             stage,
             frame: 0,
-            position: Interpolator3::new([0., 0., 0.], 0, [0., 0., 0.], 0, Formula::Linear),
-            direction: Interpolator3::new([0., 0., 0.], 0, [0., 0., 0.], 0, Formula::Linear),
+            position: Interpolator::new([0., 0., 0.], 0, [0., 0., 0.], 0, Formula::Linear),
+            direction: Interpolator::new([0., 0., 0.], 0, [0., 0., 0.], 0, Formula::Linear),
             fog_color: [1.; 4],
             fog_near: 0.,
             fog_far: 1000.,