diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:44:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:44:42 +0100 |
commit | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (patch) | |
tree | c980d614fec4a5495798be3e79e033229062c3cd /src/util/quicktune.h | |
parent | 28f6a79706b088c37268a59d90878220dc4ef9c7 (diff) | |
parent | 3af10766fd2b58b068e970266724d7eb10e9316b (diff) | |
download | dragonfireclient-5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/util/quicktune.h')
-rw-r--r-- | src/util/quicktune.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/util/quicktune.h b/src/util/quicktune.h index 1943d19c2..6d47f56df 100644 --- a/src/util/quicktune.h +++ b/src/util/quicktune.h @@ -52,15 +52,18 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <map> #include <vector> -enum QuicktuneValueType{ +enum QuicktuneValueType +{ QVT_NONE, QVT_FLOAT }; struct QuicktuneValue { QuicktuneValueType type = QVT_NONE; - union{ - struct{ + union + { + struct + { float current; float min; float max; @@ -81,18 +84,20 @@ void setQuicktuneValue(const std::string &name, const QuicktuneValue &val); void updateQuicktuneValue(const std::string &name, QuicktuneValue &val); #ifndef NDEBUG - #define QUICKTUNE(type_, var, min_, max_, name){\ - QuicktuneValue qv;\ - qv.type = type_;\ - qv.value_##type_.current = var;\ - qv.value_##type_.min = min_;\ - qv.value_##type_.max = max_;\ - updateQuicktuneValue(name, qv);\ - var = qv.value_##type_.current;\ +#define QUICKTUNE(type_, var, min_, max_, name) \ + { \ + QuicktuneValue qv; \ + qv.type = type_; \ + qv.value_##type_.current = var; \ + qv.value_##type_.min = min_; \ + qv.value_##type_.max = max_; \ + updateQuicktuneValue(name, qv); \ + var = qv.value_##type_.current; \ } #else // NDEBUG - #define QUICKTUNE(type, var, min_, max_, name){} +#define QUICKTUNE(type, var, min_, max_, name) \ + { \ + } #endif -#define QUICKTUNE_AUTONAME(type_, var, min_, max_)\ - QUICKTUNE(type_, var, min_, max_, #var) +#define QUICKTUNE_AUTONAME(type_, var, min_, max_) QUICKTUNE(type_, var, min_, max_, #var) |