From fd1e5f893ad269533eb6d7b3e37d5755645d4b32 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 21 Sep 2013 00:32:17 +0000 Subject: [PATCH] try to use double instead of float for timed unit particles --- source/glest_game/type_instances/unit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 7cad716b..84bbda08 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -2462,7 +2462,7 @@ void Unit::updateTimedParticles() { for(int i = queuedUnitParticleSystemTypes.size() - 1; i >= 0; i--) { UnitParticleSystemType *pst = queuedUnitParticleSystemTypes[i]; if(pst != NULL) { - if(truncateDecimal(pst->getStartTime()) <= truncateDecimal(getAnimProgressAsFloat())) { + if(truncateDecimal(pst->getStartTime()) <= truncateDecimal(getAnimProgressAsFloat())) { //printf("STARTING queued particle system type [%s] [%f] [%f] [%f] [%f]\n",pst->getType().c_str(),truncateDecimal(pst->getStartTime()),truncateDecimal(pst->getEndTime()),truncateDecimal(animProgress),truncateDecimal(lastAnimProgress)); UnitParticleSystem *ups = new UnitParticleSystem(200); @@ -2489,12 +2489,12 @@ void Unit::updateTimedParticles() { UnitParticleSystem *ps = unitParticleSystems[i]; if(ps != NULL) { if(Renderer::getInstance().validateParticleSystemStillExists(ps,rsGame) == true) { - float particleStartTime = truncateDecimal(ps->getStartTime()); - float particleEndTime = truncateDecimal(ps->getEndTime()); + double particleStartTime = truncateDecimal(ps->getStartTime()); + double particleEndTime = truncateDecimal(ps->getEndTime()); if(particleStartTime != 0.0 || particleEndTime != 1.0) { //printf("Checking for end particle system #%d [%d] [%f] [%f] [%f] [%f]\n",i,ps->shape,truncateDecimal(ps->getStartTime()),truncateDecimal(ps->getEndTime()),truncateDecimal(animProgress),truncateDecimal(lastAnimProgress)); - float animProgressTime = truncateDecimal(getAnimProgressAsFloat()); + double animProgressTime = truncateDecimal(getAnimProgressAsFloat()); if(animProgressTime >= 0.99 || animProgressTime >= particleEndTime) { //printf("ENDING particle system [%d]\n",ps->shape);