Mercurial > mm7
comparison VectorTypes.cpp @ 2152:d44b7775fc06
Removed DirectDraw2 compatibility.
3D Sound enabled (change 3DSoundProvider registry entry to activate it).
Moved all forward declarations to mm7_unsorted_subs.h (many cpp files do not need them anyweay).
author | Nomad |
---|---|
date | Thu, 09 Jan 2014 01:37:34 +0200 |
parents | 7a9477135943 |
children | aff7a7b072b7 |
comparison
equal
deleted
inserted
replaced
2151:92511cd8fcdb | 2152:d44b7775fc06 |
---|---|
52 | 52 |
53 //----- (0043AB61) -------------------------------------------------------- | 53 //----- (0043AB61) -------------------------------------------------------- |
54 template <class T> | 54 template <class T> |
55 void Vec3<T>::Normalize(T *x, T *y, T *z) | 55 void Vec3<T>::Normalize(T *x, T *y, T *z) |
56 { | 56 { |
57 extern int integer_sqrt(int val); | |
57 *x *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1); | 58 *x *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1); |
58 *y *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1); | 59 *y *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1); |
59 *z *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1); | 60 *z *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1); |
60 } | 61 } |
61 | 62 |