mirror of https://github.com/axmolengine/axmol.git
rename push_back vs emplace_back (fine tuning and remove on Live2D (too much))
This commit is contained in:
parent
28dd328eda
commit
8b408b2cde
|
@ -2314,18 +2314,18 @@ void ParticleEmissionMaskCache::bakeEmissionMask(std::string_view maskId,
|
|||
float a = data[(y * w + x) * 4 + 3] / 255.0F;
|
||||
if (a >= alphaThreshold && !inverted)
|
||||
for (float i = 0; i < 1.0F; i += 1.0F / inbetweenSamples)
|
||||
points.push_back({float(x + i), float(h - y + i)});
|
||||
points.emplace_back(Vec2{float(x + i), float(h - y + i)});
|
||||
if (a < alphaThreshold && inverted)
|
||||
for (float i = 0; i < 1.0F; i += 1.0F / inbetweenSamples)
|
||||
points.push_back({float(x + i), float(h - y + i)});
|
||||
points.emplace_back(Vec2{float(x + i), float(h - y + i)});
|
||||
}
|
||||
else
|
||||
{
|
||||
float a = data[(y * w + x) * 4 + 3] / 255.0F;
|
||||
if (a >= alphaThreshold && !inverted)
|
||||
points.push_back({float(x), float(h - y)});
|
||||
points.emplace_back(Vec2{float(x), float(h - y)});
|
||||
if (a < alphaThreshold && inverted)
|
||||
points.push_back({float(x), float(h - y)});
|
||||
points.emplace_back(Vec2{float(x), float(h - y)});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ void* CubismFramework::Allocate(csmSizeType size, const csmChar* fileName, csmIn
|
|||
|
||||
if (s_allocationList)
|
||||
{
|
||||
s_allocationList->emplace_back(address);
|
||||
s_allocationList->push_back(address);
|
||||
}
|
||||
|
||||
return address;
|
||||
|
@ -242,7 +242,7 @@ void* CubismFramework::AllocateAligned(csmSizeType size, csmUint32 alignment, co
|
|||
|
||||
if (s_allocationList)
|
||||
{
|
||||
s_allocationList->emplace_back(address);
|
||||
s_allocationList->push_back(address);
|
||||
}
|
||||
|
||||
return address;
|
||||
|
|
|
@ -581,7 +581,7 @@ int lua_cocos2dx_DrawNode3D_drawCube(lua_State* L)
|
|||
}
|
||||
#endif
|
||||
// arg0[i] = vec3;
|
||||
arg0.push_back(vec3);
|
||||
arg0.emplace_back(vec3);
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue