From 45db0a3290545e4e1b5fd67d7b06f2233ad0d5dc Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 19 Jul 2011 00:47:25 +0000 Subject: [PATCH] - try to see if this helps with the tween bug --- .../sources/graphics/gl/particle_renderer_gl.cpp | 6 +++++- source/shared_lib/sources/graphics/interpolation.cpp | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/source/shared_lib/sources/graphics/gl/particle_renderer_gl.cpp b/source/shared_lib/sources/graphics/gl/particle_renderer_gl.cpp index 06ee62b64..4af334034 100644 --- a/source/shared_lib/sources/graphics/gl/particle_renderer_gl.cpp +++ b/source/shared_lib/sources/graphics/gl/particle_renderer_gl.cpp @@ -263,7 +263,11 @@ void ParticleRendererGl::renderModel(GameParticleSystem *ps, ModelRenderer *mr){ //render mr->begin(true, true, false); float t = ps->getTween(); - assert(t >= 0.0f && t <= 1.0f); + + if(t < 0.0f || t > 1.0f) { + printf("ERROR setting tween to [%f]\n",t); + assert(t >= 0.0f && t <= 1.0f); + } model->updateInterpolationData(t, false); mr->render(model); mr->end(); diff --git a/source/shared_lib/sources/graphics/interpolation.cpp b/source/shared_lib/sources/graphics/interpolation.cpp index 5d980f176..a8075928a 100644 --- a/source/shared_lib/sources/graphics/interpolation.cpp +++ b/source/shared_lib/sources/graphics/interpolation.cpp @@ -80,8 +80,9 @@ void InterpolationData::updateVertices(float t, bool cycle) { //assert(t>=0.0f && t<=1.0f); if(t < 0.0f || t > 1.0f) { throw runtime_error("t < 0.0f || t > 1.0f t = [" + floatToStr(t) + "]"); + + assert(t >= 0.f && t <= 1.f); } - assert(t >= 0.f && t <= 1.f); uint32 frameCount= mesh->getFrameCount(); uint32 vertexCount= mesh->getVertexCount(); @@ -137,7 +138,11 @@ void InterpolationData::updateVertices(float t, bool cycle) { } void InterpolationData::updateNormals(float t, bool cycle){ - assert(t>=0.0f && t<=1.0f); + if(t < 0.0f || t > 1.0f) { + throw runtime_error("t < 0.0f || t > 1.0f t = [" + floatToStr(t) + "]"); + + assert(t>=0.0f && t<=1.0f); + } uint32 frameCount= mesh->getFrameCount(); uint32 vertexCount= mesh->getVertexCount();