Merge branch 'master' of github.com:highfidelity/hifi into dejitter-hold-action

This commit is contained in:
Seth Alves 2015-12-17 11:08:05 -08:00
commit eb173815f5
2 changed files with 11 additions and 4 deletions

View file

@ -145,9 +145,14 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
localFileData = localFileString.toLocal8Bit();
}
connection->respond(HTTPConnection::StatusCode200, localFileData,
qPrintable(mimeDatabase.mimeTypeForFile(filePath).name()));
// if this is an shtml file just make the MIME type match HTML so browsers aren't confused
// 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;
}

View file

@ -595,18 +595,20 @@ void ParticleEffectEntityItem::integrateParticle(Particle& particle, float delta
void ParticleEffectEntityItem::stepSimulation(float deltaTime) {
// update particles between head and tail
int popCount = 0;
for (Particle& particle : _particles) {
particle.lifetime += deltaTime;
// if particle has died.
if (particle.lifetime >= _lifespan) {
// move head forward
_particles.pop_front();
popCount++;
} else {
// Otherwise update it
integrateParticle(particle, deltaTime);
}
}
_particles.erase(_particles.begin(), _particles.begin() + popCount);
// emit new particles, but only if we are emmitting
if (getIsEmitting() && _emitRate > 0.0f && _lifespan > 0.0f && _polarStart <= _polarFinish) {