diff --git a/src/dusk/config.cpp b/src/dusk/config.cpp index 3d15f1fded..e67365b0d2 100644 --- a/src/dusk/config.cpp +++ b/src/dusk/config.cpp @@ -61,12 +61,7 @@ void ConfigImpl::loadFromJson(ConfigVar& cVar, const json& jsonValue) { using Underlying = std::underlying_type_t; const bool b = jsonValue.get(); - Underlying raw; - if constexpr (std::is_same_v) { - raw = b ? static_cast(2) : static_cast(0); - } else { - raw = b ? static_cast(1) : static_cast(0); - } + const Underlying raw = b ? static_cast(1) : static_cast(0); cVar.setValue(sanitizeEnumValue(cVar, static_cast(raw)), false); return; @@ -175,6 +170,19 @@ namespace dusk::config { template class ConfigImpl; template class ConfigImpl; template class ConfigImpl; + + template<> void ConfigImpl::loadFromJson(ConfigVar& cVar, const json& jsonValue) { + if (jsonValue.is_boolean()) { + const bool b = jsonValue.get(); + + const FrameInterpMode mode = b ? FrameInterpMode::Unlimited : FrameInterpMode::Off; + + cVar.setValue(sanitizeEnumValue(cVar, mode), false); + return; + } + + cVar.setValue(sanitizeEnumValue(cVar, jsonValue.get()), false); + } template class ConfigImpl; }