mirror of https://github.com/AxioDL/metaforce.git
Fix toValue
This commit is contained in:
parent
7fb8bdc602
commit
94e7bacd71
|
@ -75,8 +75,8 @@ public:
|
||||||
std::string help() const;
|
std::string help() const;
|
||||||
std::string value() const { return m_value; }
|
std::string value() const { return m_value; }
|
||||||
|
|
||||||
template <typename T>
|
template <class T>
|
||||||
bool toValue(T& value) const { return false; }
|
bool toValue(T& value) const;
|
||||||
atVec2f toVec2f(bool* isValid = nullptr) const;
|
atVec2f toVec2f(bool* isValid = nullptr) const;
|
||||||
template<>
|
template<>
|
||||||
bool toValue(atVec2f& value) const {
|
bool toValue(atVec2f& value) const {
|
||||||
|
@ -121,6 +121,11 @@ public:
|
||||||
}
|
}
|
||||||
double toReal(bool* isValid = nullptr) const;
|
double toReal(bool* isValid = nullptr) const;
|
||||||
template<>
|
template<>
|
||||||
|
bool toValue(float& value) const {
|
||||||
|
bool isValid = false;
|
||||||
|
value = static_cast<float>(toReal(&isValid));
|
||||||
|
return isValid;
|
||||||
|
}
|
||||||
bool toValue(double& value) const {
|
bool toValue(double& value) const {
|
||||||
bool isValid = false;
|
bool isValid = false;
|
||||||
value = toReal(&isValid);
|
value = toReal(&isValid);
|
||||||
|
|
Loading…
Reference in New Issue