mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:01:06 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into dejitter-hold-action
This commit is contained in:
commit
eb173815f5
2 changed files with 11 additions and 4 deletions
|
@ -145,9 +145,14 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
|
||||||
|
|
||||||
localFileData = localFileString.toLocal8Bit();
|
localFileData = localFileString.toLocal8Bit();
|
||||||
}
|
}
|
||||||
|
|
||||||
connection->respond(HTTPConnection::StatusCode200, localFileData,
|
// if this is an shtml file just make the MIME type match HTML so browsers aren't confused
|
||||||
qPrintable(mimeDatabase.mimeTypeForFile(filePath).name()));
|
// otherwise use the mimeDatabase to look it up
|
||||||
|
auto mimeType = localFileInfo.suffix() == "shtml"
|
||||||
|
? QString { "text/html" }
|
||||||
|
: mimeDatabase.mimeTypeForFile(filePath).name();
|
||||||
|
|
||||||
|
connection->respond(HTTPConnection::StatusCode200, localFileData, qPrintable(mimeType));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -595,18 +595,20 @@ void ParticleEffectEntityItem::integrateParticle(Particle& particle, float delta
|
||||||
|
|
||||||
void ParticleEffectEntityItem::stepSimulation(float deltaTime) {
|
void ParticleEffectEntityItem::stepSimulation(float deltaTime) {
|
||||||
// update particles between head and tail
|
// update particles between head and tail
|
||||||
|
int popCount = 0;
|
||||||
for (Particle& particle : _particles) {
|
for (Particle& particle : _particles) {
|
||||||
particle.lifetime += deltaTime;
|
particle.lifetime += deltaTime;
|
||||||
|
|
||||||
// if particle has died.
|
// if particle has died.
|
||||||
if (particle.lifetime >= _lifespan) {
|
if (particle.lifetime >= _lifespan) {
|
||||||
// move head forward
|
// move head forward
|
||||||
_particles.pop_front();
|
popCount++;
|
||||||
} else {
|
} else {
|
||||||
// Otherwise update it
|
// Otherwise update it
|
||||||
integrateParticle(particle, deltaTime);
|
integrateParticle(particle, deltaTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_particles.erase(_particles.begin(), _particles.begin() + popCount);
|
||||||
|
|
||||||
// emit new particles, but only if we are emmitting
|
// emit new particles, but only if we are emmitting
|
||||||
if (getIsEmitting() && _emitRate > 0.0f && _lifespan > 0.0f && _polarStart <= _polarFinish) {
|
if (getIsEmitting() && _emitRate > 0.0f && _lifespan > 0.0f && _polarStart <= _polarFinish) {
|
||||||
|
|
Loading…
Reference in a new issue