From 94e7bacd71e49f807de88a6f3595ace161980cd6 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 28 Sep 2020 21:35:55 -0700 Subject: [PATCH] Fix toValue --- hecl/include/hecl/CVar.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hecl/include/hecl/CVar.hpp b/hecl/include/hecl/CVar.hpp index a34678ff3..b8469be1f 100644 --- a/hecl/include/hecl/CVar.hpp +++ b/hecl/include/hecl/CVar.hpp @@ -75,8 +75,8 @@ public: std::string help() const; std::string value() const { return m_value; } - template - bool toValue(T& value) const { return false; } + template + bool toValue(T& value) const; atVec2f toVec2f(bool* isValid = nullptr) const; template<> bool toValue(atVec2f& value) const { @@ -121,6 +121,11 @@ public: } double toReal(bool* isValid = nullptr) const; template<> + bool toValue(float& value) const { + bool isValid = false; + value = static_cast(toReal(&isValid)); + return isValid; + } bool toValue(double& value) const { bool isValid = false; value = toReal(&isValid);