From 1077e04e08c4342231970a19641c480e47f701b5 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Fri, 11 Aug 2017 04:43:10 +0500 Subject: [PATCH] Renderers: sincosf asm replaced by std sinf and cosf calls. From commit: https://github.com/Im-dex/xray-162/commit/3e2e868c3f396086abfca20c0a942f8b55480d8f --- src/Layers/xrRender/ParticleEffect.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/Layers/xrRender/ParticleEffect.cpp b/src/Layers/xrRender/ParticleEffect.cpp index 811a40535c9..31227869214 100644 --- a/src/Layers/xrRender/ParticleEffect.cpp +++ b/src/Layers/xrRender/ParticleEffect.cpp @@ -287,14 +287,8 @@ IC void FillSprite_fpu(FVF::LIT*& pv, const Fvector& T, const Fvector& R, const __forceinline void fsincos(const float angle, float& sine, float& cosine) { - __asm { - fld DWORD PTR [angle] - fsincos - mov eax , DWORD PTR [cosine] - fstp DWORD PTR [eax] - mov eax , DWORD PTR [sine] - fstp DWORD PTR [eax] - } + sine = std::sinf(angle); + cosine = std::cosf(angle); } IC void FillSprite(FVF::LIT*& pv, const Fvector& T, const Fvector& R, const Fvector& pos, const Fvector2& lt, @@ -472,12 +466,8 @@ void ParticleRenderStream(LPVOID lpvParams) if (angle != *((DWORD*)&m.rot.x)) { angle = *((DWORD*)&m.rot.x); - __asm { - fld DWORD PTR [angle] - fsincos - fstp DWORD PTR [cosa] - fstp DWORD PTR [sina] - } + sina = std::sinf(angle); + cosa = std::cosf(angle); } _mm_prefetch(64 + (char*)&particles[i + 1], _MM_HINT_NTA);