planner: pass in_planner argument to decoMode()

To remove reliance on global state, pass an "in_planner" argument
to decoMode(). Thus, calls to in_planner() can be removed.

This is a more-or-less automated change. Ultimately it would
probably be better to pass the current deco-mode to the affected
functions instead of calling decoMode() with an in_planner
parameter.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-02-12 18:19:24 +01:00 committed by Dirk Hohndel
parent 03a7e65cf0
commit 642d9c80b3
12 changed files with 51 additions and 51 deletions

View file

@ -1489,9 +1489,9 @@ extern "C" bool in_planner()
return getAppState() == ApplicationState::PlanDive || getAppState() == ApplicationState::EditPlannedDive;
}
extern "C" enum deco_mode decoMode()
extern "C" enum deco_mode decoMode(bool in_planner)
{
return in_planner() ? prefs.planner_deco_mode : prefs.display_deco_mode;
return in_planner ? prefs.planner_deco_mode : prefs.display_deco_mode;
}
void init_proxy()