mirror of https://github.com/axmolengine/axmol.git
replace push_back() vs emplace_back() on extension (#785)
This commit is contained in:
parent
45d4d49266
commit
28dd328eda
|
@ -210,7 +210,7 @@ void Control::removeTargetWithActionForControlEvent(Ref* target, Handler action,
|
|||
// Remove the corresponding invocation object
|
||||
if (shouldBeRemoved)
|
||||
{
|
||||
tobeRemovedInvocations.push_back(invocation);
|
||||
tobeRemovedInvocations.emplace_back(invocation);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -713,7 +713,7 @@ bool ScrollView::onTouchBegan(Touch* touch, Event* /*event*/)
|
|||
|
||||
if (std::find(_touches.begin(), _touches.end(), touch) == _touches.end())
|
||||
{
|
||||
_touches.push_back(touch);
|
||||
_touches.emplace_back(touch);
|
||||
}
|
||||
|
||||
if (_touches.size() == 1)
|
||||
|
|
|
@ -228,7 +228,7 @@ void* CubismFramework::Allocate(csmSizeType size, const csmChar* fileName, csmIn
|
|||
|
||||
if (s_allocationList)
|
||||
{
|
||||
s_allocationList->push_back(address);
|
||||
s_allocationList->emplace_back(address);
|
||||
}
|
||||
|
||||
return address;
|
||||
|
@ -242,7 +242,7 @@ void* CubismFramework::AllocateAligned(csmSizeType size, csmUint32 alignment, co
|
|||
|
||||
if (s_allocationList)
|
||||
{
|
||||
s_allocationList->push_back(address);
|
||||
s_allocationList->emplace_back(address);
|
||||
}
|
||||
|
||||
return address;
|
||||
|
|
|
@ -314,7 +314,7 @@ void Particle3DModelRender::render(Renderer* renderer, const Mat4& transform, Pa
|
|||
}
|
||||
mesh->setTexture(_texFile);
|
||||
mesh->retain();
|
||||
_meshList.push_back(mesh);
|
||||
_meshList.emplace_back(mesh);
|
||||
}
|
||||
if (!_meshList.empty())
|
||||
{
|
||||
|
|
|
@ -120,7 +120,7 @@ void ParticleSystem3D::addAffector(Particle3DAffector* affector)
|
|||
{
|
||||
affector->_particleSystem = this;
|
||||
affector->retain();
|
||||
_affectors.push_back(affector);
|
||||
_affectors.emplace_back(affector);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
if (_locked.empty())
|
||||
return nullptr;
|
||||
T* p = _locked.front();
|
||||
//_released.push_back(p);
|
||||
//_released.emplace_back(p);
|
||||
//_locked.erase(_locked.begin());
|
||||
_released.splice(_released.end(), _locked, _locked.begin());
|
||||
return p;
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
|
||||
void lockLatestData()
|
||||
{
|
||||
_locked.push_back(*_releasedIter);
|
||||
_locked.emplace_back(*_releasedIter);
|
||||
_releasedIter = _released.erase(_releasedIter);
|
||||
if (_releasedIter != _released.begin() && _releasedIter != _released.end())
|
||||
{
|
||||
|
@ -135,7 +135,7 @@ public:
|
|||
const PoolList& getActiveDataList() const { return _released; };
|
||||
const PoolList& getUnActiveDataList() const { return _locked; };
|
||||
|
||||
void addData(T* data) { _locked.push_back(data); }
|
||||
void addData(T* data) { _locked.emplace_back(data); }
|
||||
|
||||
bool empty() const { return _released.empty(); };
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ void PUAffector::addEmitterToExclude(std::string_view emitterName)
|
|||
auto iter = std::find(_excludedEmitters.begin(), _excludedEmitters.end(), emitterName);
|
||||
if (iter == _excludedEmitters.end())
|
||||
{
|
||||
_excludedEmitters.push_back(std::string{emitterName});
|
||||
_excludedEmitters.emplace_back(std::string{emitterName});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ void PUBeamRender::particleExpired(PUParticleSystem3D* /*particleSystem*/, PUPar
|
|||
PUParticle3DBeamVisualData* beamRendererVisualData =
|
||||
static_cast<PUParticle3DBeamVisualData*>(particle->visualData);
|
||||
beamRendererVisualData->setVisible(false, 0); // PU 1.4
|
||||
_visualData.push_back(beamRendererVisualData);
|
||||
_visualData.emplace_back(beamRendererVisualData);
|
||||
particle->visualData = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -279,8 +279,8 @@ void PUBeamRender::prepare()
|
|||
visualData->half[numDev].setZero();
|
||||
visualData->destinationHalf[numDev].setZero();
|
||||
}
|
||||
_allVisualData.push_back(visualData); // Managed by this renderer
|
||||
_visualData.push_back(visualData); // Used to assign to a particle
|
||||
_allVisualData.emplace_back(visualData); // Managed by this renderer
|
||||
_visualData.emplace_back(visualData); // Used to assign to a particle
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ PUDynamicAttributeCurved::PUDynamicAttributeCurved(const PUDynamicAttributeCurve
|
|||
// Copy controlpoints
|
||||
for (const auto& controlPoint : dynamicAttributeCurved._controlPoints)
|
||||
{
|
||||
_controlPoints.push_back(controlPoint);
|
||||
_controlPoints.emplace_back(controlPoint);
|
||||
}
|
||||
processControlPoints();
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ float PUDynamicAttributeCurved::getValue(float x)
|
|||
//-----------------------------------------------------------------------
|
||||
void PUDynamicAttributeCurved::addControlPoint(float x, float y)
|
||||
{
|
||||
_controlPoints.push_back(Vec2(x, y));
|
||||
_controlPoints.emplace_back(Vec2(x, y));
|
||||
}
|
||||
//-----------------------------------------------------------------------
|
||||
const PUDynamicAttributeCurved::ControlPointList& PUDynamicAttributeCurved::getControlPoints() const
|
||||
|
@ -314,7 +314,7 @@ void PUDynamicAttributeCurved::copyAttributesTo(PUDynamicAttribute* dynamicAttri
|
|||
for (it = _controlPoints.begin(); it != itEnd; ++it)
|
||||
{
|
||||
Vec2 controlPoint = *it;
|
||||
dynAttr->_controlPoints.push_back(controlPoint);
|
||||
dynAttr->_controlPoints.emplace_back(controlPoint);
|
||||
}
|
||||
dynAttr->processControlPoints();
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ void PUMaterialCache::addMaterial(PUMaterial* material)
|
|||
}
|
||||
|
||||
material->retain();
|
||||
_materialMap.push_back(material);
|
||||
_materialMap.emplace_back(material);
|
||||
}
|
||||
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC)
|
||||
|
|
|
@ -384,7 +384,7 @@ const PUTriangle::PositionAndNormal MeshInfo::getRandomPositionAndNormal(const s
|
|||
// t.calculateSquareSurface();
|
||||
// t.calculateSurfaceNormal();
|
||||
// t.calculateEdgeNormals();
|
||||
// _triangles.push_back(t);
|
||||
// _triangles.emplace_back(t);
|
||||
// }
|
||||
//
|
||||
// // Delete intermediate arrays
|
||||
|
|
|
@ -140,7 +140,7 @@ PUEventHandler* PUObserver::createEventHandler(std::string_view eventHandlerType
|
|||
void PUObserver::addEventHandler(PUEventHandler* eventHandler)
|
||||
{
|
||||
eventHandler->retain();
|
||||
_eventHandlers.push_back(eventHandler);
|
||||
_eventHandlers.emplace_back(eventHandler);
|
||||
eventHandler->setParentObserver(this);
|
||||
eventHandler->notifyRescaled(_observerScale);
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ void PUParticle3D::copyBehaviours(const ParticleBehaviourList& list)
|
|||
{
|
||||
auto behaviour = it->clone();
|
||||
behaviour->retain();
|
||||
behaviours.push_back(behaviour);
|
||||
behaviours.emplace_back(behaviour);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ bool PUParticleSystem3D::initWithFilePath(std::string_view filePath)
|
|||
if (std::find(loadedFolder.begin(), loadedFolder.end(), materialFolder) == loadedFolder.end())
|
||||
{
|
||||
PUMaterialCache::Instance()->loadMaterialsFromSearchPaths(materialFolder);
|
||||
loadedFolder.push_back(materialFolder);
|
||||
loadedFolder.emplace_back(materialFolder);
|
||||
}
|
||||
|
||||
if (!initSystem(fullPath))
|
||||
|
@ -918,7 +918,7 @@ void PUParticleSystem3D::addEmitter(PUEmitter* emitter)
|
|||
{
|
||||
emitter->_particleSystem = this;
|
||||
emitter->retain();
|
||||
_emitters.push_back(emitter);
|
||||
_emitters.emplace_back(emitter);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -951,7 +951,7 @@ void PUParticleSystem3D::addListener(PUListener* listener)
|
|||
auto iter = std::find(_listeners.begin(), _listeners.end(), listener);
|
||||
if (iter == _listeners.end())
|
||||
{
|
||||
_listeners.push_back(listener);
|
||||
_listeners.emplace_back(listener);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1036,7 +1036,7 @@ void PUParticleSystem3D::addObserver(PUObserver* observer)
|
|||
{
|
||||
observer->retain();
|
||||
observer->_particleSystem = this;
|
||||
_observers.push_back(observer);
|
||||
_observers.emplace_back(observer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1142,7 +1142,7 @@ void PUParticleSystem3D::addBehaviourTemplate(PUBehaviour* behaviour)
|
|||
{
|
||||
behaviour->retain();
|
||||
behaviour->_particleSystem = this;
|
||||
_behaviourTemplates.push_back(behaviour);
|
||||
_behaviourTemplates.emplace_back(behaviour);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ void PUParticleSystem3DTranslator::translate(PUScriptCompiler* compiler, PUAbstr
|
|||
|
||||
//// Create a particle system with the given name
|
||||
//_system = PUParticleSystem3D::create();
|
||||
// PUParticleSystem3DBuilder::Instance()->PUParticleSystem3DList.push_back(_system);
|
||||
// PUParticleSystem3DBuilder::Instance()->PUParticleSystem3DList.emplace_back(_system);
|
||||
// if (!mSystem)
|
||||
//{
|
||||
// return;
|
||||
|
|
|
@ -51,7 +51,7 @@ const std::vector<Vec3>& PUPositionEmitter::getPositions() const
|
|||
//-----------------------------------------------------------------------
|
||||
void PUPositionEmitter::addPosition(const Vec3& position)
|
||||
{
|
||||
_positionList.push_back(position);
|
||||
_positionList.emplace_back(position);
|
||||
}
|
||||
//-----------------------------------------------------------------------
|
||||
void PUPositionEmitter::notifyStart()
|
||||
|
|
|
@ -515,7 +515,7 @@ void PUParticle3DModelRender::render(Renderer* renderer, const Mat4& transform,
|
|||
mesh->setBlendFunc(particleSystem->getBlendFunc());
|
||||
mesh->setCullFaceEnabled(false);
|
||||
mesh->retain();
|
||||
_meshList.push_back(mesh);
|
||||
_meshList.emplace_back(mesh);
|
||||
}
|
||||
if (!_meshList.empty())
|
||||
{
|
||||
|
@ -1035,7 +1035,7 @@ void PUSphereRender::buildBuffers(unsigned short count)
|
|||
_indices[index++] = vertexIndex;
|
||||
}
|
||||
++vertexIndex;
|
||||
_vertexTemplate.push_back(vi);
|
||||
_vertexTemplate.emplace_back(vi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,13 +72,13 @@ void PURibbonTrail::addNode(Node* n)
|
|||
// get chain index
|
||||
size_t chainIndex = _freeChains.back();
|
||||
_freeChains.pop_back();
|
||||
_nodeToChainSegment.push_back(chainIndex);
|
||||
_nodeToChainSegment.emplace_back(chainIndex);
|
||||
_nodeToSegMap[n] = chainIndex;
|
||||
|
||||
// initialise the chain
|
||||
resetTrail(chainIndex, n);
|
||||
|
||||
_nodeList.push_back(n);
|
||||
_nodeList.emplace_back(n);
|
||||
// n->setListener(this);
|
||||
}
|
||||
//-----------------------------------------------------------------------
|
||||
|
@ -104,7 +104,7 @@ void PURibbonTrail::removeNode(Node* n)
|
|||
size_t chainIndex = *mi;
|
||||
PUBillboardChain::clearChain(chainIndex);
|
||||
// mark as free now
|
||||
_freeChains.push_back(chainIndex);
|
||||
_freeChains.emplace_back(chainIndex);
|
||||
// n->setListener(0);
|
||||
_nodeList.erase(i);
|
||||
_nodeToChainSegment.erase(mi);
|
||||
|
|
|
@ -276,8 +276,8 @@ void PURibbonTrailRender::prepare()
|
|||
_childNode->addChild(node);
|
||||
PURibbonTrailVisualData* visualData = new PURibbonTrailVisualData(node, _trail);
|
||||
visualData->index = i;
|
||||
_allVisualData.push_back(visualData); // Managed by this renderer
|
||||
_visualData.push_back(visualData); // Used to assign to a particle
|
||||
_allVisualData.emplace_back(visualData); // Managed by this renderer
|
||||
_visualData.emplace_back(visualData); // Used to assign to a particle
|
||||
if (_randomInitialColor)
|
||||
{
|
||||
_trail->setInitialColour(i, AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1());
|
||||
|
|
|
@ -50,13 +50,13 @@ PUAbstractNode* PUObjectAbstractNode::clone() const
|
|||
{
|
||||
PUAbstractNode* newNode = (PUAbstractNode*)((*i)->clone());
|
||||
newNode->parent = (PUAbstractNode*)node;
|
||||
node->children.push_back(newNode);
|
||||
node->children.emplace_back(newNode);
|
||||
}
|
||||
for (PUAbstractNodeList::const_iterator i = values.begin(); i != values.end(); ++i)
|
||||
{
|
||||
PUAbstractNode* newNode = (PUAbstractNode*)((*i)->clone());
|
||||
newNode->parent = (PUAbstractNode*)node;
|
||||
node->values.push_back(newNode);
|
||||
node->values.emplace_back(newNode);
|
||||
}
|
||||
node->_env = _env;
|
||||
return (PUAbstractNode*)node;
|
||||
|
@ -136,7 +136,7 @@ PUAbstractNode* PUPropertyAbstractNode::clone() const
|
|||
{
|
||||
PUAbstractNode* newNode = (PUAbstractNode*)((*i)->clone());
|
||||
newNode->parent = (PUAbstractNode*)node;
|
||||
node->values.push_back(newNode);
|
||||
node->values.emplace_back(newNode);
|
||||
}
|
||||
return (PUAbstractNode*)node;
|
||||
}
|
||||
|
@ -312,10 +312,10 @@ void PUScriptCompiler::visit(PUConcreteNode* node)
|
|||
impl->abstract = false;
|
||||
|
||||
std::list<PUConcreteNode*> temp;
|
||||
temp.push_back(node);
|
||||
temp.emplace_back(node);
|
||||
for (const auto& child : node->children)
|
||||
{
|
||||
temp.push_back(child);
|
||||
temp.emplace_back(child);
|
||||
}
|
||||
|
||||
// add brance type//
|
||||
|
@ -337,7 +337,7 @@ void PUScriptCompiler::visit(PUConcreteNode* node)
|
|||
atom->line = (*iter1)->line;
|
||||
atom->type = ANT_ATOM;
|
||||
atom->value = (*iter1)->token;
|
||||
impl->values.push_back(atom);
|
||||
impl->values.emplace_back(atom);
|
||||
++iter1;
|
||||
}
|
||||
|
||||
|
@ -381,17 +381,17 @@ void PUScriptCompiler::visit(PUConcreteNode* node)
|
|||
{
|
||||
PUPropertyAbstractNode* impl = reinterpret_cast<PUPropertyAbstractNode*>(_current);
|
||||
// PUAtomAbstractNode* assd = dynamic_cast<PUAtomAbstractNode*>(asn);
|
||||
impl->values.push_back(asn);
|
||||
impl->values.emplace_back(asn);
|
||||
}
|
||||
else
|
||||
{
|
||||
PUObjectAbstractNode* impl = reinterpret_cast<PUObjectAbstractNode*>(_current);
|
||||
impl->children.push_back(asn);
|
||||
impl->children.emplace_back(asn);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_nodes->push_back(asn);
|
||||
_nodes->emplace_back(asn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@ void PUScriptLexer::setToken(std::string_view lexeme, int line, std::string_view
|
|||
}
|
||||
|
||||
if (!ignore)
|
||||
tokens->push_back(token);
|
||||
tokens->emplace_back(token);
|
||||
}
|
||||
|
||||
bool PUScriptLexer::isWhitespace(char c) const
|
||||
|
|
|
@ -100,7 +100,7 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
temp->token = (*i)->lexeme.substr(1, token->lexeme.size() - 2);
|
||||
else
|
||||
temp->token = (*i)->lexeme;
|
||||
node->children.push_back(temp);
|
||||
node->children.emplace_back(temp);
|
||||
|
||||
// The second-next token is the source
|
||||
++i;
|
||||
|
@ -119,7 +119,7 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
else
|
||||
temp->token = (*i)->lexeme;
|
||||
|
||||
node->children.push_back(temp);
|
||||
node->children.emplace_back(temp);
|
||||
|
||||
// Consume all the newlines
|
||||
i = skipNewlines(i, end);
|
||||
|
@ -128,12 +128,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
node = nullptr;
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
temp->line = (*i)->line;
|
||||
temp->type = CNT_VARIABLE;
|
||||
temp->token = (*i)->lexeme;
|
||||
node->children.push_back(temp);
|
||||
node->children.emplace_back(temp);
|
||||
|
||||
// The next token is the assignment
|
||||
++i;
|
||||
|
@ -174,7 +174,7 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
temp->token = (*i)->lexeme.substr(1, (*i)->lexeme.size() - 2);
|
||||
else
|
||||
temp->token = (*i)->lexeme;
|
||||
node->children.push_back(temp);
|
||||
node->children.emplace_back(temp);
|
||||
|
||||
// Consume all the newlines
|
||||
i = skipNewlines(i, end);
|
||||
|
@ -183,12 +183,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
node = nullptr;
|
||||
}
|
||||
|
@ -207,12 +207,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
|
||||
// Set the parent
|
||||
|
@ -243,12 +243,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
|
||||
// Move up another level
|
||||
|
@ -298,7 +298,7 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
tempNode->line = (*j)->line;
|
||||
tempNode->type = (*j)->type == TID_WORD ? CNT_WORD : CNT_QUOTE;
|
||||
tempNode->parent = node;
|
||||
node->children.push_back(tempNode);
|
||||
node->children.emplace_back(tempNode);
|
||||
++j;
|
||||
}
|
||||
|
||||
|
@ -310,12 +310,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
node = nullptr;
|
||||
}
|
||||
|
@ -334,12 +334,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
|
||||
// Set the parent
|
||||
|
@ -373,12 +373,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
|
||||
// Move up another level
|
||||
|
@ -400,12 +400,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
node = nullptr;
|
||||
}
|
||||
|
@ -421,12 +421,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
node = nullptr;
|
||||
}
|
||||
|
@ -442,12 +442,12 @@ void PUScriptParser::parse(PUConcreteNodeList& nodes, const PUScriptTokenList& t
|
|||
if (parent)
|
||||
{
|
||||
node->parent = parent;
|
||||
parent->children.push_back(node);
|
||||
parent->children.emplace_back(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->parent = 0;
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
node = nullptr;
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ void PUScriptParser::parseChunk(PUConcreteNodeList& nodes, const PUScriptTokenLi
|
|||
}
|
||||
|
||||
if (node != nullptr)
|
||||
nodes.push_back(node);
|
||||
nodes.emplace_back(node);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ PUSimpleSpline::~PUSimpleSpline() {}
|
|||
//---------------------------------------------------------------------
|
||||
void PUSimpleSpline::addPoint(const Vec3& p)
|
||||
{
|
||||
_points.push_back(p);
|
||||
_points.emplace_back(p);
|
||||
if (_autoCalc)
|
||||
{
|
||||
recalcTangents();
|
||||
|
|
|
@ -1231,7 +1231,7 @@ void AssetsManagerEx::batchDownload()
|
|||
_sizeCollected++;
|
||||
}
|
||||
|
||||
_queue.push_back(iter.first);
|
||||
_queue.emplace_back(iter.first);
|
||||
}
|
||||
// All collected, enable total size
|
||||
if (_sizeCollected == _totalToDownload)
|
||||
|
|
|
@ -277,7 +277,7 @@ void Manifest::genResumeAssetsList(DownloadUnits* units) const
|
|||
std::vector<std::string> Manifest::getSearchPaths() const
|
||||
{
|
||||
std::vector<std::string> searchPaths;
|
||||
searchPaths.push_back(_manifestRoot);
|
||||
searchPaths.emplace_back(_manifestRoot);
|
||||
|
||||
for (int i = (int)_searchPaths.size() - 1; i >= 0; i--)
|
||||
{
|
||||
|
@ -285,7 +285,7 @@ std::vector<std::string> Manifest::getSearchPaths() const
|
|||
if (!path.empty() && path[path.size() - 1] != '/')
|
||||
path.push_back('/');
|
||||
path = _manifestRoot + path;
|
||||
searchPaths.push_back(path);
|
||||
searchPaths.emplace_back(path);
|
||||
}
|
||||
return searchPaths;
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ void Manifest::loadVersion(const rapidjson::Document& json)
|
|||
{
|
||||
version = itr->value.GetString();
|
||||
}
|
||||
_groups.push_back(group);
|
||||
_groups.emplace_back(group);
|
||||
_groupVer.emplace(group, version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -941,8 +941,8 @@ void ActionTimelineCache::loadEasingDataWithFlatBuffers(cocostudio::timeline::Fr
|
|||
std::vector<float> easings;
|
||||
for (auto it = points->begin(); it != points->end(); ++it)
|
||||
{
|
||||
easings.push_back(it->x());
|
||||
easings.push_back(it->y());
|
||||
easings.emplace_back(it->x());
|
||||
easings.emplace_back(it->y());
|
||||
}
|
||||
frame->setEasingParams(easings);
|
||||
}
|
||||
|
|
|
@ -1192,7 +1192,7 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree* nodetree, const
|
|||
_rootNode = _callbackHandlers.back();
|
||||
}
|
||||
/**/
|
||||
// _loadingNodeParentHierarchy.push_back(node);
|
||||
// _loadingNodeParentHierarchy.emplace_back(node);
|
||||
}
|
||||
|
||||
// If node is invalid, there is no necessity to process children of node.
|
||||
|
@ -1522,7 +1522,7 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree* nod
|
|||
{
|
||||
_rootNode = node;
|
||||
}
|
||||
// _loadingNodeParentHierarchy.push_back(node);
|
||||
// _loadingNodeParentHierarchy.emplace_back(node);
|
||||
}
|
||||
|
||||
// If node is invalid, there is no necessity to process children of node.
|
||||
|
|
|
@ -85,7 +85,7 @@ void ActionFrame::setEasingParameter(std::vector<float>& parameter)
|
|||
|
||||
for (size_t i = 0; i < parameter.size(); i++)
|
||||
{
|
||||
_Parameter.push_back(parameter[i]);
|
||||
_Parameter.emplace_back(parameter[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ ActionNode::ActionNode()
|
|||
_frameArrayNum = (int)kKeyframeMax;
|
||||
for (int i = 0; i < _frameArrayNum; i++)
|
||||
{
|
||||
_frameArray.push_back(new ax::Vector<ActionFrame*>());
|
||||
_frameArray.emplace_back(new ax::Vector<ActionFrame*>());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic, Ref* root)
|
|||
for (int j = 0; j < frameTweenParameterNum; j++)
|
||||
{
|
||||
float value = DICTOOL->getFloatValueFromArray_json(actionFrameDic, "tweenParameter", j);
|
||||
frameTweenParameter.push_back(value);
|
||||
frameTweenParameter.emplace_back(value);
|
||||
}
|
||||
|
||||
bool existPosition = DICTOOL->checkObjectExist_json(actionFrameDic, "positionx");
|
||||
|
@ -273,7 +273,7 @@ void ActionNode::initWithBinary(CocoLoader* cocoLoader, stExpCocoNode* cocoNode,
|
|||
{
|
||||
std::string t_key = tweenParameterArray[j].GetName(cocoLoader);
|
||||
std::string t_value = tweenParameterArray[j].GetValue(cocoLoader);
|
||||
frameTweenParameter.push_back(valueToFloat(t_value));
|
||||
frameTweenParameter.emplace_back(valueToFloat(t_value));
|
||||
}
|
||||
}
|
||||
else if (key == "positionx")
|
||||
|
|
|
@ -221,7 +221,7 @@ void ArmatureAnimation::play(std::string_view animationName, int durationTo, int
|
|||
Tween* tween = bone->getTween();
|
||||
if (movementBoneData && movementBoneData->frameList.size() > 0)
|
||||
{
|
||||
_tweenList.push_back(tween);
|
||||
_tweenList.emplace_back(tween);
|
||||
movementBoneData->duration = _movementData->duration;
|
||||
tween->play(movementBoneData, durationTo, durationTween, loop, tweenEasing);
|
||||
|
||||
|
@ -286,7 +286,7 @@ void ArmatureAnimation::playWithIndexes(const std::vector<int>& movementIndexes,
|
|||
for (auto&& index : movementIndexes)
|
||||
{
|
||||
std::string name = movName.at(index);
|
||||
_movementList.push_back(name);
|
||||
_movementList.emplace_back(name);
|
||||
}
|
||||
|
||||
updateMovementList();
|
||||
|
|
|
@ -122,7 +122,7 @@ void ArmatureDataManager::addArmatureData(std::string_view id,
|
|||
{
|
||||
if (RelativeData* data = getRelativeData(configFilePath))
|
||||
{
|
||||
data->armatures.push_back(std::string{id});
|
||||
data->armatures.emplace_back(std::string{id});
|
||||
}
|
||||
|
||||
_armarureDatas.insert(id, armatureData);
|
||||
|
@ -144,7 +144,7 @@ void ArmatureDataManager::addAnimationData(std::string_view id,
|
|||
{
|
||||
if (RelativeData* data = getRelativeData(configFilePath))
|
||||
{
|
||||
data->animations.push_back(std::string{id});
|
||||
data->animations.emplace_back(std::string{id});
|
||||
}
|
||||
|
||||
_animationDatas.insert(id, animationData);
|
||||
|
@ -164,7 +164,7 @@ void ArmatureDataManager::addTextureData(std::string_view id, TextureData* textu
|
|||
{
|
||||
if (RelativeData* data = getRelativeData(configFilePath))
|
||||
{
|
||||
data->textures.push_back(std::string{id});
|
||||
data->textures.emplace_back(std::string{id});
|
||||
}
|
||||
|
||||
_textureDatas.insert(id, textureData);
|
||||
|
@ -226,7 +226,7 @@ void ArmatureDataManager::addSpriteFrameFromFile(std::string_view plistPath,
|
|||
{
|
||||
if (RelativeData* data = getRelativeData(configFilePath))
|
||||
{
|
||||
data->plistFiles.push_back(std::string{plistPath});
|
||||
data->plistFiles.emplace_back(std::string{plistPath});
|
||||
}
|
||||
SpriteFrameCacheHelper::getInstance()->addSpriteFrameFromFile(plistPath, imagePath);
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ void ColliderDetector::addContourData(ContourData* contourData)
|
|||
unsigned long num = contourData->vertexList.size();
|
||||
for (unsigned long i = 0; i < num; i++)
|
||||
{
|
||||
calculatedVertexList.push_back(Vec2());
|
||||
calculatedVertexList.emplace_back(Vec2());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ void ColliderDetector::removeContourData(ContourData* contourData)
|
|||
{
|
||||
if (body && body->getContourData() == contourData)
|
||||
{
|
||||
eraseList.push_back(body);
|
||||
eraseList.emplace_back(body);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -276,7 +276,7 @@ void DataReaderHelper::addDataFromFile(std::string_view filePath)
|
|||
return;
|
||||
}
|
||||
}
|
||||
_configFileList.push_back(std::string{filePath});
|
||||
_configFileList.emplace_back(std::string{filePath});
|
||||
|
||||
//! find the base file path
|
||||
std::string basefilePath;
|
||||
|
@ -342,7 +342,7 @@ void DataReaderHelper::addDataFromFileAsync(std::string_view imagePath,
|
|||
return;
|
||||
}
|
||||
}
|
||||
_configFileList.push_back(std::string{filePath});
|
||||
_configFileList.emplace_back(std::string{filePath});
|
||||
|
||||
//! find the base file path
|
||||
std::string basefilePath;
|
||||
|
@ -814,7 +814,7 @@ MovementBoneData* DataReaderHelper::decodeMovementBone(pugi::xml_node& movBoneXm
|
|||
parentFrameXML = parentXml.child(FRAME);
|
||||
while (parentFrameXML)
|
||||
{
|
||||
parentXmlList.push_back(parentFrameXML);
|
||||
parentXmlList.emplace_back(parentFrameXML);
|
||||
parentFrameXML = parentFrameXML.next_sibling(FRAME);
|
||||
}
|
||||
|
||||
|
@ -1101,7 +1101,7 @@ ContourData* DataReaderHelper::decodeContour(pugi::xml_node& contourXML, DataInf
|
|||
pugiext::query_attribute(vertexDataXML, A_Y, &vertex.y);
|
||||
|
||||
vertex.y = -vertex.y;
|
||||
contourData->vertexList.push_back(vertex);
|
||||
contourData->vertexList.emplace_back(vertex);
|
||||
|
||||
vertexDataXML = vertexDataXML.next_sibling(CONTOUR_VERTEX);
|
||||
}
|
||||
|
@ -1596,7 +1596,7 @@ ContourData* DataReaderHelper::decodeContour(const rapidjson::Value& json)
|
|||
vertex.x = DICTOOL->getFloatValue_json(dic, A_X);
|
||||
vertex.y = DICTOOL->getFloatValue_json(dic, A_Y);
|
||||
|
||||
contourData->vertexList.push_back(vertex);
|
||||
contourData->vertexList.emplace_back(vertex);
|
||||
}
|
||||
|
||||
return contourData;
|
||||
|
@ -2395,7 +2395,7 @@ ContourData* DataReaderHelper::decodeContour(CocoLoader* cocoLoader, stExpCocoNo
|
|||
Vec2 vertex;
|
||||
vertex.x = utils::atof(pVerTexPoint[0].GetValue(cocoLoader));
|
||||
vertex.y = utils::atof(pVerTexPoint[1].GetValue(cocoLoader));
|
||||
contourData->vertexList.push_back(vertex);
|
||||
contourData->vertexList.emplace_back(vertex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -319,7 +319,7 @@ AnimationData::~AnimationData(void) {}
|
|||
void AnimationData::addMovement(MovementData* movData)
|
||||
{
|
||||
movementDataDic.insert(movData->name, movData);
|
||||
movementNames.push_back(movData->name);
|
||||
movementNames.emplace_back(movData->name);
|
||||
}
|
||||
|
||||
MovementData* AnimationData::getMovement(std::string_view movementName)
|
||||
|
@ -343,7 +343,7 @@ bool ContourData::init()
|
|||
|
||||
void ContourData::addVertex(Vec2& vertex)
|
||||
{
|
||||
vertexList.push_back(vertex);
|
||||
vertexList.emplace_back(vertex);
|
||||
}
|
||||
|
||||
TextureData::TextureData() : height(0.0f), width(0.0f), pivotX(0.5f), pivotY(0.5f), name("") {}
|
||||
|
|
|
@ -126,7 +126,7 @@ ax::Node* SceneReader::createNodeWithSceneFile(
|
|||
}
|
||||
else
|
||||
{
|
||||
_vecComs.push_back(pCom);
|
||||
_vecComs.emplace_back(pCom);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -284,7 +284,7 @@ Node* SceneReader::createObject(const rapidjson::Value& dict,
|
|||
ComRender* tRender = dynamic_cast<ComRender*>(com);
|
||||
if (tRender == nullptr)
|
||||
{
|
||||
vecComs.push_back(com);
|
||||
vecComs.emplace_back(com);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -306,7 +306,7 @@ Node* SceneReader::createObject(const rapidjson::Value& dict,
|
|||
gb = Node::create();
|
||||
if (render != nullptr)
|
||||
{
|
||||
vecComs.push_back(render);
|
||||
vecComs.emplace_back(render);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -401,7 +401,7 @@ ax::Node* SceneReader::createObject(CocoLoader* cocoLoader,
|
|||
}
|
||||
else
|
||||
{
|
||||
_vecComs.push_back(pCom);
|
||||
_vecComs.emplace_back(pCom);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -423,7 +423,7 @@ ax::Node* SceneReader::createObject(CocoLoader* cocoLoader,
|
|||
gb = Node::create();
|
||||
if (pRender != nullptr)
|
||||
{
|
||||
_vecComs.push_back(pRender);
|
||||
_vecComs.emplace_back(pRender);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -69,7 +69,7 @@ void SpriteFrameCacheHelper::retainSpriteFrames(std::string_view plistPath)
|
|||
SpriteFrame* spriteFrame = spriteFramesCache->findFrame(spriteFrameName);
|
||||
AXASSERT(spriteFrame, "spriteframe is null!");
|
||||
|
||||
vec.push_back(spriteFrame);
|
||||
vec.emplace_back(spriteFrame);
|
||||
AX_SAFE_RETAIN(spriteFrame);
|
||||
}
|
||||
_usingSpriteFrames[plistPath] = vec;
|
||||
|
|
|
@ -292,7 +292,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithOpaque(void* opaque, s
|
|||
while (animationinfoElement)
|
||||
{
|
||||
auto animationinfo = thiz->createAnimationInfo(animationinfoElement);
|
||||
animationInfos.push_back(animationinfo);
|
||||
animationInfos.emplace_back(animationinfo);
|
||||
animationinfoElement = animationinfoElement.next_sibling();
|
||||
}
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTree(pugi::xml_node objectData,
|
|||
|
||||
if (attriname == "ctype")
|
||||
{
|
||||
children.push_back(createNodeTree(child, value));
|
||||
children.emplace_back(createNodeTree(child, value));
|
||||
|
||||
bHasType = true;
|
||||
break;
|
||||
|
@ -404,7 +404,7 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTree(pugi::xml_node objectData,
|
|||
|
||||
if (!bHasType)
|
||||
{
|
||||
children.push_back(createNodeTree(child, "NodeObjectData"));
|
||||
children.emplace_back(createNodeTree(child, "NodeObjectData"));
|
||||
}
|
||||
|
||||
child = child.next_sibling();
|
||||
|
@ -588,7 +588,7 @@ Offset<NodeAction> FlatBuffersSerialize::createNodeAction(pugi::xml_node objectD
|
|||
while (timelineElement)
|
||||
{
|
||||
auto timeLine = createTimeLine(timelineElement);
|
||||
timelines.push_back(timeLine);
|
||||
timelines.emplace_back(timeLine);
|
||||
|
||||
timelineElement = timelineElement.next_sibling();
|
||||
}
|
||||
|
@ -772,7 +772,7 @@ Offset<TimeLine> FlatBuffersSerialize::createTimeLine(pugi::xml_node objectData)
|
|||
blendFrame);
|
||||
}
|
||||
|
||||
frames.push_back(frame);
|
||||
frames.emplace_back(frame);
|
||||
|
||||
frameElement = frameElement.next_sibling();
|
||||
}
|
||||
|
@ -970,7 +970,7 @@ Offset<flatbuffers::TextureFrame> FlatBuffersSerialize::createTextureFrame(pugi:
|
|||
|
||||
if (resourceType == 1)
|
||||
{
|
||||
_textures.push_back(_builder->CreateString(texture));
|
||||
_textures.emplace_back(_builder->CreateString(texture));
|
||||
}
|
||||
|
||||
child = child.next_sibling();
|
||||
|
@ -1221,7 +1221,7 @@ flatbuffers::Offset<flatbuffers::EasingData> FlatBuffersSerialize::createEasingD
|
|||
attribute = attribute.next_attribute();
|
||||
}
|
||||
flatbuffers::FVec2 f_PointF(pointF.x, pointF.y);
|
||||
points.push_back(f_PointF);
|
||||
points.emplace_back(f_PointF);
|
||||
|
||||
PointF = PointF.next_sibling();
|
||||
}
|
||||
|
@ -1339,7 +1339,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato
|
|||
while (animationinfoElement)
|
||||
{
|
||||
auto animationinfo = createAnimationInfo(animationinfoElement);
|
||||
animationInfos.push_back(animationinfo);
|
||||
animationInfos.emplace_back(animationinfo);
|
||||
animationinfoElement = animationinfoElement.next_sibling();
|
||||
}
|
||||
}
|
||||
|
@ -1426,7 +1426,7 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTreeForSimulator(pugi::xml_node
|
|||
|
||||
if (attriname == "ctype")
|
||||
{
|
||||
children.push_back(createNodeTreeForSimulator(child, value));
|
||||
children.emplace_back(createNodeTreeForSimulator(child, value));
|
||||
|
||||
bHasType = true;
|
||||
break;
|
||||
|
@ -1437,7 +1437,7 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTreeForSimulator(pugi::xml_node
|
|||
|
||||
if (!bHasType)
|
||||
{
|
||||
children.push_back(createNodeTreeForSimulator(child, "NodeObjectData"sv));
|
||||
children.emplace_back(createNodeTreeForSimulator(child, "NodeObjectData"sv));
|
||||
}
|
||||
|
||||
child = child.next_sibling();
|
||||
|
@ -1576,7 +1576,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFileForLanguageData
|
|||
|
||||
Offset<flatbuffers::LanguageItem> langItem =
|
||||
CreateLanguageItem(*_builder, _builder->CreateString(key), _builder->CreateString(text));
|
||||
langItemList.push_back(langItem);
|
||||
langItemList.emplace_back(langItem);
|
||||
|
||||
element = element.next_sibling();
|
||||
}
|
||||
|
|
|
@ -454,7 +454,7 @@ Offset<Table> ButtonReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (disabledResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "PressedFileData")
|
||||
|
@ -489,7 +489,7 @@ Offset<Table> ButtonReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (pressedResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "NormalFileData")
|
||||
|
@ -524,7 +524,7 @@ Offset<Table> ButtonReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (normalResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "FontResource")
|
||||
|
|
|
@ -261,7 +261,7 @@ Offset<Table> CheckBoxReader::createOptionsWithFlatBuffers(pugi::xml_node object
|
|||
if (backgroundboxResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "PressedBackFileData")
|
||||
|
@ -296,7 +296,7 @@ Offset<Table> CheckBoxReader::createOptionsWithFlatBuffers(pugi::xml_node object
|
|||
if (backGroundBoxSelectedResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "NodeNormalFileData")
|
||||
|
@ -331,7 +331,7 @@ Offset<Table> CheckBoxReader::createOptionsWithFlatBuffers(pugi::xml_node object
|
|||
if (frontCrossResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "DisableBackFileData")
|
||||
|
@ -366,7 +366,7 @@ Offset<Table> CheckBoxReader::createOptionsWithFlatBuffers(pugi::xml_node object
|
|||
if (backGroundBoxDisabledResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "NodeDisableFileData")
|
||||
|
@ -401,7 +401,7 @@ Offset<Table> CheckBoxReader::createOptionsWithFlatBuffers(pugi::xml_node object
|
|||
if (frontCrossDisabledResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ Offset<Table> GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (leftResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(leftPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(leftPlistFile));
|
||||
}
|
||||
}
|
||||
else if (childName == "RightImage")
|
||||
|
@ -215,7 +215,7 @@ Offset<Table> GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (rightResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(rightPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(rightPlistFile));
|
||||
}
|
||||
}
|
||||
else if (childName == "UpImage")
|
||||
|
@ -246,7 +246,7 @@ Offset<Table> GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (upResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(upPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(upPlistFile));
|
||||
}
|
||||
}
|
||||
else if (childName == "DownImage")
|
||||
|
@ -277,7 +277,7 @@ Offset<Table> GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (downResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(downPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(downPlistFile));
|
||||
}
|
||||
}
|
||||
else if (childName == "ForwardImage")
|
||||
|
@ -308,7 +308,7 @@ Offset<Table> GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (forwardResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(forwardPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(forwardPlistFile));
|
||||
}
|
||||
}
|
||||
else if (childName == "BackImage")
|
||||
|
@ -339,7 +339,7 @@ Offset<Table> GameNode3DReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (backResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(backPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(backPlistFile));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ Offset<Table> ImageViewReader::createOptionsWithFlatBuffers(pugi::xml_node objec
|
|||
if (resourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -518,7 +518,7 @@ Offset<Table> LayoutReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (resourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ Offset<Table> ListViewReader::createOptionsWithFlatBuffers(pugi::xml_node object
|
|||
if (resourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ Offset<Table> LoadingBarReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (resourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ Offset<Table> PageViewReader::createOptionsWithFlatBuffers(pugi::xml_node object
|
|||
if (resourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ Offset<Table> RadioButtonReader::createOptionsWithFlatBuffers(pugi::xml_node obj
|
|||
if (backgroundboxResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "PressedBackFileData")
|
||||
|
@ -165,7 +165,7 @@ Offset<Table> RadioButtonReader::createOptionsWithFlatBuffers(pugi::xml_node obj
|
|||
if (backGroundBoxSelectedResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "NodeNormalFileData")
|
||||
|
@ -200,7 +200,7 @@ Offset<Table> RadioButtonReader::createOptionsWithFlatBuffers(pugi::xml_node obj
|
|||
if (frontCrossResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "DisableBackFileData")
|
||||
|
@ -235,7 +235,7 @@ Offset<Table> RadioButtonReader::createOptionsWithFlatBuffers(pugi::xml_node obj
|
|||
if (backGroundBoxDisabledResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "NodeDisableFileData")
|
||||
|
@ -270,7 +270,7 @@ Offset<Table> RadioButtonReader::createOptionsWithFlatBuffers(pugi::xml_node obj
|
|||
if (frontCrossDisabledResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -368,7 +368,7 @@ Offset<Table> ScrollViewReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (resourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ Offset<Table> SliderReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (barFileNameResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "BallNormalData")
|
||||
|
@ -308,7 +308,7 @@ Offset<Table> SliderReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (ballNormalResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "BallPressedData")
|
||||
|
@ -343,7 +343,7 @@ Offset<Table> SliderReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (ballPressedResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "BallDisabledData")
|
||||
|
@ -378,7 +378,7 @@ Offset<Table> SliderReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (ballDisabledResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "ProgressBarData")
|
||||
|
@ -413,7 +413,7 @@ Offset<Table> SliderReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (progressBarResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ Offset<Table> SpineSkeletonReader::createOptionsWithFlatBuffers(pugi::xml_node o
|
|||
if (resourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "BlendFunc")
|
||||
|
|
|
@ -140,7 +140,7 @@ Offset<Table> SpriteReader::createOptionsWithFlatBuffers(pugi::xml_node objectDa
|
|||
if (resourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "BlendFunc")
|
||||
|
|
|
@ -143,7 +143,7 @@ flatbuffers::Offset<flatbuffers::Table> TabControlReader::createOptionsWithFlatB
|
|||
{
|
||||
auto itemOption =
|
||||
TabItemReader::getInstance()->createTabItemOptionWithFlatBuffers(child, builder);
|
||||
tabItems.push_back(itemOption);
|
||||
tabItems.emplace_back(itemOption);
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
@ -334,7 +334,7 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
|||
if (backgroundboxResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "PressedBackFileData")
|
||||
|
@ -369,7 +369,7 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
|||
if (backGroundBoxSelectedResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "NodeNormalFileData")
|
||||
|
@ -404,7 +404,7 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
|||
if (frontCrossResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "DisableBackFileData")
|
||||
|
@ -439,7 +439,7 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
|||
if (backGroundBoxDisabledResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "NodeDisableFileData")
|
||||
|
@ -474,7 +474,7 @@ flatbuffers::Offset<flatbuffers::Table> TabHeaderReader::createOptionsWithFlatBu
|
|||
if (frontCrossDisabledResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(texture));
|
||||
fbs->_textures.emplace_back(builder->CreateString(texture));
|
||||
}
|
||||
}
|
||||
else if (name == "FontResource")
|
||||
|
|
|
@ -220,7 +220,7 @@ Offset<Table> UserCameraReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (leftResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(leftPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(leftPlistFile));
|
||||
}
|
||||
}
|
||||
else if (name == "RightImage")
|
||||
|
@ -251,7 +251,7 @@ Offset<Table> UserCameraReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (rightResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(rightPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(rightPlistFile));
|
||||
}
|
||||
}
|
||||
else if (name == "UpImage")
|
||||
|
@ -282,7 +282,7 @@ Offset<Table> UserCameraReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (upResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(upPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(upPlistFile));
|
||||
}
|
||||
}
|
||||
else if (name == "DownImage")
|
||||
|
@ -313,7 +313,7 @@ Offset<Table> UserCameraReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (downResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(downPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(downPlistFile));
|
||||
}
|
||||
}
|
||||
else if (name == "ForwardImage")
|
||||
|
@ -344,7 +344,7 @@ Offset<Table> UserCameraReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (forwardResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(forwardPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(forwardPlistFile));
|
||||
}
|
||||
}
|
||||
else if (name == "BackImage")
|
||||
|
@ -375,7 +375,7 @@ Offset<Table> UserCameraReader::createOptionsWithFlatBuffers(pugi::xml_node obje
|
|||
if (backResourceType == 1)
|
||||
{
|
||||
FlatBuffersSerialize* fbs = FlatBuffersSerialize::getInstance();
|
||||
fbs->_textures.push_back(builder->CreateString(backPlistFile));
|
||||
fbs->_textures.emplace_back(builder->CreateString(backPlistFile));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1186,7 +1186,7 @@ bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, ax::ValueVector*
|
|||
ValueMap dictVal;
|
||||
if (luaval_to_ccvaluemap(L, i + 2, &dictVal))
|
||||
{
|
||||
ret->push_back(Value(dictVal));
|
||||
ret->emplace_back(Value(dictVal));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1195,7 +1195,7 @@ bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, ax::ValueVector*
|
|||
ValueVector arrVal;
|
||||
if (luaval_to_ccvaluevector(L, i + 2, &arrVal))
|
||||
{
|
||||
ret->push_back(Value(arrVal));
|
||||
ret->emplace_back(Value(arrVal));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1204,7 +1204,7 @@ bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, ax::ValueVector*
|
|||
std::string stringValue = "";
|
||||
if (luaval_to_std_string(L, i + 2, &stringValue))
|
||||
{
|
||||
ret->push_back(Value(stringValue));
|
||||
ret->emplace_back(Value(stringValue));
|
||||
}
|
||||
}
|
||||
else if (lua_isboolean(L, i + 2))
|
||||
|
@ -1212,12 +1212,12 @@ bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, ax::ValueVector*
|
|||
bool boolVal = false;
|
||||
if (luaval_to_boolean(L, i + 2, &boolVal))
|
||||
{
|
||||
ret->push_back(Value(boolVal));
|
||||
ret->emplace_back(Value(boolVal));
|
||||
}
|
||||
}
|
||||
else if (lua_type(L, i + 2) == LUA_TNUMBER)
|
||||
{
|
||||
ret->push_back(Value(tolua_tonumber(L, i + 2, 0)));
|
||||
ret->emplace_back(Value(tolua_tonumber(L, i + 2, 0)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1497,7 +1497,7 @@ bool luaval_to_ccvaluevector(lua_State* L, int lo, ax::ValueVector* ret, const c
|
|||
ValueMap dictVal;
|
||||
if (luaval_to_ccvaluemap(L, lua_gettop(L), &dictVal))
|
||||
{
|
||||
ret->push_back(Value(dictVal));
|
||||
ret->emplace_back(Value(dictVal));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1506,7 +1506,7 @@ bool luaval_to_ccvaluevector(lua_State* L, int lo, ax::ValueVector* ret, const c
|
|||
ValueVector arrVal;
|
||||
if (luaval_to_ccvaluevector(L, lua_gettop(L), &arrVal))
|
||||
{
|
||||
ret->push_back(Value(arrVal));
|
||||
ret->emplace_back(Value(arrVal));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1515,7 +1515,7 @@ bool luaval_to_ccvaluevector(lua_State* L, int lo, ax::ValueVector* ret, const c
|
|||
std::string stringValue = "";
|
||||
if (luaval_to_std_string(L, -1, &stringValue))
|
||||
{
|
||||
ret->push_back(Value(stringValue));
|
||||
ret->emplace_back(Value(stringValue));
|
||||
}
|
||||
}
|
||||
else if (lua_type(L, -1) == LUA_TBOOLEAN)
|
||||
|
@ -1523,12 +1523,12 @@ bool luaval_to_ccvaluevector(lua_State* L, int lo, ax::ValueVector* ret, const c
|
|||
bool boolVal = false;
|
||||
if (luaval_to_boolean(L, -1, &boolVal))
|
||||
{
|
||||
ret->push_back(Value(boolVal));
|
||||
ret->emplace_back(Value(boolVal));
|
||||
}
|
||||
}
|
||||
else if (lua_type(L, -1) == LUA_TNUMBER)
|
||||
{
|
||||
ret->push_back(Value(tolua_tonumber(L, -1, 0)));
|
||||
ret->emplace_back(Value(tolua_tonumber(L, -1, 0)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1568,7 +1568,7 @@ bool luaval_to_std_vector_string(lua_State* L, int lo, std::vector<std::string>*
|
|||
{
|
||||
ok = luaval_to_std_string(L, -1, &value);
|
||||
if (ok)
|
||||
ret->push_back(value);
|
||||
ret->emplace_back(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1609,7 +1609,7 @@ bool luaval_to_std_vector_string_view(lua_State* L, int lo, std::vector<std::str
|
|||
{
|
||||
ok = luaval_to_std_string_view(L, -1, &value);
|
||||
if (ok)
|
||||
ret->push_back(value);
|
||||
ret->emplace_back(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1647,7 +1647,7 @@ bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector<int>* ret, const
|
|||
lua_gettable(L, lo);
|
||||
if (lua_isnumber(L, -1))
|
||||
{
|
||||
ret->push_back((int)tolua_tonumber(L, -1, 0));
|
||||
ret->emplace_back((int)tolua_tonumber(L, -1, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1719,7 +1719,7 @@ bool luaval_to_std_vector_float(lua_State* L, int lo, std::vector<float>* ret, c
|
|||
lua_gettable(L, lo);
|
||||
if (lua_isnumber(L, -1))
|
||||
{
|
||||
ret->push_back((float)tolua_tonumber(L, -1, 0));
|
||||
ret->emplace_back((float)tolua_tonumber(L, -1, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1758,7 +1758,7 @@ bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector<unsigned shor
|
|||
lua_gettable(L, lo);
|
||||
if (lua_isnumber(L, -1))
|
||||
{
|
||||
ret->push_back((unsigned short)tolua_tonumber(L, -1, 0));
|
||||
ret->emplace_back((unsigned short)tolua_tonumber(L, -1, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1981,7 +1981,7 @@ bool luaval_to_std_vector_vec2(lua_State* L, int lo, std::vector<ax::Vec2>* ret,
|
|||
ok &= luaval_to_vec2(L, lua_gettop(L), &value);
|
||||
if (ok)
|
||||
{
|
||||
ret->push_back(value);
|
||||
ret->emplace_back(value);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2024,7 +2024,7 @@ bool luaval_to_std_vector_vec3(lua_State* L, int lo, std::vector<ax::Vec3>* ret,
|
|||
ok &= luaval_to_vec3(L, lua_gettop(L), &value);
|
||||
if (ok)
|
||||
{
|
||||
ret->push_back(value);
|
||||
ret->emplace_back(value);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2070,7 +2070,7 @@ bool luaval_to_std_vector_v3f_c4b_t2f(lua_State* L,
|
|||
ok &= luaval_to_v3f_c4b_t2f(L, lua_gettop(L), &value);
|
||||
if (ok)
|
||||
{
|
||||
ret->push_back(value);
|
||||
ret->emplace_back(value);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -143,7 +143,7 @@ void ScriptHandlerMgr::addObjectHandler(void* object, int handler, ScriptHandler
|
|||
vecHandlers = iter->second;
|
||||
|
||||
HandlerPair eventHanler = std::make_pair(handlerType, handler);
|
||||
vecHandlers.push_back(eventHanler);
|
||||
vecHandlers.emplace_back(eventHanler);
|
||||
_mapObjectHandlers[object] = vecHandlers;
|
||||
}
|
||||
void ScriptHandlerMgr::removeObjectHandler(void* object, ScriptHandlerMgr::HandlerType handlerType)
|
||||
|
@ -221,7 +221,7 @@ ScriptHandlerMgr::HandlerType ScriptHandlerMgr::addCustomHandler(void* object, i
|
|||
assert(handlerType <= HandlerType::EVENT_CUSTOM_ENDED);
|
||||
|
||||
HandlerPair eventHanler = std::make_pair(handlerType, handler);
|
||||
vecHandlers.push_back(eventHanler);
|
||||
vecHandlers.emplace_back(eventHanler);
|
||||
_mapObjectHandlers[object] = vecHandlers;
|
||||
|
||||
return handlerType;
|
||||
|
|
|
@ -191,7 +191,7 @@ void LuaMinXmlHttpRequest::_setHttpRequestHeader()
|
|||
|
||||
for (auto it = _requestHeader.begin(); it != _requestHeader.end(); ++it)
|
||||
{
|
||||
header.push_back(it->first + ": " + it->second);
|
||||
header.emplace_back(it->first + ": " + it->second);
|
||||
}
|
||||
|
||||
if (!header.empty())
|
||||
|
@ -709,7 +709,7 @@ static int lua_get_XMLHttpRequest_response(lua_State* L)
|
|||
for (size_t i = 0; i < self->getDataSize(); i++)
|
||||
{
|
||||
LuaValue value = LuaValue::intValue(tmpData[i]);
|
||||
array.push_back(value);
|
||||
array.emplace_back(value);
|
||||
}
|
||||
|
||||
pStack->pushLuaValueArray(array);
|
||||
|
|
|
@ -680,7 +680,7 @@ int axlua_physics3d_Physics3DShape_createCompoundShape(lua_State* L)
|
|||
luaval_to_mat4(L, lua_gettop(L), &mat);
|
||||
lua_pop(L, 1);
|
||||
|
||||
shapes.push_back(std::make_pair(shape, mat));
|
||||
shapes.emplace_back(std::make_pair(shape, mat));
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ bool LuaJavaBridge::CallInfo::validateMethodSig()
|
|||
return false;
|
||||
|
||||
m_argumentsCount++;
|
||||
m_argumentsType.push_back(type);
|
||||
m_argumentsType.emplace_back(type);
|
||||
pos++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue