Skip to content

Commit

Permalink
Fix particles speed (Thanks @qweasdd)
Browse files Browse the repository at this point in the history
Removed unused function
minor code changes
  • Loading branch information
Xottab-DUTY committed Apr 25, 2018
1 parent 65a779b commit 412f67f
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/Layers/xrRender/ParticleEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,6 @@ IC void FillSprite_fpu(FVF::LIT*& pv, const Fvector& T, const Fvector& R, const
pv++;
}

__forceinline void fsincos(const float angle, float& sine, float& cosine)
{
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,
const Fvector2& rb, float r1, float r2, u32 clr, float sina, float cosa)
{
Expand Down Expand Up @@ -466,8 +460,8 @@ void ParticleRenderStream(void* lpvParams)
if (angle != *((DWORD*)&m.rot.x))
{
angle = *((DWORD*)&m.rot.x);
sina = std::sinf(angle);
cosa = std::cosf(angle);
sina = std::sinf(*(float*)&angle);
cosa = std::cosf(*(float*)&angle);
}

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

float r_x = m.size.x * 0.5f;
float r_y = m.size.y * 0.5f;
float speed;
BOOL speed_calculated = FALSE;
float speed = 0.f;

This comment has been minimized.

Copy link
@SkyLoaderr

SkyLoaderr Apr 25, 2018

Contributor

Не смущает установка скорости в ноль? Далее же домножение идет на эту скорость

This comment has been minimized.

Copy link
@Xottab-DUTY

Xottab-DUTY Apr 25, 2018

Author Member

Это я так, на всякий случай 0 поставил, потом в magnitude_sse(m.vel, speed); устанавливается значение.

bool speed_calculated = false;

if (pPE.m_Def->m_Flags.is(CPEDef::dfVelocityScale))
{
magnitude_sse(m.vel, speed);
speed_calculated = TRUE;
speed_calculated = true;
r_x += speed * pPE.m_Def->m_VelocityScale.x;
r_y += speed * pPE.m_Def->m_VelocityScale.y;
}
Expand Down

0 comments on commit 412f67f

Please sign in to comment.