correctly (using divide, floor, and multiply), since doing it the lazy
way (cast to int, use modulus operator) breaks down after a certain
amount of time in the level
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11163
d7cf8633-e32d-0410-b094-
e92efae38249
::stable-branch::merge=
6bb2c4cecb8a4e633fc0faf90c939fc180f7163b
}
}
+// LordHavoc: this has to be done right or you get severe precision breakdown
+int LoopingFrameNumberFromDouble(double t, int loopframes)
+{
+ if (loopframes)
+ return (int)(t - floor(t/loopframes)*loopframes);
+ else
+ return (int)t;
+}
+
void BoxFromPoints(vec3_t mins, vec3_t maxs, int numpoints, vec_t *point3f);
+int LoopingFrameNumberFromDouble(double t, int loopframes);
+
#endif