]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mathlib.h
default vid_netwmfullscreen to 0 again because it doesn't work with
[xonotic/darkplaces.git] / mathlib.h
index d8a902d4508746c93efdd6bab94cab85f83af8f8..b3a9f7ea3c319b80f01ab78d1c5b09e0eebeac7e 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