summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mikos <david@FAMILYCOMPUTER.(none)>2008-02-25 17:34:07 +1030
committerDavid Mikos <david@FAMILYCOMPUTER.(none)>2008-02-25 17:34:07 +1030
commitc90f7041b052f594db0dc4e02753a1a85c28a1a3 (patch)
treeabbe767e76dc94b415a236a359a135fd61f14aca
parent52c1f39688c3f86b36d4893bbd30a4c47cd0082d (diff)
downloadcubedbus-c90f7041b052f594db0dc4e02753a1a85c28a1a3.tar.gz
cubedbus-c90f7041b052f594db0dc4e02753a1a85c28a1a3.tar.bz2
Possibly avoid crash for animation at large times + allow negative fps.HEADmaster
-rw-r--r--cubedbusModel.c.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/cubedbusModel.c.in b/cubedbusModel.c.in
index 83b13e5..acb217e 100644
--- a/cubedbusModel.c.in
+++ b/cubedbusModel.c.in
@@ -1216,6 +1216,9 @@ cubedbusDrawModelObject (CubedbusObject *obj)
{
float t = fmodf(data->fps*timeSec, (float) data->fileCounter);
+ if (t<0)
+ t+= (float) data->fileCounter;
+
int ti = (int) t;
int ti2= (ti+1)%(data->fileCounter);
float dt = t-ti;