diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 90c00f50..6d07b62a 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -1260,10 +1260,7 @@ bool CEngine::TrackTextureMapping(int objRank, const Material& mat, int state, std::vector& vs = triangles->vertices; while (pos < 0.0f) - pos += 1000000.0f; // never negative! - - // TODO: might still be buggy as track animation seems to be choppy - // but the code should work exactly as in original + pos += 1.0f; // never negative! Math::Vector current; @@ -1310,12 +1307,14 @@ bool CEngine::TrackTextureMapping(int objRank, const Material& mat, int state, float pps = ps + pos; float ppe = pe + pos; - float offset = static_cast( static_cast(pps) ); + int offset = static_cast(pps); ppe -= offset; + pps -= offset; for (int i = 0; i < 3; i++) { - vs[tBase + is[i]].texCoord.x = ((ppe * tl) + ts) / tt; + vs[tBase + is[i]].texCoord.x = ((pps * tl) + ts) / tt; + vs[tBase + ie[i]].texCoord.x = ((ppe * tl) + ts) / tt; } } diff --git a/src/graphics/engine/particle.cpp b/src/graphics/engine/particle.cpp index acc40df0..388c189f 100644 --- a/src/graphics/engine/particle.cpp +++ b/src/graphics/engine/particle.cpp @@ -3214,7 +3214,7 @@ void CParticle::DrawParticleSphere(int i) angle.z = m_particle[i].angle*0.7f; Math::Matrix rot; Math::LoadRotationZXYMatrix(rot, angle); - mat = Math::MultiplyMatrices(rot, mat); + mat = Math::MultiplyMatrices(mat, rot); } m_device->SetTransform(TRANSFORM_WORLD, mat);