From 4d4a7d49d5c238319741037ef5f3abd57b2b0b87 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 14 Apr 2018 02:45:48 +0300 Subject: [PATCH] mathlib.c port --- engine/common/mathlib.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/common/mathlib.c b/engine/common/mathlib.c index 84e02d95..0858767d 100644 --- a/engine/common/mathlib.c +++ b/engine/common/mathlib.c @@ -13,6 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ +#include #include "common.h" #include "mathlib.h" #include "eiface.h" @@ -308,6 +309,7 @@ SinCos */ void SinCos( float radians, float *sine, float *cosine ) { +#if _MSC_VER == 1200 _asm { fld dword ptr [radians] @@ -319,6 +321,10 @@ void SinCos( float radians, float *sine, float *cosine ) fstp dword ptr [edx] fstp dword ptr [eax] } +#else + *sine = sinf(radians); + *cosine = cosf(radians); +#endif } float VectorNormalizeLength2( const vec3_t v, vec3_t out ) @@ -735,4 +741,4 @@ void QuaternionSlerp( const vec4_t p, const vec4_t q, float t, vec4_t qt ) QuaternionAlign( p, q, q2 ); QuaternionSlerpNoAlign( p, q2, t, qt ); -} \ No newline at end of file +}