mirror of https://github.com/axmolengine/axmol.git
Cleanup and add performance logs.
Somehow not using const reference takes 30 fps away 😕
This commit is contained in:
parent
2836420fb3
commit
61b3de52a3
|
@ -2357,6 +2357,9 @@ void ParticleEmissionMaskCache::bakeEmissionMask(std::string_view maskName,
|
||||||
desc.points = std::move(points);
|
desc.points = std::move(points);
|
||||||
|
|
||||||
iter->second = desc;
|
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)
|
const ParticleEmissionMaskDescriptor& ParticleEmissionMaskCache::getEmissionMask(std::string_view maskName)
|
||||||
|
@ -2364,7 +2367,7 @@ const ParticleEmissionMaskDescriptor& ParticleEmissionMaskCache::getEmissionMask
|
||||||
auto iter = this->masks.find(maskName);
|
auto iter = this->masks.find(maskName);
|
||||||
if (iter == this->masks.end())
|
if (iter == this->masks.end())
|
||||||
{
|
{
|
||||||
ParticleEmissionMaskDescriptor desc;
|
ParticleEmissionMaskDescriptor desc{};
|
||||||
desc.size = {float(1), float(1)};
|
desc.size = {float(1), float(1)};
|
||||||
desc.points = {{0, 0}};
|
desc.points = {{0, 0}};
|
||||||
return desc;
|
return desc;
|
||||||
|
|
Loading…
Reference in New Issue