From eefa69b53dba28d760061301df72bfe6163b0daa Mon Sep 17 00:00:00 2001 From: doop <56421834+dooplecks@users.noreply.github.com> Date: Fri, 5 Jun 2026 02:05:20 -0400 Subject: [PATCH] Re-enable JParticle interpolation and fix emitter direction issue (#1968) * Re-enable JParticle interpolation * Ensure emitter direction is valid for JPA interp Fixes #618. * Don't `calcWorkData` if we don't need to --- libs/JSystem/src/JParticle/JPAParticle.cpp | 3 +-- libs/JSystem/src/JParticle/JPAResource.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/JSystem/src/JParticle/JPAParticle.cpp b/libs/JSystem/src/JParticle/JPAParticle.cpp index d3490ab294..eb2395e346 100644 --- a/libs/JSystem/src/JParticle/JPAParticle.cpp +++ b/libs/JSystem/src/JParticle/JPAParticle.cpp @@ -206,8 +206,7 @@ void JPABaseParticle::init_c(JPAEmitterWorkData* work, JPABaseParticle* parent) #if TARGET_PC void JPABaseParticle::interp(JPAEmitterWorkData* work, void const* drawFunc) { - static bool enable = false; - if (!enable) + if (!dusk::frame_interp::is_enabled()) return; // don't interpolate the first frame diff --git a/libs/JSystem/src/JParticle/JPAResource.cpp b/libs/JSystem/src/JParticle/JPAResource.cpp index 2ae4709fc3..59e679d449 100644 --- a/libs/JSystem/src/JParticle/JPAResource.cpp +++ b/libs/JSystem/src/JParticle/JPAResource.cpp @@ -761,6 +761,15 @@ bool JPAResource::calc(JPAEmitterWorkData* work, JPABaseEmitter* emtr) { } } +#ifdef TARGET_PC + if (((pBsp && pBsp->getDirType() == 3) || (pCsp && pCsp->getDirType() == 3)) && + dusk::frame_interp::is_enabled()) + { + // ensure mGlobalEmtrDir is valid + calcWorkData_d(work); + } +#endif + JPANode* next = NULL; for (JPANode* node = emtr->mAlivePtclBase.getFirst(); node != emtr->mAlivePtclBase.getEnd(); node = next) { next = node->getNext();