Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DedeHai committed Feb 3, 2025
1 parent a48d4dd commit b062e7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wled00/FXparticleSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2127,8 +2127,8 @@ void* particleMemoryManager(const uint32_t requestedParticles, size_t structSize
PSPRINTLN("PS transition ended, final particle handover");
uint32_t maxParticles = pmem->buffersize / structSize; // maximum number of particles that fit in the buffer
if (maxParticles > availableToPS) { // not all particles transferred yet
int32_t totransfer = maxParticles - availableToPS; // transfer all remaining particles
if(totransfer > 0) // safety check
uint32_t totransfer = maxParticles - availableToPS; // transfer all remaining particles
if(totransfer <= maxParticles) // safety check
particleHandover(buffer, structSize, totransfer);
if(maxParticles > numParticlesUsed) { // FX uses less than max: move the already existing particles to the beginning of the buffer
uint32_t usedbytes = availableToPS * structSize;
Expand Down Expand Up @@ -2184,7 +2184,7 @@ void particleHandover(void *buffer, size_t structSize, int32_t numToTransfer) {
}
uint16_t maxTTL = 0;
uint32_t TTLrandom = 0;
maxTTL = ((unsigned)strip.getTransition() << 1) / FRAMETIME_FIXED; // tie TTL to transition time: limit to double the transition time + some randomness
maxTTL = ((unsigned)strip.getTransition() << 1) / FRAMETIME_FIXED; // tie TTL to transition time: limit to double the transition time + some randomness
#ifndef WLED_DISABLE_PARTICLESYSTEM2D
if (structSize == sizeof(PSparticle)) { // 2D particle
PSparticle *particles = (PSparticle *)buffer;
Expand Down

0 comments on commit b062e7e

Please sign in to comment.