From 61b3de52a3f7c53c49e6d986f0831f3e76003fa2 Mon Sep 17 00:00:00 2001 From: DelinWorks Date: Sun, 12 Jun 2022 03:40:13 +0300 Subject: [PATCH] Cleanup and add performance logs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Somehow not using const reference takes 30 fps away 😕 --- core/2d/CCParticleSystem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/2d/CCParticleSystem.cpp b/core/2d/CCParticleSystem.cpp index 693ea1af90..0669bb5dec 100644 --- a/core/2d/CCParticleSystem.cpp +++ b/core/2d/CCParticleSystem.cpp @@ -2357,6 +2357,9 @@ void ParticleEmissionMaskCache::bakeEmissionMask(std::string_view maskName, desc.points = std::move(points); iter->second = desc; + + CCLOG("Particle emission mask '%s' baked (%dx%d), %d samples generated taking %.2fmb of memory.", + std::string(maskName).c_str(), w, h, desc.points.size(), desc.points.size() * 8 / 1e+6); } const ParticleEmissionMaskDescriptor& ParticleEmissionMaskCache::getEmissionMask(std::string_view maskName) @@ -2364,7 +2367,7 @@ const ParticleEmissionMaskDescriptor& ParticleEmissionMaskCache::getEmissionMask auto iter = this->masks.find(maskName); if (iter == this->masks.end()) { - ParticleEmissionMaskDescriptor desc; + ParticleEmissionMaskDescriptor desc{}; desc.size = {float(1), float(1)}; desc.points = {{0, 0}}; return desc;