Fixed compiler warnings and some minor coding style issues.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7365 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-01-11 21:11:22 +00:00
parent 225116fb6f
commit 35cf3c7eab

View File

@ -1637,13 +1637,14 @@ void Kart::updateGraphics(const Vec3& offset_xyz,
{
// fabs(speed) is important, otherwise the negative number will
// become a huge unsigned number in the particle scene node!
const float minRate = m_nitro->getParticlesInfo()->getMinRate();
const float maxRate = m_nitro->getParticlesInfo()->getMaxRate();
const float min_rate = (float)(m_nitro->getParticlesInfo()->getMinRate());
const float max_rate = (float)(m_nitro->getParticlesInfo()->getMaxRate());
const float rate = fabsf(getSpeed())/m_kart_properties->getMaxSpeed();
assert(rate >= 0.0f); // allow for rounding errors...
//assert(rate <= 2.0f); // max speed is not always respected it seems...
m_nitro->setCreationRate(m_controls.m_nitro && isOnGround() && m_collected_energy>0
? (minRate + rate*(maxRate - minRate)) : 0);
m_nitro->setCreationRate(m_controls.m_nitro && isOnGround() &&
m_collected_energy>0
? (min_rate + rate*(max_rate - min_rate)) : 0);
}
// For testing purposes mis-use the nitro graphical effects to show