]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mathlib.h
theora encoding: allow both bitrate and quality to be -1 for insane quality
[xonotic/darkplaces.git] / mathlib.h
index d8a902d4508746c93efdd6bab94cab85f83af8f8..e1c7f647d8eb17f90d1fd9065fc9c48dd432071e 100644 (file)
--- a/mathlib.h
+++ b/mathlib.h
@@ -175,6 +175,10 @@ int PointInfrontOfTriangle(const float *p, const float *a, const float *b, const
 }
 #endif
 
+#define lhcheeserand() (seed = (seed * 987211u) ^ (seed >> 13u) ^ 914867)
+#define lhcheeserandom(MIN,MAX) ((double)(lhcheeserand() + 0.5) / ((double)4096.0*1024.0*1024.0) * ((MAX)-(MIN)) + (MIN))
+#define VectorCheeseRandom(v) do{(v)[0] = lhcheeserandom(-1, 1);(v)[1] = lhcheeserandom(-1, 1);(v)[2] = lhcheeserandom(-1, 1);}while(DotProduct(v, v) > 1)
+
 /*
 // LordHavoc: quaternion math, untested, don't know if these are correct,
 // need to add conversion to/from matrices
@@ -287,5 +291,7 @@ int Math_atov(const char *s, vec3_t out);
 
 void BoxFromPoints(vec3_t mins, vec3_t maxs, int numpoints, vec_t *point3f);
 
+int LoopingFrameNumberFromDouble(double t, int loopframes);
+
 #endif