core: implement interpolate() function for unit types

Calls the global interpolate() function for integer types.

For now, the template is enabled if the arguments are not
integer types. Might want to refine that in the future.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-12-14 09:49:31 +01:00
parent 133bc50d53
commit 64945a1c96
4 changed files with 22 additions and 4 deletions

View file

@ -104,7 +104,7 @@ static void interpolate_transition(struct deco_state *ds, struct dive *dive, dur
int32_t j;
for (j = t0.seconds; j < t1.seconds; j++) {
depth_t depth = depth_t { .mm = interpolate(d0.mm, d1.mm, j - t0.seconds, t1.seconds - t0.seconds) };
depth_t depth = interpolate(d0, d1, j - t0.seconds, t1.seconds - t0.seconds);
add_segment(ds, dive->depth_to_bar(depth), gasmix, 1, po2.mbar, divemode, prefs.bottomsac, true);
}
if (d1.mm > d0.mm)