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
}
}
+// 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