Skip to content

Commit 1077e04

Browse files
committed
Renderers: sincosf asm replaced by std sinf and cosf calls.
From commit: Im-dex/xray-162@3e2e868
1 parent 7912112 commit 1077e04

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/Layers/xrRender/ParticleEffect.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,8 @@ IC void FillSprite_fpu(FVF::LIT*& pv, const Fvector& T, const Fvector& R, const
287287

288288
__forceinline void fsincos(const float angle, float& sine, float& cosine)
289289
{
290-
__asm {
291-
fld DWORD PTR [angle]
292-
fsincos
293-
mov eax , DWORD PTR [cosine]
294-
fstp DWORD PTR [eax]
295-
mov eax , DWORD PTR [sine]
296-
fstp DWORD PTR [eax]
297-
}
290+
sine = std::sinf(angle);
291+
cosine = std::cosf(angle);
298292
}
299293

300294
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)
472466
if (angle != *((DWORD*)&m.rot.x))
473467
{
474468
angle = *((DWORD*)&m.rot.x);
475-
__asm {
476-
fld DWORD PTR [angle]
477-
fsincos
478-
fstp DWORD PTR [cosa]
479-
fstp DWORD PTR [sina]
480-
}
469+
sina = std::sinf(angle);
470+
cosa = std::cosf(angle);
481471
}
482472

483473
_mm_prefetch(64 + (char*)&particles[i + 1], _MM_HINT_NTA);

0 commit comments

Comments
 (0)