summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-10-19 22:43:18 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-10-19 22:43:18 +0200
commitbe4654c63b80862352961160446155238eee3ef5 (patch)
tree4e24b18d72214646c5e95b28b183eb5dd06e6186 /src
parenta90cd304ba4310833f239cd0d1528c3700ecbe99 (diff)
downloadcolobot-be4654c63b80862352961160446155238eee3ef5.tar.gz
colobot-be4654c63b80862352961160446155238eee3ef5.tar.bz2
colobot-be4654c63b80862352961160446155238eee3ef5.zip
Fix track mapping and sphere particle position
Diffstat (limited to 'src')
-rw-r--r--src/graphics/engine/engine.cpp11
-rw-r--r--src/graphics/engine/particle.cpp2
2 files changed, 6 insertions, 7 deletions
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 90c00f5..6d07b62 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<Gfx::VertexTex2>& 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<float>( static_cast<int>(pps) );
+ int offset = static_cast<int>(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 acc40df..388c189 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);