Skip to content

Commit

Permalink
Use explicit type instead of void*
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed May 20, 2018
1 parent 611b60e commit 015bfac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/Layers/xrRender/ParticleEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ __forceinline void magnitude_sse(Fvector& vec, float& res)
_mm_store_ss((float*)&res, tv);
}

void ParticleRenderStream(void* lpvParams)
void ParticleRenderStream(PRS_PARAMS* pParams)
{
#ifdef _GPA_ENABLED
TAL_SCOPED_TASK_NAMED("ParticleRenderStream()");
Expand All @@ -442,8 +442,6 @@ void ParticleRenderStream(void* lpvParams)
// But it must be 0xFFFFFFFF or otherwise some particles won't play
float angle = 0xFFFFFFFF;

PRS_PARAMS* pParams = (PRS_PARAMS*)lpvParams;

FVF::LIT* pv = pParams->pv;
u32 p_from = pParams->p_from;
u32 p_to = pParams->p_to;
Expand Down Expand Up @@ -606,7 +604,7 @@ void CParticleEffect::Render(float)
prsParams[i].p_to = (i == (nWorkers - 1)) ? p_cnt : (prsParams[i].p_from + nStep);
prsParams[i].particles = particles;
prsParams[i].pPE = this;
ttapi.threads[i]->addJob([=] { ParticleRenderStream((void*)&prsParams[i]); });
ttapi.threads[i]->addJob([=] { ParticleRenderStream(&prsParams[i]); });
}

ttapi.wait();
Expand Down
6 changes: 2 additions & 4 deletions src/xrParticles/particle_actions_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ struct TES_PARAMS
float magnitude;
};

void PATurbulenceExecuteStream(LPVOID lpvParams)
void PATurbulenceExecuteStream(TES_PARAMS* pParams)
{
#ifdef _GPA_ENABLED
TAL_SCOPED_TASK_NAMED("PATurbulenceExecuteStream()");
Expand All @@ -1671,8 +1671,6 @@ void PATurbulenceExecuteStream(LPVOID lpvParams)
pVector vY;
pVector vZ;

TES_PARAMS* pParams = (TES_PARAMS*)lpvParams;

u32 p_from = pParams->p_from;
u32 p_to = pParams->p_to;
ParticleEffect* effect = pParams->effect;
Expand Down Expand Up @@ -1781,7 +1779,7 @@ void PATurbulence::Execute(ParticleEffect* effect, const float dt, float& tm_max
tesParams[i].frequency = frequency;
tesParams[i].octaves = octaves;
tesParams[i].magnitude = magnitude;
ttapi.threads[i]->addJob([=] { PATurbulenceExecuteStream((void*)&tesParams[i]); });
ttapi.threads[i]->addJob([=] { PATurbulenceExecuteStream(&tesParams[i]); });
}

ttapi.wait();
Expand Down

0 comments on commit 015bfac

Please sign in to comment.