From b09ae1755e50041ad7ea7614c02fcb213812a064 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Wed, 7 Oct 2015 13:59:00 -0700 Subject: [PATCH] fix formatting of macros --- .../entities/src/EntityItemPropertiesMacros.h | 112 +++++++++--------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/libraries/entities/src/EntityItemPropertiesMacros.h b/libraries/entities/src/EntityItemPropertiesMacros.h index 39d8a38380..eb9a75259d 100644 --- a/libraries/entities/src/EntityItemPropertiesMacros.h +++ b/libraries/entities/src/EntityItemPropertiesMacros.h @@ -132,17 +132,17 @@ inline QScriptValue convertScriptValue(QScriptEngine* e, const EntityItemID& v) properties.setProperty(#g, groupProperties); \ } -#define COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(X,G,g,P,p,M) \ - if ((desiredProperties.isEmpty() || desiredProperties.getHasProperty(X)) && \ - (!skipDefaults || defaultEntityProperties.get##G().get##P() != get##P())) { \ - QScriptValue groupProperties = properties.property(#g); \ - if (!groupProperties.isValid()) { \ - groupProperties = engine->newObject(); \ - } \ - QScriptValue V = convertScriptValue(engine, M()); \ - groupProperties.setProperty(#p, V); \ - properties.setProperty(#g, groupProperties); \ - } +#define COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(X,G,g,P,p,M) \ + if ((desiredProperties.isEmpty() || desiredProperties.getHasProperty(X)) && \ + (!skipDefaults || defaultEntityProperties.get##G().get##P() != get##P())) { \ + QScriptValue groupProperties = properties.property(#g); \ + if (!groupProperties.isValid()) { \ + groupProperties = engine->newObject(); \ + } \ + QScriptValue V = convertScriptValue(engine, M()); \ + groupProperties.setProperty(#p, V); \ + properties.setProperty(#g, groupProperties); \ + } #define COPY_PROPERTY_TO_QSCRIPTVALUE(p,P) \ if ((_desiredProperties.isEmpty() || _desiredProperties.getHasProperty(p)) && \ @@ -165,7 +165,7 @@ inline QScriptValue convertScriptValue(QScriptEngine* e, const EntityItemID& v) if (!skipDefaults || defaultEntityProperties._##P != _##P) { \ QScriptValue V = convertScriptValue(engine, G); \ properties.setProperty(#P, V); \ - } + } typedef glm::vec3 glmVec3; typedef glm::quat glmQuat; @@ -266,55 +266,55 @@ inline xColor xColor_convertFromScriptValue(const QScriptValue& v, bool& isValid } -#define COPY_PROPERTY_FROM_QSCRIPTVALUE(P, T, S) \ - { \ - QScriptValue V = object.property(#P); \ - if (V.isValid()) { \ - bool isValid = false; \ - T newValue = T##_convertFromScriptValue(V, isValid); \ +#define COPY_PROPERTY_FROM_QSCRIPTVALUE(P, T, S) \ + { \ + QScriptValue V = object.property(#P); \ + if (V.isValid()) { \ + bool isValid = false; \ + T newValue = T##_convertFromScriptValue(V, isValid); \ if (isValid && (_defaultSettings || newValue != _##P)) { \ - S(newValue); \ - } \ - } \ + S(newValue); \ + } \ + } \ } -#define COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(P, T, S, G) \ -{ \ - QScriptValue V = object.property(#P); \ - if (V.isValid()) { \ - bool isValid = false; \ - T newValue = T##_convertFromScriptValue(V, isValid); \ +#define COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(P, T, S, G) \ +{ \ + QScriptValue V = object.property(#P); \ + if (V.isValid()) { \ + bool isValid = false; \ + T newValue = T##_convertFromScriptValue(V, isValid); \ if (isValid && (_defaultSettings || newValue != G())) { \ - S(newValue); \ - } \ - }\ + S(newValue); \ + } \ + } \ } -#define COPY_PROPERTY_FROM_QSCRIPTVALUE_NOCHECK(P, T, S) \ -{ \ - QScriptValue V = object.property(#P); \ - if (V.isValid()) { \ - bool isValid = false; \ +#define COPY_PROPERTY_FROM_QSCRIPTVALUE_NOCHECK(P, T, S) \ +{ \ + QScriptValue V = object.property(#P); \ + if (V.isValid()) { \ + bool isValid = false; \ T newValue = T##_convertFromScriptValue(V, isValid); \ - if (isValid && (_defaultSettings)) { \ - S(newValue); \ - } \ - }\ + if (isValid && (_defaultSettings)) { \ + S(newValue); \ + } \ + } \ } -#define COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(G, P, T, S) \ - { \ - QScriptValue G = object.property(#G); \ - if (G.isValid()) { \ - QScriptValue V = G.property(#P); \ - if (V.isValid()) { \ - bool isValid = false; \ - T newValue = T##_convertFromScriptValue(V, isValid); \ +#define COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(G, P, T, S) \ + { \ + QScriptValue G = object.property(#G); \ + if (G.isValid()) { \ + QScriptValue V = G.property(#P); \ + if (V.isValid()) { \ + bool isValid = false; \ + T newValue = T##_convertFromScriptValue(V, isValid); \ if (isValid && (_defaultSettings || newValue != _##P)) { \ - S(newValue); \ - } \ - } \ - } \ + S(newValue); \ + } \ + } \ + } \ } #define COPY_PROPERTY_FROM_QSCRITPTVALUE_ENUM(P, S) \ @@ -330,12 +330,12 @@ inline xColor xColor_convertFromScriptValue(const QScriptValue& v, bool& isValid _##n(V), \ _##n##Changed(false) -#define DEFINE_PROPERTY_GROUP(N, n, T) \ - public: \ +#define DEFINE_PROPERTY_GROUP(N, n, T) \ + public: \ const T& get##N() const { return _##n; } \ - T& get##N() { return _##n; } \ - private: \ - T _##n; \ + T& get##N() { return _##n; } \ + private: \ + T _##n; \ static T _static##N; #define ADD_PROPERTY_TO_MAP(P, N, n, T) \