Merge branch 'qtquick2' of scm.dev.nokia.troll.no:qt/qtdeclarative-staging into qtquick2
This commit is contained in:
commit
7cf421d04d
|
@ -40,7 +40,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 1.0
|
import QtQuick 1.0
|
||||||
import QtQuick.Particles 1.0
|
import Qt.labs.particles 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property bool explode : false
|
property bool explode : false
|
||||||
|
|
|
@ -85,7 +85,7 @@ Component {
|
||||||
anchors.centerIn: parent; anchors.verticalCenterOffset: -30
|
anchors.centerIn: parent; anchors.verticalCenterOffset: -30
|
||||||
path: Path {
|
path: Path {
|
||||||
PathAttribute { name: 'z'; value: 9999.0 }
|
PathAttribute { name: 'z'; value: 9999.0 }
|
||||||
PathLineShape { x: 1; y: 1 }
|
PathLine { x: 1; y: 1 }
|
||||||
PathAttribute { name: 'z'; value: 0.0 }
|
PathAttribute { name: 'z'; value: 0.0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 1.0
|
import QtQuick 1.0
|
||||||
import QtQuick.Particles 1.0
|
import Qt.labs.particles 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 1.0
|
import QtQuick 1.0
|
||||||
import QtQuick.Particles 1.0
|
import Qt.labs.particles 1.0
|
||||||
|
|
||||||
Item { id:link
|
Item { id:link
|
||||||
property bool dying: false
|
property bool dying: false
|
||||||
|
|
|
@ -56,6 +56,8 @@ QSGParticleAffector::QSGParticleAffector(QSGItem *parent) :
|
||||||
|
|
||||||
void QSGParticleAffector::componentComplete()
|
void QSGParticleAffector::componentComplete()
|
||||||
{
|
{
|
||||||
|
if(!m_system && qobject_cast<QSGParticleSystem*>(parentItem()))
|
||||||
|
setSystem(qobject_cast<QSGParticleSystem*>(parentItem()));
|
||||||
if(!m_system)
|
if(!m_system)
|
||||||
qWarning() << "Affector created without a particle system specified";//TODO: useful QML warnings, like line number?
|
qWarning() << "Affector created without a particle system specified";//TODO: useful QML warnings, like line number?
|
||||||
QSGItem::componentComplete();
|
QSGItem::componentComplete();
|
||||||
|
|
|
@ -76,6 +76,8 @@ QSGParticleEmitter::~QSGParticleEmitter()
|
||||||
|
|
||||||
void QSGParticleEmitter::componentComplete()
|
void QSGParticleEmitter::componentComplete()
|
||||||
{
|
{
|
||||||
|
if(!m_system && qobject_cast<QSGParticleSystem*>(parentItem()))
|
||||||
|
setSystem(qobject_cast<QSGParticleSystem*>(parentItem()));
|
||||||
if(!m_system)
|
if(!m_system)
|
||||||
qWarning() << "Emitter created without a particle system specified";//TODO: useful QML warnings, like line number?
|
qWarning() << "Emitter created without a particle system specified";//TODO: useful QML warnings, like line number?
|
||||||
QSGItem::componentComplete();
|
QSGItem::componentComplete();
|
||||||
|
|
|
@ -54,8 +54,10 @@ QSGParticlePainter::QSGParticlePainter(QSGItem *parent) :
|
||||||
|
|
||||||
void QSGParticlePainter::componentComplete()
|
void QSGParticlePainter::componentComplete()
|
||||||
{
|
{
|
||||||
|
if(!m_system && qobject_cast<QSGParticleSystem*>(parentItem()))
|
||||||
|
setSystem(qobject_cast<QSGParticleSystem*>(parentItem()));
|
||||||
if(!m_system)
|
if(!m_system)
|
||||||
qWarning() << "Particle created without a particle system specified";//TODO: useful QML warnings, like line number?
|
qWarning() << "ParticlePainter created without a particle system specified";//TODO: useful QML warnings, like line number?
|
||||||
QSGItem::componentComplete();
|
QSGItem::componentComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,9 @@ QSGParticleData::QSGParticleData()
|
||||||
}
|
}
|
||||||
|
|
||||||
QSGParticleSystem::QSGParticleSystem(QSGItem *parent) :
|
QSGParticleSystem::QSGParticleSystem(QSGItem *parent) :
|
||||||
QSGItem(parent), m_particle_count(0), m_running(true) , m_startTime(0), m_overwrite(false)
|
QSGItem(parent), m_particle_count(0), m_running(true)
|
||||||
|
, m_startTime(0), m_overwrite(false)
|
||||||
|
, m_componentComplete(false)
|
||||||
{
|
{
|
||||||
m_groupIds = QHash<QString, int>();
|
m_groupIds = QHash<QString, int>();
|
||||||
}
|
}
|
||||||
|
@ -111,7 +113,9 @@ void QSGParticleSystem::setRunning(bool arg)
|
||||||
void QSGParticleSystem::componentComplete()
|
void QSGParticleSystem::componentComplete()
|
||||||
{
|
{
|
||||||
QSGItem::componentComplete();
|
QSGItem::componentComplete();
|
||||||
reset();
|
m_componentComplete = true;
|
||||||
|
if(!m_emitters.isEmpty() && !m_particles.isEmpty())
|
||||||
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSGParticleSystem::initializeSystem()
|
void QSGParticleSystem::initializeSystem()
|
||||||
|
@ -191,6 +195,8 @@ void QSGParticleSystem::initializeSystem()
|
||||||
|
|
||||||
void QSGParticleSystem::reset()
|
void QSGParticleSystem::reset()
|
||||||
{
|
{
|
||||||
|
if(!m_componentComplete)
|
||||||
|
return;//Batch starting reset()s a little
|
||||||
//Clear guarded pointers which have been deleted
|
//Clear guarded pointers which have been deleted
|
||||||
int cleared = 0;
|
int cleared = 0;
|
||||||
cleared += m_emitters.removeAll(0);
|
cleared += m_emitters.removeAll(0);
|
||||||
|
|
|
@ -163,6 +163,7 @@ private:
|
||||||
qint64 m_startTime;
|
qint64 m_startTime;
|
||||||
int m_nextGroupId;
|
int m_nextGroupId;
|
||||||
bool m_overwrite;
|
bool m_overwrite;
|
||||||
|
bool m_componentComplete;
|
||||||
};
|
};
|
||||||
|
|
||||||
//TODO: Clean up all this into ParticleData
|
//TODO: Clean up all this into ParticleData
|
||||||
|
|
Loading…
Reference in New Issue