aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/particles/qquickcustomparticle.cpp9
-rw-r--r--src/particles/qquickimageparticle.cpp7
2 files changed, 11 insertions, 5 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;
}
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index e6b921792f..60cbf6175d 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -510,6 +510,8 @@ void fillUniformArrayFromImage(float* array, const QImage& img, int size)
So if you explicitly set an attribute affecting color, such as redVariation, and then reset it (by setting redVariation
to undefined), all color data will be reset and it will begin to have an implicit value of any shared color from
other ImageParticles.
+
+ \note The maximum number of image particles is limited to 16383.
*/
/*!
\qmlproperty url QtQuick.Particles::ImageParticle::source
@@ -1240,8 +1242,9 @@ void QQuickImageParticle::finishBuildParticleNodes(QSGNode** node)
if (!QOpenGLContext::currentContext())
return;
- if (QOpenGLContext::currentContext()->isOpenGLES() && m_count * 4 > 0xffff) {
- printf("ImageParticle: Too many particles - maximum 16,000 per ImageParticle.\n");//ES 2 vertex count limit is ushort
+ if (m_count * 4 > 0xffff) {
+ // Index data is ushort.
+ qmlInfo(this) << "ImageParticle: Too many particles - maximum 16383 per ImageParticle";
return;
}