Skip to content

Commit 412f67f

Browse files
committed
Fix particles speed (Thanks @qweasdd)
Removed unused function minor code changes
1 parent 65a779b commit 412f67f

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/Layers/xrRender/ParticleEffect.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,6 @@ IC void FillSprite_fpu(FVF::LIT*& pv, const Fvector& T, const Fvector& R, const
285285
pv++;
286286
}
287287

288-
__forceinline void fsincos(const float angle, float& sine, float& cosine)
289-
{
290-
sine = std::sinf(angle);
291-
cosine = std::cosf(angle);
292-
}
293-
294288
IC void FillSprite(FVF::LIT*& pv, const Fvector& T, const Fvector& R, const Fvector& pos, const Fvector2& lt,
295289
const Fvector2& rb, float r1, float r2, u32 clr, float sina, float cosa)
296290
{
@@ -466,8 +460,8 @@ void ParticleRenderStream(void* lpvParams)
466460
if (angle != *((DWORD*)&m.rot.x))
467461
{
468462
angle = *((DWORD*)&m.rot.x);
469-
sina = std::sinf(angle);
470-
cosa = std::cosf(angle);
463+
sina = std::sinf(*(float*)&angle);
464+
cosa = std::cosf(*(float*)&angle);
471465
}
472466

473467
_mm_prefetch(64 + (char*)&particles[i + 1], _MM_HINT_NTA);
@@ -477,13 +471,13 @@ void ParticleRenderStream(void* lpvParams)
477471

478472
float r_x = m.size.x * 0.5f;
479473
float r_y = m.size.y * 0.5f;
480-
float speed;
481-
BOOL speed_calculated = FALSE;
474+
float speed = 0.f;
475+
bool speed_calculated = false;
482476

483477
if (pPE.m_Def->m_Flags.is(CPEDef::dfVelocityScale))
484478
{
485479
magnitude_sse(m.vel, speed);
486-
speed_calculated = TRUE;
480+
speed_calculated = true;
487481
r_x += speed * pPE.m_Def->m_VelocityScale.x;
488482
r_y += speed * pPE.m_Def->m_VelocityScale.y;
489483
}

0 commit comments

Comments
 (0)