aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/particles
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-08-31 16:43:22 +0200
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-08-31 17:02:05 +0200
commit01335edc94d2961bd4061ed2cb81ebd1151797bf (patch)
tree54df7d2d0857278198258e4d8a65bf63cb35d91a /src/declarative/particles
parent20c3575fc39004d6a556820543982f4a6ebef0be (diff)
Fix export symbols for QtDeclarative and QtQuick1.
Fix build on Windows and compiler warnings. Requires 090ee21eac7257644422e35395194e5fd7fb8efa in qtbase. Change-Id: Ief8da504ccd3e2c2e78644cc9943d685c4302019 Reviewed-on: http://codereview.qt.nokia.com/3988 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/declarative/particles')
-rw-r--r--src/declarative/particles/qsgangleddirection.cpp2
-rw-r--r--src/declarative/particles/qsgcumulativedirection.cpp6
-rw-r--r--src/declarative/particles/qsgcumulativedirection_p.h1
-rw-r--r--src/declarative/particles/qsgcustomparticle.cpp2
-rw-r--r--src/declarative/particles/qsgfollowemitter.cpp2
-rw-r--r--src/declarative/particles/qsgimageparticle.cpp32
-rw-r--r--src/declarative/particles/qsgmodelparticle.cpp2
-rw-r--r--src/declarative/particles/qsgparticlesystem.cpp4
8 files changed, 26 insertions, 25 deletions
diff --git a/src/declarative/particles/qsgangleddirection.cpp b/src/declarative/particles/qsgangleddirection.cpp
index ab39b8a575..844941c178 100644
--- a/src/declarative/particles/qsgangleddirection.cpp
+++ b/src/declarative/particles/qsgangleddirection.cpp
@@ -102,7 +102,7 @@ QSGAngledDirection::QSGAngledDirection(QObject *parent) :
}
-const QPointF &QSGAngledDirection::sample(const QPointF &from)
+const QPointF &QSGAngledDirection::sample(const QPointF &)
{
//TODO: Faster
qreal theta = m_angle*CONV - m_angleVariation*CONV + rand()/float(RAND_MAX) * m_angleVariation*CONV * 2;
diff --git a/src/declarative/particles/qsgcumulativedirection.cpp b/src/declarative/particles/qsgcumulativedirection.cpp
index 1d7523972b..3502b41bce 100644
--- a/src/declarative/particles/qsgcumulativedirection.cpp
+++ b/src/declarative/particles/qsgcumulativedirection.cpp
@@ -61,10 +61,10 @@ QDeclarativeListProperty<QSGStochasticDirection> QSGCumulativeDirection::directi
const QPointF &QSGCumulativeDirection::sample(const QPointF &from)
{
- QPointF ret;
+ m_ret = QPointF();
foreach (QSGStochasticDirection* dir, m_directions)
- ret += dir->sample(from);
- return ret;
+ m_ret += dir->sample(from);
+ return m_ret;
}
QT_END_NAMESPACE
diff --git a/src/declarative/particles/qsgcumulativedirection_p.h b/src/declarative/particles/qsgcumulativedirection_p.h
index c54a795931..53ed7613a1 100644
--- a/src/declarative/particles/qsgcumulativedirection_p.h
+++ b/src/declarative/particles/qsgcumulativedirection_p.h
@@ -60,5 +60,6 @@ public:
const QPointF &sample(const QPointF &from);
private:
QList<QSGStochasticDirection*> m_directions;
+ QPointF m_ret;
};
#endif // QSGCUMULATIVEDIRECTION_P_H
diff --git a/src/declarative/particles/qsgcustomparticle.cpp b/src/declarative/particles/qsgcustomparticle.cpp
index 12d32a27b4..373d050627 100644
--- a/src/declarative/particles/qsgcustomparticle.cpp
+++ b/src/declarative/particles/qsgcustomparticle.cpp
@@ -281,7 +281,7 @@ void QSGCustomParticle::setSource(const QVariant &var, int index)
source.item = qobject_cast<QSGItem *>(obj);
if (!source.item || !source.item->isTextureProvider()) {
qWarning("ShaderEffect: source uniform [%s] is not assigned a valid texture provider: %s [%s]",
- qPrintable(source.name), qPrintable(obj->objectName()), obj->metaObject()->className());
+ source.name.constData(), qPrintable(obj->objectName()), obj->metaObject()->className());
return;
}
diff --git a/src/declarative/particles/qsgfollowemitter.cpp b/src/declarative/particles/qsgfollowemitter.cpp
index 68f0f6bf75..d2e3265e2d 100644
--- a/src/declarative/particles/qsgfollowemitter.cpp
+++ b/src/declarative/particles/qsgfollowemitter.cpp
@@ -209,7 +209,7 @@ void QSGFollowEmitter::emitWindow(int timeStamp)
const QPointF &speed = m_speed->sample(newPos);
datum->vx = speed.x()
+ m_speed_from_movement * d->vx;
- datum->vy = speed.y();
+ datum->vy = speed.y()
+ m_speed_from_movement * d->vy;
// Particle acceleration
diff --git a/src/declarative/particles/qsgimageparticle.cpp b/src/declarative/particles/qsgimageparticle.cpp
index f269895536..1e410ad1b9 100644
--- a/src/declarative/particles/qsgimageparticle.cpp
+++ b/src/declarative/particles/qsgimageparticle.cpp
@@ -66,7 +66,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlParticlesDebug, QML_PARTICLES_DEBUG)
//TODO: Make it larger on desktop? Requires fixing up shader code with the same define
#define UNIFORM_ARRAY_SIZE 64
-const float CONV = 0.017453292519943295;
+const qreal CONV = 0.017453292519943295;
class ImageMaterialData
{
public:
@@ -99,13 +99,13 @@ class TabledMaterial : public QSGSimpleMaterialShader<TabledMaterialData>
public:
TabledMaterial()
{
- QFile vf(":defaultshaders/imagevertex.shader");
+ QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n")
+ vf.readAll();
- QFile ff(":defaultshaders/imagefragment.shader");
+ QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n")
@@ -167,13 +167,13 @@ class DeformableMaterial : public QSGSimpleMaterialShader<DeformableMaterialData
public:
DeformableMaterial()
{
- QFile vf(":defaultshaders/imagevertex.shader");
+ QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define DEFORM\n#define COLOR\n")
+ vf.readAll();
- QFile ff(":defaultshaders/imagefragment.shader");
+ QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define DEFORM\n#define COLOR\n")
@@ -223,13 +223,13 @@ class SpriteMaterial : public QSGSimpleMaterialShader<SpriteMaterialData>
public:
SpriteMaterial()
{
- QFile vf(":defaultshaders/imagevertex.shader");
+ QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define SPRITE\n#define TABLE\n#define DEFORM\n#define COLOR\n")
+ vf.readAll();
- QFile ff(":defaultshaders/imagefragment.shader");
+ QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define SPRITE\n#define TABLE\n#define DEFORM\n#define COLOR\n")
@@ -296,13 +296,13 @@ class ColoredMaterial : public QSGSimpleMaterialShader<ColoredMaterialData>
public:
ColoredMaterial()
{
- QFile vf(":defaultshaders/imagevertex.shader");
+ QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define COLOR\n")
+ vf.readAll();
- QFile ff(":defaultshaders/imagefragment.shader");
+ QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define COLOR\n")
@@ -317,7 +317,7 @@ public:
void activate() {
QSGSimpleMaterialShader<ColoredMaterialData>::activate();
-#ifndef QT_OPENGL_ES_2
+#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN)
glEnable(GL_POINT_SPRITE);
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
@@ -325,7 +325,7 @@ public:
void deactivate() {
QSGSimpleMaterialShader<ColoredMaterialData>::deactivate();
-#ifndef QT_OPENGL_ES_2
+#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN)
glDisable(GL_POINT_SPRITE);
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
@@ -367,12 +367,12 @@ class SimpleMaterial : public QSGSimpleMaterialShader<SimpleMaterialData>
public:
SimpleMaterial()
{
- QFile vf(":defaultshaders/imagevertex.shader");
+ QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ vf.readAll();
- QFile ff(":defaultshaders/imagefragment.shader");
+ QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ ff.readAll();
@@ -386,7 +386,7 @@ public:
void activate() {
QSGSimpleMaterialShader<SimpleMaterialData>::activate();
-#ifndef QT_OPENGL_ES_2
+#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN)
glEnable(GL_POINT_SPRITE);
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
@@ -394,7 +394,7 @@ public:
void deactivate() {
QSGSimpleMaterialShader<SimpleMaterialData>::deactivate();
-#ifndef QT_OPENGL_ES_2
+#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN)
glDisable(GL_POINT_SPRITE);
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
@@ -913,7 +913,7 @@ QSGGeometryNode* QSGImageParticle::buildParticleNodes()
sizetable = QImage(m_sizetable_name.toLocalFile());
opacitytable = QImage(m_opacitytable_name.toLocalFile());
if (colortable.isNull())
- colortable = QImage(":defaultshaders/identitytable.png");
+ colortable = QImage(QStringLiteral(":defaultshaders/identitytable.png"));
Q_ASSERT(!colortable.isNull());
getState<ImageMaterialData>(m_material)->colorTable = sceneGraphEngine()->createTextureFromImage(colortable);
fillUniformArrayFromImage(getState<ImageMaterialData>(m_material)->sizeTable, sizetable, UNIFORM_ARRAY_SIZE);
diff --git a/src/declarative/particles/qsgmodelparticle.cpp b/src/declarative/particles/qsgmodelparticle.cpp
index 2646864283..d90b09fa6d 100644
--- a/src/declarative/particles/qsgmodelparticle.cpp
+++ b/src/declarative/particles/qsgmodelparticle.cpp
@@ -213,7 +213,7 @@ void QSGModelParticle::processPending()
m_requests.clear();
}
-void QSGModelParticle::commit(int gIdx, int pIdx)
+void QSGModelParticle::commit(int /* gIdx */, int /* pIdx */)
{
//No-op unless we start copying the data.
}
diff --git a/src/declarative/particles/qsgparticlesystem.cpp b/src/declarative/particles/qsgparticlesystem.cpp
index efd6c22bd9..d12165e4e8 100644
--- a/src/declarative/particles/qsgparticlesystem.cpp
+++ b/src/declarative/particles/qsgparticlesystem.cpp
@@ -493,7 +493,7 @@ QSGParticleSystem::QSGParticleSystem(QSGItem *parent) :
{
QSGParticleGroupData* gd = new QSGParticleGroupData(0, this);//Default group
m_groupData.insert(0,gd);
- m_groupIds.insert("",0);
+ m_groupIds.insert(QString(),0);
m_nextGroupId = 1;
connect(&m_painterMapper, SIGNAL(mapped(QObject*)),
@@ -549,7 +549,7 @@ void QSGParticleSystem::loadPainter(QObject *p)
int particleCount = 0;
if (painter->particles().isEmpty()){//Uses default particle
QStringList def;
- def << "";
+ def << QString();
painter->setParticles(def);
particleCount += m_groupData[0]->size();
m_groupData[0]->painters << painter;