core: move get_dive_gas() to struct dive

It is unclear why this was declared in divelist.h.

Moreover, rename it to get_maximal_gas() to better reflect
what it does.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-24 21:04:31 +02:00 committed by bstoeger
parent 4d7291d4a1
commit 3aab33ba4c
8 changed files with 44 additions and 48 deletions

View file

@ -1250,13 +1250,12 @@ static void debug_print_profiledata(struct plot_info &pi)
*/
struct plot_info create_plot_info_new(const struct dive *dive, const struct divecomputer *dc, const struct deco_state *planner_ds)
{
int o2, he, o2max;
struct deco_state plot_deco_state;
bool in_planner = planner_ds != NULL;
divelog.dives.init_decompression(&plot_deco_state, dive, in_planner);
plot_info pi;
calculate_max_limits_new(dive, dc, pi, in_planner);
get_dive_gas(dive, &o2, &he, &o2max);
auto [o2, he, o2max ] = dive->get_maximal_gas();
if (dc->divemode == FREEDIVE) {
pi.dive_type = plot_info::FREEDIVING;
} else if (he > 0) {