aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/particles/ultraparticle.h
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-05-23 13:07:21 +1000
committerAlan Alpert <alan.alpert@nokia.com>2011-05-23 13:07:21 +1000
commit2e0b25c49bf0e0a485360654ce6d51d38607c97b (patch)
tree24745d54f4bee4a9e20643e05bc7934077667b01 /src/imports/particles/ultraparticle.h
parentb3a03ede2badc0433345c90f96f4968869bfd8f8 (diff)
Fixed switching between particle performance modes
Actually switches shaders, and does not lose emitted particle data.
Diffstat (limited to 'src/imports/particles/ultraparticle.h')
-rw-r--r--src/imports/particles/ultraparticle.h222
1 files changed, 54 insertions, 168 deletions
diff --git a/src/imports/particles/ultraparticle.h b/src/imports/particles/ultraparticle.h
index 73fc3bdd33..cb120f9273 100644
--- a/src/imports/particles/ultraparticle.h
+++ b/src/imports/particles/ultraparticle.h
@@ -154,7 +154,7 @@ class UltraParticle : public ParticleType
Q_PROPERTY(qreal rotationSpeedVariation READ rotationSpeedVariation WRITE setRotationSpeedVariation NOTIFY rotationSpeedVariationChanged)
//If true, then will face the direction of motion. Stacks with rotation, e.g. setting rotation
//to 180 will lead to facing away from the direction of motion
- Q_PROPERTY(bool autoRotation READ autoRotation WRITE autoRotation NOTIFY autoRotationChanged)
+ Q_PROPERTY(bool autoRotation READ autoRotation WRITE setAutoRotation NOTIFY autoRotationChanged)
//###Call i/j? Makes more sense to those with vector calculus experience, and I could even add the cirumflex in QML?
//xVector is the vector from the top-left point to the top-right point, and is multiplied by current size
@@ -203,70 +203,31 @@ public:
qreal renderOpacity() const { return m_render_opacity; }
- qreal alphaVariation() const
- {
- return m_alphaVariation;
- }
-
- qreal alpha() const
- {
- return m_alpha;
- }
-
- qreal redVariation() const
- {
- return m_redVariation;
- }
-
- qreal greenVariation() const
- {
- return m_greenVariation;
- }
-
- qreal blueVariation() const
- {
- return m_blueVariation;
- }
-
- qreal rotation() const
- {
- return m_rotation;
- }
-
- qreal rotationVariation() const
- {
- return m_rotationVariation;
- }
-
- qreal rotationSpeed() const
- {
- return m_rotationSpeed;
- }
-
- qreal rotationSpeedVariation() const
- {
- return m_rotationSpeedVariation;
- }
-
- bool autoRotation() const
- {
- return m_autoRotation;
- }
-
- VaryingVector* xVector() const
- {
- return m_xVector;
- }
-
- VaryingVector* yVector() const
- {
- return m_yVector;
- }
-
- bool bloat() const
- {
- return m_bloat;
- }
+ qreal alphaVariation() const { return m_alphaVariation; }
+
+ qreal alpha() const { return m_alpha; }
+
+ qreal redVariation() const { return m_redVariation; }
+
+ qreal greenVariation() const { return m_greenVariation; }
+
+ qreal blueVariation() const { return m_blueVariation; }
+
+ qreal rotation() const { return m_rotation; }
+
+ qreal rotationVariation() const { return m_rotationVariation; }
+
+ qreal rotationSpeed() const { return m_rotationSpeed; }
+
+ qreal rotationSpeedVariation() const { return m_rotationSpeedVariation; }
+
+ bool autoRotation() const { return m_autoRotation; }
+
+ VaryingVector* xVector() const { return m_xVector; }
+
+ VaryingVector* yVector() const { return m_yVector; }
+
+ bool bloat() const { return m_bloat; }
signals:
@@ -306,110 +267,32 @@ signals:
void bloatChanged(bool arg);
public slots:
- void setAlphaVariation(qreal arg)
- {
- if (m_alphaVariation != arg) {
- m_alphaVariation = arg;
- emit alphaVariationChanged(arg);
- }
- }
-
- void setAlpha(qreal arg)
- {
- if (m_alpha != arg) {
- m_alpha = arg;
- emit alphaChanged(arg);
- }
- }
-
- void setRedVariation(qreal arg)
- {
- if (m_redVariation != arg) {
- m_redVariation = arg;
- emit redVariationChanged(arg);
- }
- }
-
- void setGreenVariation(qreal arg)
- {
- if (m_greenVariation != arg) {
- m_greenVariation = arg;
- emit greenVariationChanged(arg);
- }
- }
-
- void setBlueVariation(qreal arg)
- {
- if (m_blueVariation != arg) {
- m_blueVariation = arg;
- emit blueVariationChanged(arg);
- }
- }
-
void reloadColor(const Color4ub &c, ParticleData* d);
- void setRotation(qreal arg)
- {
- if (m_rotation != arg) {
- m_rotation = arg;
- emit rotationChanged(arg);
- }
- }
-
- void setRotationVariation(qreal arg)
- {
- if (m_rotationVariation != arg) {
- m_rotationVariation = arg;
- emit rotationVariationChanged(arg);
- }
- }
-
- void setRotationSpeed(qreal arg)
- {
- if (m_rotationSpeed != arg) {
- m_rotationSpeed = arg;
- emit rotationSpeedChanged(arg);
- }
- }
-
- void setRotationSpeedVariation(qreal arg)
- {
- if (m_rotationSpeedVariation != arg) {
- m_rotationSpeedVariation = arg;
- emit rotationSpeedVariationChanged(arg);
- }
- }
-
- void autoRotation(bool arg)
- {
- if (m_autoRotation != arg) {
- m_autoRotation = arg;
- emit autoRotationChanged(arg);
- }
- }
-
- void setXVector(VaryingVector* arg)
- {
- if (m_xVector != arg) {
- m_xVector = arg;
- emit xVectorChanged(arg);
- }
- }
-
- void setYVector(VaryingVector* arg)
- {
- if (m_yVector != arg) {
- m_yVector = arg;
- emit yVectorChanged(arg);
- }
- }
-
- void setBloat(bool arg)
- {
- if (m_bloat != arg) {
- m_bloat = arg;
- emit bloatChanged(arg);
- }
- }
+ void setAlphaVariation(qreal arg);
+
+ void setAlpha(qreal arg);
+
+ void setRedVariation(qreal arg);
+
+ void setGreenVariation(qreal arg);
+
+ void setBlueVariation(qreal arg);
+
+ void setRotation(qreal arg);
+
+ void setRotationVariation(qreal arg);
+
+ void setRotationSpeed(qreal arg);
+
+ void setRotationSpeedVariation(qreal arg);
+
+ void setAutoRotation(bool arg);
+
+ void setXVector(VaryingVector* arg);
+
+ void setYVector(VaryingVector* arg);
+
+ void setBloat(bool arg);
protected:
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
@@ -461,6 +344,9 @@ private:
bool m_bloat;
PerformanceLevel perfLevel;
+
+ PerformanceLevel m_lastLevel;
+ void* m_lastData;
};
QT_END_NAMESPACE