aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickcustomparticle.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-12-08 13:14:03 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2016-12-21 20:31:56 +0000
commit9774757312cc75e4f49bd14a7729a9fdfb4456ae (patch)
tree7c1e6687c721a06da5ec0a34461e4800fe34bcbe /src/particles/qquickcustomparticle.cpp
parent42c52e6f2d9002e8191ada765d8a2509c7fae71b (diff)
particles: Fix up 16k warnings and apply them on non-ES too
The isOpenGLES() condition is plain wrong: the code always uses ushort as the index type. Change-Id: Ibc5989227f61201913ff124485df4890b3490db5 Task-number: QTBUG-57515 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/particles/qquickcustomparticle.cpp')
-rw-r--r--src/particles/qquickcustomparticle.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/particles/qquickcustomparticle.cpp b/src/particles/qquickcustomparticle.cpp
index c08ae3d9ff..babf13a93c 100644
--- a/src/particles/qquickcustomparticle.cpp
+++ b/src/particles/qquickcustomparticle.cpp
@@ -40,6 +40,7 @@
#include "qquickcustomparticle_p.h"
#include <QtQuick/private/qquickshadereffectmesh_p.h>
#include <QtQuick/private/qsgshadersourcebuilder_p.h>
+#include <QtQml/qqmlinfo.h>
#include <cstdlib>
QT_BEGIN_NAMESPACE
@@ -90,6 +91,7 @@ struct PlainVertices {
\brief For specifying shaders to paint particles
\ingroup qtquick-particles
+ \note The maximum number of custom particles is limited to 16383.
*/
QQuickCustomParticle::QQuickCustomParticle(QQuickItem* parent)
@@ -316,13 +318,14 @@ QQuickOpenGLShaderEffectNode* QQuickCustomParticle::buildCustomNodes()
if (!QOpenGLContext::currentContext())
return 0;
- if (QOpenGLContext::currentContext()->isOpenGLES() && m_count * 4 > 0xffff) {
- printf("CustomParticle: Too many particles... \n");
+ if (m_count * 4 > 0xffff) {
+ // Index data is ushort.
+ qmlInfo(this) << "CustomParticle: Too many particles - maximum 16383 per CustomParticle";
return 0;
}
if (m_count <= 0) {
- printf("CustomParticle: Too few particles... \n");
+ qmlInfo(this) << "CustomParticle: Too few particles";
return 0;
}