summaryrefslogtreecommitdiffstats
path: root/Smoke/funcs.c
diff options
context:
space:
mode:
authorWilrik de Loose <wilrik@wilrik.nl>2007-12-14 08:35:25 (GMT)
committerWilrik de Loose <wilrik@wilrik.nl>2007-12-14 08:35:25 (GMT)
commit5601182e9456b3d4d782f135c8b151f5d9b021cd (patch)
treefe9e06a8a0f572dad622e8887732796a725887fe /Smoke/funcs.c
parent2b49eb5eb684537c19d9f0eabdffad0ffcf196ac (diff)
download2iv35-5601182e9456b3d4d782f135c8b151f5d9b021cd.zip
2iv35-5601182e9456b3d4d782f135c8b151f5d9b021cd.tar.gz
2iv35-5601182e9456b3d4d782f135c8b151f5d9b021cd.tar.bz2
glyphs apart in een file gestopt
Diffstat (limited to 'Smoke/funcs.c')
-rw-r--r--Smoke/funcs.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/Smoke/funcs.c b/Smoke/funcs.c
new file mode 100644
index 0000000..eb8cc2d
--- /dev/null
+++ b/Smoke/funcs.c
@@ -0,0 +1,29 @@
+// Includes
+
+#ifdef G_OS_WIN32
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#include "funcs.h"
+
+float square_root(float number)
+{
+ long i;
+ float x, y;
+ const float f = 1.5f;
+
+ x = number * 0.5f;
+ y = number;
+ i = * ( long * ) &y;
+ i = 0x5f3759df - ( i >> 1 );
+ y = * ( float * ) &i;
+ y = y * ( f - ( x * y * y ) );
+ y = y * ( f - ( x * y * y ) );
+ return number * y;
+}
+
+float vec_len(float x, float y)
+{
+ return (square_root((x * x) + (y * y)));
+} \ No newline at end of file