summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-08-23 18:34:46 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-24 04:23:40 +0200
commit6b18f28e38149a4f35e48dc2a7f52bc7a23587c3 (patch)
tree829b15cafc6a24e32c18cc87e26f20bcfccb5628
parentd469d39a92cda540adeb9c36b533781c4a801b75 (diff)
Compile on Mac
Change-Id: I4e1deb5a5430af79430e3c1fc22f16461672586d Reviewed-on: http://codereview.qt.nokia.com/3389 Reviewed-by: Alan Alpert <alan.alpert@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
-rw-r--r--src/declarative/particles/qsgimageparticle.cpp35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/declarative/particles/qsgimageparticle.cpp b/src/declarative/particles/qsgimageparticle.cpp
index 98f098597d..f2fb289ab5 100644
--- a/src/declarative/particles/qsgimageparticle.cpp
+++ b/src/declarative/particles/qsgimageparticle.cpp
@@ -57,6 +57,11 @@ QT_BEGIN_NAMESPACE
//###Switch to define later, for now user-friendly (no compilation) debugging is worth it
DEFINE_BOOL_CONFIG_OPTION(qmlParticlesDebug, QML_PARTICLES_DEBUG)
+#ifdef Q_WS_MAC
+#define SHADER_DEFINES "#version 120\n"
+#else
+#define SHADER_DEFINES ""
+#endif
const float CONV = 0.017453292519943295;
class ImageMaterialData
{
@@ -94,12 +99,14 @@ public:
{
QFile vf(":defaultshaders/imagevertex.shader");
vf.open(QFile::ReadOnly);
- m_vertex_code = QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n")
+ m_vertex_code = QByteArray(SHADER_DEFINES)
+ + QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n")
+ vf.readAll();
QFile ff(":defaultshaders/imagefragment.shader");
ff.open(QFile::ReadOnly);
- m_fragment_code = QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n")
+ m_fragment_code = QByteArray(SHADER_DEFINES)
+ + QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n")
+ ff.readAll();
Q_ASSERT(!m_vertex_code.isNull());
@@ -163,12 +170,14 @@ public:
{
QFile vf(":defaultshaders/imagevertex.shader");
vf.open(QFile::ReadOnly);
- m_vertex_code = QByteArray("#define DEFORM\n#define COLOR\n")
+ m_vertex_code = QByteArray(SHADER_DEFINES)
+ + QByteArray("#define DEFORM\n#define COLOR\n")
+ vf.readAll();
QFile ff(":defaultshaders/imagefragment.shader");
ff.open(QFile::ReadOnly);
- m_fragment_code = QByteArray("#define DEFORM\n#define COLOR\n")
+ m_fragment_code = QByteArray(SHADER_DEFINES)
+ + QByteArray("#define DEFORM\n#define COLOR\n")
+ ff.readAll();
Q_ASSERT(!m_vertex_code.isNull());
@@ -217,12 +226,14 @@ public:
{
QFile vf(":defaultshaders/imagevertex.shader");
vf.open(QFile::ReadOnly);
- m_vertex_code = QByteArray("#define SPRITE\n#define TABLE\n#define DEFORM\n#define COLOR\n")
+ 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");
ff.open(QFile::ReadOnly);
- m_fragment_code = QByteArray("#define SPRITE\n#define TABLE\n#define DEFORM\n#define COLOR\n")
+ m_fragment_code = QByteArray(SHADER_DEFINES)
+ + QByteArray("#define SPRITE\n#define TABLE\n#define DEFORM\n#define COLOR\n")
+ ff.readAll();
Q_ASSERT(!m_vertex_code.isNull());
@@ -290,12 +301,14 @@ public:
{
QFile vf(":defaultshaders/imagevertex.shader");
vf.open(QFile::ReadOnly);
- m_vertex_code = QByteArray("#define COLOR\n")
+ m_vertex_code = QByteArray(SHADER_DEFINES)
+ + QByteArray("#define COLOR\n")
+ vf.readAll();
QFile ff(":defaultshaders/imagefragment.shader");
ff.open(QFile::ReadOnly);
- m_fragment_code = QByteArray("#define COLOR\n")
+ m_fragment_code = QByteArray(SHADER_DEFINES)
+ + QByteArray("#define COLOR\n")
+ ff.readAll();
Q_ASSERT(!m_vertex_code.isNull());
@@ -359,11 +372,13 @@ public:
{
QFile vf(":defaultshaders/imagevertex.shader");
vf.open(QFile::ReadOnly);
- m_vertex_code = vf.readAll();
+ m_vertex_code = QByteArray(SHADER_DEFINES)
+ + vf.readAll();
QFile ff(":defaultshaders/imagefragment.shader");
ff.open(QFile::ReadOnly);
- m_fragment_code = ff.readAll();
+ m_fragment_code = QByteArray(SHADER_DEFINES)
+ + ff.readAll();
Q_ASSERT(!m_vertex_code.isNull());
Q_ASSERT(!m_fragment_code.isNull());