Handle retail park streams and spline headers across all disc maps

This commit is contained in:
chazmm committed 2026-09-08 04:44:05 +01:00
1 parent ae107e2876
commit a7090f9ef3
4 files changed
+34 -5

No files matched your search

+9 -2
View File
@@ -102,8 +102,15 @@ pub(crate) fn primitives(map: Option<&SkateMap>) -> Result<Vec<Primitive>,String
let [a,b,c,d] = coefficients;
let end = std::array::from_fn(|j| (a[j]+b[j])+(c[j]+d[j]));
let length: f32 = (0..3).map(|j| (end[j]-d[j]).powi(2)).sum();
if !length.is_finite() || length <= 0.000001 {
return Err(format!("Spline segment {i} has a degenerate contact chord"));
if !length.is_finite() {
return Err(format!("Spline segment {i} has a non-finite contact chord"));
}
if length <= 0.000001 {
// Retail Downtown contains duplicate knots and sub-millimetre
// chords. They cannot provide a usable contact direction. Keep
// their cubic records and links in build(), but omit them from
// this adapter's independent contact-primitive array.
continue;
}
result.push(Primitive { start:d,end,owner:((word(r) as u64)<<32)|word(r+4) as u64 });
}