From a98c2cece9b0ad1728ddcfd6de62b630b9f940ce Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 19:34:31 +0000 Subject: [PATCH] Decompile 7 functions in Source/Contents/Effects/ParticlePool.cpp, Source/Contents/Effects/ParticlePool.h Batch #2836 by youko: 0 byte-identical, 7 confirmed by peer review. - fn_18849 ParticlePool::ParticlePool: logic confirmed by peer review - fn_18851 ParticlePool::~ParticlePool: logic confirmed by peer review - fn_18854 ParticlePool::Acquire: logic confirmed by peer review - fn_18856 ParticlePool::Release: logic confirmed by peer review - fn_18857 ParticlePool::IsActive: logic confirmed by peer review - fn_18858 ParticlePool::ActivateAll: logic confirmed by peer review - fn_18860 ParticlePool::Add: logic confirmed by peer review Peer-reviewed-by: willerthal, superintelligence Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Effects/ParticlePool.cpp | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/Source/Contents/Effects/ParticlePool.cpp b/Source/Contents/Effects/ParticlePool.cpp index c98b17a1..a49c4576 100644 --- a/Source/Contents/Effects/ParticlePool.cpp +++ b/Source/Contents/Effects/ParticlePool.cpp @@ -1,10 +1,43 @@ #include "Contents/Effects/ParticlePool.h" // OFFSET: 0x00B402F0 +// FUNCTION: fn_18849 +ParticlePool::ParticlePool() { + for (auto& entry : this->particles) { + entry.second = false; + } + this->active = 0; +} // OFFSET: 0x00B40560 +// FUNCTION: fn_18851 +ParticlePool::~ParticlePool() { + this->Clear(); +} // OFFSET: 0x00B40740 +// FUNCTION: fn_18854 +CParticle* ParticlePool::Acquire() { + if (this->particles.size() <= this->active) { + return nullptr; + } + + CParticle* particle = nullptr; + auto it = this->particles.begin(); + for (; it != this->particles.end(); ++it) { + if (!it->second) { + break; + } + } + + if (it != this->particles.end()) { + particle = it->first; + it->second = true; + ++this->active; + } + + return particle; +} // OFFSET: 0x00B407A0 // FUNCTION: fn_18855 @@ -14,9 +47,37 @@ void ParticlePool::Clear() { } // OFFSET: 0x00B407F0 +// FUNCTION: fn_18856 +void ParticlePool::Release(CParticle* particle) { + if (this->particles.find(particle) != this->particles.end() && this->particles[particle]) { + --this->active; + this->particles[particle] = false; + } +} // OFFSET: 0x00B40890 +// FUNCTION: fn_18857 +bool ParticlePool::IsActive(CParticle* particle) { + if (this->particles.find(particle) != this->particles.end()) { + return this->particles[particle]; + } + + return false; +} // OFFSET: 0x00B408E0 +// FUNCTION: fn_18858 +void ParticlePool::ActivateAll() { + for (auto& entry : this->particles) { + entry.second = true; + } + this->active = this->particles.size(); +} // OFFSET: 0x00B40B20 +// FUNCTION: fn_18860 +void ParticlePool::Add(CParticle* particle) { + if (this->particles.find(particle) == this->particles.end()) { + this->particles[particle] = false; + } +}