fix formatting of macros

This commit is contained in:
Brad Hefta-Gaub 2015-10-07 13:59:00 -07:00
parent 7a85e5b7a7
commit b09ae1755e

View file

@ -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) \