Step one of fixing the limited lifetime bug. As this step should also
increase the lifetime 'a lot' step two may take a while.
Change-Id: I87bbe762803451f751e23d4bf8559c662fdf57a3
(cherry picked from commit
9cf15c135373f8190bf2cb62f9f99890cacf7d88)
if(m_node == 0)
return;
}
if(m_node == 0)
return;
}
- uint timeStamp = m_system->systemSync(this);
+ qint64 timeStamp = m_system->systemSync(this);
qreal time = timeStamp / 1000.;
m_material->timestamp = time;
qreal time = timeStamp / 1000.;
m_material->timestamp = time;
if(m_node == 0)
return;
}
if(m_node == 0)
return;
}
- uint timeStamp = m_system->systemSync(this);
+ qint64 timeStamp = m_system->systemSync(this);
qreal time = timeStamp / 1000.;
m_material->timestamp = time;
qreal time = timeStamp / 1000.;
m_material->timestamp = time;
void ModelParticle::prepareNextFrame()
{
void ModelParticle::prepareNextFrame()
{
- uint timeStamp = m_system->systemSync(this);
+ qint64 timeStamp = m_system->systemSync(this);
qreal curT = timeStamp/1000.0;
qreal dt = curT - m_lastT;
m_lastT = curT;
qreal curT = timeStamp/1000.0;
qreal dt = curT - m_lastT;
m_lastT = curT;
-uint ParticleSystem::systemSync(ParticleType* p)
+qint64 ParticleSystem::systemSync(ParticleType* p)
{
if (!m_running)
return 0;
{
if (!m_running)
return 0;
#define PARTICLESYSTEM_H
#include <QSGItem>
#define PARTICLESYSTEM_H
#include <QSGItem>
+#include <QElapsedTimer>
#include <QVector>
#include <QHash>
#include <QPointer>
#include <QVector>
#include <QHash>
#include <QPointer>
public://but only really for related class usage. Perhaps we should all be friends?
void emitParticle(ParticleData* p);
ParticleData* newDatum(int groupId);
public://but only really for related class usage. Perhaps we should all be friends?
void emitParticle(ParticleData* p);
ParticleData* newDatum(int groupId);
- uint systemSync(ParticleType* p);
- QTime m_timestamp;
+ qint64 systemSync(ParticleType* p);
+ QElapsedTimer m_timestamp;
QVector<ParticleData*> m_data;
QSet<ParticleData*> m_needsReset;
QHash<QString, int> m_groupIds;
QHash<int, GroupData*> m_groupData;//id, size, start
QVector<ParticleData*> m_data;
QSet<ParticleData*> m_needsReset;
QHash<QString, int> m_groupIds;
QHash<int, GroupData*> m_groupData;//id, size, start
bool m_initialized;
void registerParticleType(ParticleType* p);
bool m_initialized;
void registerParticleType(ParticleType* p);
QList<QPointer<ParticleAffector> > m_affectors;
QList<QPointer<ParticleType> > m_particles;
QList<QPointer<ParticleType> > m_syncList;
QList<QPointer<ParticleAffector> > m_affectors;
QList<QPointer<ParticleType> > m_particles;
QList<QPointer<ParticleType> > m_syncList;
int m_nextGroupId;
bool m_overwrite;
};
int m_nextGroupId;
bool m_overwrite;
};
if(m_node == 0)
return;
}
if(m_node == 0)
return;
}
- uint timeStamp = m_system->systemSync(this);
+ qint64 timeStamp = m_system->systemSync(this);
qreal time = timeStamp / 1000.;
qreal time = timeStamp / 1000.;
int m_particle_duration;
int m_last_particle;
int m_particle_duration;
int m_last_particle;
QList<SpriteState*> m_sprites;
SpriteEngine* m_spriteEngine;
QList<SpriteState*> m_sprites;
SpriteEngine* m_spriteEngine;