Merge with develop

--HG--
branch : compatibility-develop
This commit is contained in:
kervala 2016-12-19 13:58:14 +01:00
commit 929cf93b87
109 changed files with 288 additions and 275 deletions

View file

@ -120,7 +120,7 @@ public:
void setWorldMatrix (const NLMISC::CMatrix &WM); void setWorldMatrix (const NLMISC::CMatrix &WM);
bool isRoot() { return _LocalVolume.size() == 0; } bool isRoot() { return _LocalVolume.empty(); }
//\name Sound related. //\name Sound related.
//@{ //@{

View file

@ -385,7 +385,7 @@ void loadForm (const std::vector<std::string> &sheetFilters, const std::string &
} }
} }
if(NeededToRecompute.size() > 0) if(!NeededToRecompute.empty())
nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size()); nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size());
// free the georges loader if necessary // free the georges loader if necessary
@ -748,7 +748,7 @@ void loadForm2(const std::vector<std::string> &sheetFilters, const std::string &
} }
} }
if(NeededToRecompute.size() > 0) if(!NeededToRecompute.empty())
nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size()); nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size());
// free the georges loader if necessary // free the georges loader if necessary
@ -1304,7 +1304,7 @@ void loadFormNoPackedSheet (const std::vector<std::string> &sheetFilters, std::m
} }
} }
if(NeededToRecompute.size() > 0) if(!NeededToRecompute.empty())
nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size()); nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size());
// free the georges loader if necessary // free the georges loader if necessary
@ -1393,7 +1393,7 @@ void loadFormNoPackedSheet2 (const std::vector<std::string> &sheetFilters, std::
} }
} }
if(NeededToRecompute.size() > 0) if(!NeededToRecompute.empty())
nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size()); nlinfo ("%d seconds to recompute %d sheets", (uint32)(NLMISC::CTime::getLocalTime()-start)/1000, NeededToRecompute.size());
// free the georges loader if necessary // free the georges loader if necessary

View file

@ -208,7 +208,7 @@ namespace NLGUI
CInterfaceGroup *createGroupInstance(const std::string &templateName, const std::string &parentID, const std::pair<std::string, std::string> *templateParams, uint numParams, bool updateLinks = true); CInterfaceGroup *createGroupInstance(const std::string &templateName, const std::string &parentID, const std::pair<std::string, std::string> *templateParams, uint numParams, bool updateLinks = true);
CInterfaceGroup *createGroupInstance(const std::string &templateName, const std::string &parentID, std::vector<std::pair<std::string, std::string> > &templateParams, bool updateLinks = true) CInterfaceGroup *createGroupInstance(const std::string &templateName, const std::string &parentID, std::vector<std::pair<std::string, std::string> > &templateParams, bool updateLinks = true)
{ {
if (templateParams.size() > 0) if (!templateParams.empty())
return createGroupInstance(templateName, parentID, &templateParams[0], (uint)templateParams.size(), updateLinks); return createGroupInstance(templateName, parentID, &templateParams[0], (uint)templateParams.size(), updateLinks);
else else
return createGroupInstance(templateName, parentID, NULL, 0, updateLinks); return createGroupInstance(templateName, parentID, NULL, 0, updateLinks);
@ -222,7 +222,7 @@ namespace NLGUI
CInterfaceElement *createUIElement(const std::string &templateName, const std::string &parentID, const std::pair<std::string,std::string> *templateParams, uint numParams, bool updateLinks /* = true */); CInterfaceElement *createUIElement(const std::string &templateName, const std::string &parentID, const std::pair<std::string,std::string> *templateParams, uint numParams, bool updateLinks /* = true */);
CInterfaceElement *createUIElement(const std::string &templateName, const std::string &parentID, std::vector<std::pair<std::string, std::string> > &templateParams, bool updateLinks = true) CInterfaceElement *createUIElement(const std::string &templateName, const std::string &parentID, std::vector<std::pair<std::string, std::string> > &templateParams, bool updateLinks = true)
{ {
if (templateParams.size() > 0) if (!templateParams.empty())
return createUIElement(templateName, parentID, &templateParams[0], (uint)templateParams.size(), updateLinks); return createUIElement(templateName, parentID, &templateParams[0], (uint)templateParams.size(), updateLinks);
else else
return createUIElement(templateName, parentID, NULL, 0, updateLinks); return createUIElement(templateName, parentID, NULL, 0, updateLinks);

View file

@ -133,7 +133,7 @@ bool CClipTrav::fullSearch (vector<CCluster*>& vCluster, const CVector& pos)
if (pIG->_ClusterInstances[i]->isIn(pos)) if (pIG->_ClusterInstances[i]->isIn(pos))
vCluster.push_back (pIG->_ClusterInstances[i]); vCluster.push_back (pIG->_ClusterInstances[i]);
} }
if (vCluster.size() > 0) if (!vCluster.empty())
return true;*/ return true;*/
return true; return true;

View file

@ -541,7 +541,7 @@ void CMeshGeom::render(IDriver *drv, CTransformShape *trans, float polygonCount,
skeleton= mi->getSkeletonModel(); skeleton= mi->getSkeletonModel();
// The mesh must not be skinned for render() // The mesh must not be skinned for render()
nlassert(!(_Skinned && mi->isSkinned() && skeleton)); nlassert(!(_Skinned && mi->isSkinned() && skeleton));
bool bMorphApplied = _MeshMorpher->BlendShapes.size() > 0; bool bMorphApplied = !_MeshMorpher->BlendShapes.empty();
bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace(); bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace();
@ -733,7 +733,7 @@ void CMeshGeom::renderSkin(CTransformShape *trans, float alphaMRM)
skeleton= mi->getSkeletonModel(); skeleton= mi->getSkeletonModel();
// must be skinned for renderSkin() // must be skinned for renderSkin()
nlassert(_Skinned && mi->isSkinned() && skeleton); nlassert(_Skinned && mi->isSkinned() && skeleton);
bool bMorphApplied = _MeshMorpher->BlendShapes.size() > 0; bool bMorphApplied = !_MeshMorpher->BlendShapes.empty();
bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace(); bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace();

View file

@ -105,7 +105,7 @@ void CMeshMorpher::update (std::vector<CAnimatedMorph> *pBSFactor)
if (_VBOri == NULL) if (_VBOri == NULL)
return; return;
if (BlendShapes.size() == 0) if (BlendShapes.empty())
return; return;
if (_VBOri->getNumVertices() != _VBDst->getNumVertices()) if (_VBOri->getNumVertices() != _VBDst->getNumVertices())
@ -164,21 +164,21 @@ void CMeshMorpher::update (std::vector<CAnimatedMorph> *pBSFactor)
// Modify Pos/Norm/TgSpace. // Modify Pos/Norm/TgSpace.
//------------ //------------
if (_VBDst->getVertexFormat() & CVertexBuffer::PositionFlag) if (_VBDst->getVertexFormat() & CVertexBuffer::PositionFlag)
if (rBS.deltaPos.size() > 0) if (!rBS.deltaPos.empty())
{ {
CVector *pV = dstvba.getVertexCoordPointer (vp); CVector *pV = dstvba.getVertexCoordPointer (vp);
*pV += rBS.deltaPos[j] * rFactor; *pV += rBS.deltaPos[j] * rFactor;
} }
if (_VBDst->getVertexFormat() & CVertexBuffer::NormalFlag) if (_VBDst->getVertexFormat() & CVertexBuffer::NormalFlag)
if (rBS.deltaNorm.size() > 0) if (!rBS.deltaNorm.empty())
{ {
CVector *pV = dstvba.getNormalCoordPointer (vp); CVector *pV = dstvba.getNormalCoordPointer (vp);
*pV += rBS.deltaNorm[j] * rFactor; *pV += rBS.deltaNorm[j] * rFactor;
} }
if (_UseTgSpace) if (_UseTgSpace)
if (rBS.deltaTgSpace.size() > 0) if (!rBS.deltaTgSpace.empty())
{ {
CVector *pV = (CVector*)dstvba.getTexCoordPointer (vp, tgSpaceStage); CVector *pV = (CVector*)dstvba.getTexCoordPointer (vp, tgSpaceStage);
*pV += rBS.deltaTgSpace[j] * rFactor; *pV += rBS.deltaTgSpace[j] * rFactor;
@ -187,14 +187,14 @@ void CMeshMorpher::update (std::vector<CAnimatedMorph> *pBSFactor)
// Modify UV0 / Color // Modify UV0 / Color
//------------ //------------
if (_VBDst->getVertexFormat() & CVertexBuffer::TexCoord0Flag) if (_VBDst->getVertexFormat() & CVertexBuffer::TexCoord0Flag)
if (rBS.deltaUV.size() > 0) if (!rBS.deltaUV.empty())
{ {
CUV *pUV = dstvba.getTexCoordPointer (vp); CUV *pUV = dstvba.getTexCoordPointer (vp);
*pUV += rBS.deltaUV[j] * rFactor; *pUV += rBS.deltaUV[j] * rFactor;
} }
if (_VBDst->getVertexFormat() & CVertexBuffer::PrimaryColorFlag) if (_VBDst->getVertexFormat() & CVertexBuffer::PrimaryColorFlag)
if (rBS.deltaCol.size() > 0) if (!rBS.deltaCol.empty())
{ {
// todo hulud d3d vertex color RGBA / BGRA // todo hulud d3d vertex color RGBA / BGRA
CRGBA *pRGBA = (CRGBA*)dstvba.getColorPointer (vp); CRGBA *pRGBA = (CRGBA*)dstvba.getColorPointer (vp);
@ -224,7 +224,7 @@ void CMeshMorpher::updateSkinned (std::vector<CAnimatedMorph> *pBSFactor)
if (_VBOri == NULL) if (_VBOri == NULL)
return; return;
if (BlendShapes.size() == 0) if (BlendShapes.empty())
return; return;
if (_VBOri->getNumVertices() != _VBDst->getNumVertices()) if (_VBOri->getNumVertices() != _VBDst->getNumVertices())
@ -292,21 +292,21 @@ void CMeshMorpher::updateSkinned (std::vector<CAnimatedMorph> *pBSFactor)
// Modify Pos/Norm/TgSpace. // Modify Pos/Norm/TgSpace.
//------------ //------------
if (_Vertices != NULL) if (_Vertices != NULL)
if (rBS.deltaPos.size() > 0) if (!rBS.deltaPos.empty())
{ {
CVector *pV = &(_Vertices->operator[](vp)); CVector *pV = &(_Vertices->operator[](vp));
*pV += rBS.deltaPos[j] * rFactor; *pV += rBS.deltaPos[j] * rFactor;
} }
if (_Normals != NULL) if (_Normals != NULL)
if (rBS.deltaNorm.size() > 0) if (!rBS.deltaNorm.empty())
{ {
CVector *pV = &(_Normals->operator[](vp)); CVector *pV = &(_Normals->operator[](vp));
*pV += rBS.deltaNorm[j] * rFactor; *pV += rBS.deltaNorm[j] * rFactor;
} }
if (_UseTgSpace && _TgSpace != NULL) if (_UseTgSpace && _TgSpace != NULL)
if (rBS.deltaTgSpace.size() > 0) if (!rBS.deltaTgSpace.empty())
{ {
CVector *pV = &((*_TgSpace)[vp]); CVector *pV = &((*_TgSpace)[vp]);
*pV += rBS.deltaTgSpace[j] * rFactor; *pV += rBS.deltaTgSpace[j] * rFactor;
@ -315,14 +315,14 @@ void CMeshMorpher::updateSkinned (std::vector<CAnimatedMorph> *pBSFactor)
// Modify UV0 / Color // Modify UV0 / Color
//------------ //------------
if (_VBDst->getVertexFormat() & CVertexBuffer::TexCoord0Flag) if (_VBDst->getVertexFormat() & CVertexBuffer::TexCoord0Flag)
if (rBS.deltaUV.size() > 0) if (!rBS.deltaUV.empty())
{ {
CUV *pUV = dstvba.getTexCoordPointer (vp); CUV *pUV = dstvba.getTexCoordPointer (vp);
*pUV += rBS.deltaUV[j] * rFactor; *pUV += rBS.deltaUV[j] * rFactor;
} }
if (_VBDst->getVertexFormat() & CVertexBuffer::PrimaryColorFlag) if (_VBDst->getVertexFormat() & CVertexBuffer::PrimaryColorFlag)
if (rBS.deltaCol.size() > 0) if (!rBS.deltaCol.empty())
{ {
// todo hulud d3d vertex color RGBA / BGRA // todo hulud d3d vertex color RGBA / BGRA
CRGBA *pRGBA = (CRGBA*)dstvba.getColorPointer (vp); CRGBA *pRGBA = (CRGBA*)dstvba.getColorPointer (vp);
@ -371,7 +371,7 @@ void CMeshMorpher::updateRawSkin (CVertexBuffer *vbOri,
if (vbOri == NULL) if (vbOri == NULL)
return; return;
if (BlendShapes.size() == 0) if (BlendShapes.empty())
return; return;
nlassert(vbOri->getVertexFormat() == (CVertexBuffer::PositionFlag | CVertexBuffer::NormalFlag |CVertexBuffer::TexCoord0Flag) ); nlassert(vbOri->getVertexFormat() == (CVertexBuffer::PositionFlag | CVertexBuffer::NormalFlag |CVertexBuffer::TexCoord0Flag) );

View file

@ -938,7 +938,7 @@ void CMeshMRMGeom::render(IDriver *drv, CTransformShape *trans, float polygonCou
skeleton = mi->getSkeletonModel(); skeleton = mi->getSkeletonModel();
// The mesh must not be skinned for render() // The mesh must not be skinned for render()
nlassert(!(_Skinned && mi->isSkinned() && skeleton)); nlassert(!(_Skinned && mi->isSkinned() && skeleton));
bool bMorphApplied = _MeshMorpher.BlendShapes.size() > 0; bool bMorphApplied = !_MeshMorpher.BlendShapes.empty();
bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace(); bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace();
@ -1146,7 +1146,7 @@ void CMeshMRMGeom::renderSkin(CTransformShape *trans, float alphaMRM)
skeleton = mi->getSkeletonModel(); skeleton = mi->getSkeletonModel();
// must be skinned for renderSkin() // must be skinned for renderSkin()
nlassert(_Skinned && mi->isSkinned() && skeleton); nlassert(_Skinned && mi->isSkinned() && skeleton);
bool bMorphApplied = _MeshMorpher.BlendShapes.size() > 0; bool bMorphApplied = !_MeshMorpher.BlendShapes.empty();
bool useNormal= (_VBufferFinal.getVertexFormat() & CVertexBuffer::NormalFlag)!=0; bool useNormal= (_VBufferFinal.getVertexFormat() & CVertexBuffer::NormalFlag)!=0;
bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace(); bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace();
@ -1312,7 +1312,7 @@ sint CMeshMRMGeom::renderSkinGroupGeom(CMeshMRMInstance *mi, float alphaMRM, uin
skeleton = mi->getSkeletonModel(); skeleton = mi->getSkeletonModel();
// must be skinned for renderSkin() // must be skinned for renderSkin()
nlassert(_Skinned && mi->isSkinned() && skeleton); nlassert(_Skinned && mi->isSkinned() && skeleton);
bool bMorphApplied = _MeshMorpher.BlendShapes.size() > 0; bool bMorphApplied = !_MeshMorpher.BlendShapes.empty();
bool useNormal= (_VBufferFinal.getVertexFormat() & CVertexBuffer::NormalFlag)!=0; bool useNormal= (_VBufferFinal.getVertexFormat() & CVertexBuffer::NormalFlag)!=0;
nlassert(useNormal); nlassert(useNormal);

View file

@ -304,7 +304,7 @@ void CMeshMRMSkinnedGeom::build(CMesh::CMeshBuild &m,
// No Blend Shapes // No Blend Shapes
//================================================ //================================================
nlassert (meshBuildMRM.BlendShapes.size() == 0); nlassert (meshBuildMRM.BlendShapes.empty());
// Compact bone id and build a bone id names // Compact bone id and build a bone id names
//================================================ //================================================

View file

@ -96,7 +96,7 @@ void CPointLightNamedArray::build(const std::vector<CPointLightNamed> &pointLi
// Regroup. // Regroup.
// --------- // ---------
_PointLightGroupMap.clear(); _PointLightGroupMap.clear();
if(_PointLights.size() > 0 ) if (!_PointLights.empty())
{ {
bool first= true; bool first= true;
string precName; string precName;

View file

@ -239,7 +239,7 @@ void CPSLocated::releaseAllRef()
// If this happen, you can register with the registerDTorObserver // If this happen, you can register with the registerDTorObserver
// (observer pattern) // (observer pattern)
// and override notifyTargetRemove to call releaseCollisionInfo // and override notifyTargetRemove to call releaseCollisionInfo
nlassert(_IntegrableForces.size() == 0); nlassert(_IntegrableForces.empty());
nlassert(_NonIntegrableForceNbRefs == 0); nlassert(_NonIntegrableForceNbRefs == 0);
CHECK_PS_INTEGRITY CHECK_PS_INTEGRITY
} }
@ -839,7 +839,7 @@ CPSLocated::~CPSLocated()
// If this happen, you can register with the registerDTorObserver // If this happen, you can register with the registerDTorObserver
// (observer pattern) // (observer pattern)
// and override notifyTargetRemove to call releaseCollisionInfo // and override notifyTargetRemove to call releaseCollisionInfo
nlassert(_IntegrableForces.size() == 0); nlassert(_IntegrableForces.empty());
nlassert(_NonIntegrableForceNbRefs == 0); nlassert(_NonIntegrableForceNbRefs == 0);
// delete all bindable // delete all bindable

View file

@ -1234,7 +1234,7 @@ bool CPSConstraintMesh::update(std::vector<sint> *numVertsVect /*= NULL*/)
uint numVerts = 0; uint numVerts = 0;
uint8 uvRouting[CVertexBuffer::MaxStage]; uint8 uvRouting[CVertexBuffer::MaxStage];
if (_MeshShapeFileName.size() == 0) if (_MeshShapeFileName.empty())
{ {
_MeshShapeFileName.resize(1); _MeshShapeFileName.resize(1);
_MeshShapeFileName[0] = DummyShapeName; _MeshShapeFileName[0] = DummyShapeName;
@ -1386,7 +1386,7 @@ bool CPSConstraintMesh::update(std::vector<sint> *numVertsVect /*= NULL*/)
_GlobalAnimDate = _Owner->getOwner()->getSystemDate(); _GlobalAnimDate = _Owner->getOwner()->getSystemDate();
_Touched = 0; _Touched = 0;
_ValidBuild = ok ? 1 : 0; _ValidBuild = ok ? 1 : 0;
nlassert(_Meshes.size() > 0); nlassert(!_Meshes.empty());
return ok; return ok;
@ -1491,7 +1491,7 @@ void CPSConstraintMesh::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{ {
if (!f.isReading()) if (!f.isReading())
{ {
if (_MeshShapeFileName.size() > 0) if (!_MeshShapeFileName.empty())
{ {
f.serial(_MeshShapeFileName[0]); f.serial(_MeshShapeFileName[0]);
} }
@ -1751,7 +1751,7 @@ void CPSConstraintMesh::draw(bool opaque)
_Owner->incrementNbDrawnParticles(numToProcess); // for benchmark purpose _Owner->incrementNbDrawnParticles(numToProcess); // for benchmark purpose
if (_PrecompBasis.size() == 0) /// do we deal with prerotated meshs ? if (_PrecompBasis.empty()) /// do we deal with prerotated meshs ?
{ {
if (step == (1 << 16)) if (step == (1 << 16))
{ {

View file

@ -753,7 +753,7 @@ bool CInstanceGroup::addToSceneWhenAllShapesLoaded (CScene& scene, IDriver *driv
for (i = 0; i < _Instances.size(); ++i) for (i = 0; i < _Instances.size(); ++i)
if (_Instances[i] != NULL && !_InstancesInfos[i].DontAddToScene) if (_Instances[i] != NULL && !_InstancesInfos[i].DontAddToScene)
{ {
if (_InstancesInfos[i].Clusters.size() > 0) if (!_InstancesInfos[i].Clusters.empty())
{ {
_Instances[i]->clipUnlinkFromAll(); _Instances[i]->clipUnlinkFromAll();
for (j = 0; j < _InstancesInfos[i].Clusters.size(); ++j) for (j = 0; j < _InstancesInfos[i].Clusters.size(); ++j)
@ -812,7 +812,7 @@ bool CInstanceGroup::addToSceneWhenAllShapesLoaded (CScene& scene, IDriver *driv
// Register the instanceGroup for light animation // Register the instanceGroup for light animation
// ----------------- // -----------------
// If some PointLight to animate // If some PointLight to animate
if(_PointLightArray.getPointLights().size() > 0) if(!_PointLightArray.getPointLights().empty())
scene.addInstanceGroupForLightAnimation(this); scene.addInstanceGroupForLightAnimation(this);
_AddToSceneState = StateAdded; _AddToSceneState = StateAdded;
@ -1040,7 +1040,7 @@ bool CInstanceGroup::removeFromScene (CScene& scene)
// UnRegister the instanceGroup for light animation // UnRegister the instanceGroup for light animation
// ----------------- // -----------------
// If some PointLight to animate // If some PointLight to animate
if(_PointLightArray.getPointLights().size() > 0) if(!_PointLightArray.getPointLights().empty())
scene.removeInstanceGroupForLightAnimation(this); scene.removeInstanceGroupForLightAnimation(this);
if (_AddRemoveInstance) if (_AddRemoveInstance)
@ -1117,7 +1117,7 @@ void CInstanceGroup::setClusterSystemForInstances(CInstanceGroup *pIG)
{ {
_ClusterSystemForInstances = pIG; _ClusterSystemForInstances = pIG;
for (uint32 i = 0; i < _Instances.size(); ++i) for (uint32 i = 0; i < _Instances.size(); ++i)
if (_Instances[i] && _InstancesInfos[i].Clusters.size() == 0) if (_Instances[i] && _InstancesInfos[i].Clusters.empty())
_Instances[i]->setClusterSystem (_ClusterSystemForInstances); _Instances[i]->setClusterSystem (_ClusterSystemForInstances);
} }

View file

@ -589,10 +589,7 @@ void CShapeBank::cancelLoadAsync (const std::string &shapeNameNotLwr)
bool CShapeBank::isShapeWaiting () bool CShapeBank::isShapeWaiting ()
{ {
if (WaitingShapes.size() == 0) return !WaitingShapes.empty();
return false;
else
return true;
} }
// *************************************************************************** // ***************************************************************************

View file

@ -78,7 +78,7 @@ uint32 CTextContext::textPush (const char *format, ...)
CComputedString csTmp; CComputedString csTmp;
_CacheStrings.push_back (csTmp); _CacheStrings.push_back (csTmp);
if (_CacheFreePlaces.size() == 0) if (_CacheFreePlaces.empty())
_CacheFreePlaces.resize (1); _CacheFreePlaces.resize (1);
_CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1; _CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1;
_CacheNbFreePlaces = 1; _CacheNbFreePlaces = 1;
@ -104,7 +104,7 @@ uint32 CTextContext::textPush (const ucstring &str)
CComputedString csTmp; CComputedString csTmp;
_CacheStrings.push_back (csTmp); _CacheStrings.push_back (csTmp);
if (_CacheFreePlaces.size() == 0) if (_CacheFreePlaces.empty())
_CacheFreePlaces.resize (1); _CacheFreePlaces.resize (1);
_CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1; _CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1;
_CacheNbFreePlaces = 1; _CacheNbFreePlaces = 1;

View file

@ -441,7 +441,7 @@ void CTileBank::cleanUnusedData ()
// *************************************************************************** // ***************************************************************************
CTileNoiseMap *CTileBank::getTileNoiseMap (uint tileNumber, uint tileSubNoise) CTileNoiseMap *CTileBank::getTileNoiseMap (uint tileNumber, uint tileSubNoise)
{ {
if (_DisplacementMap.size() == 0) if (_DisplacementMap.empty())
{ {
// it happens when serial a tile bank with version < 4 // it happens when serial a tile bank with version < 4
return NULL; return NULL;

View file

@ -2851,7 +2851,7 @@ bool CZoneLighter::isLightableShape(IShape &shape)
void CZoneLighter::lightShapes(uint zoneID, const CLightDesc& description) void CZoneLighter::lightShapes(uint zoneID, const CLightDesc& description)
{ {
/// compute light for the lightable shapes in the given zone /// compute light for the lightable shapes in the given zone
if (_LightableShapes.size() == 0) return; if (_LightableShapes.empty()) return;
uint numShapePerThread = 1 + ((uint)_LightableShapes.size() / _ProcessCount); uint numShapePerThread = 1 + ((uint)_LightableShapes.size() / _ProcessCount);
uint currShapeIndex = 0; uint currShapeIndex = 0;
@ -3785,7 +3785,7 @@ uint CZoneLighter::getAPatch (uint process)
nlassert(index < _PatchInfo.size()); nlassert(index < _PatchInfo.size());
if (access.value().size() == 0) if (access.value().empty())
// no more patches // no more patches
return 0xffffffff; return 0xffffffff;

View file

@ -214,7 +214,7 @@ bool CZoneManager::isWorkComplete (CZoneManager::SZoneManagerWork &rWork)
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void CZoneManager::clear() void CZoneManager::clear()
{ {
nlassert(_LoadingZones.size() == 0); nlassert(_LoadingZones.empty());
_LoadedZones.clear(); _LoadedZones.clear();
_RemovingZone = false; _RemovingZone = false;
} }

View file

@ -69,7 +69,7 @@ namespace NLGUI
string allparam = Params; string allparam = Params;
skipBlankAtStart (allparam); skipBlankAtStart (allparam);
string param = toLower (ParamName); string param = toLower (ParamName);
while (allparam.size() > 0) while (!allparam.empty())
{ {
std::string::size_type e = allparam.find('='); std::string::size_type e = allparam.find('=');
if (e == std::string::npos || e == 0) break; if (e == std::string::npos || e == 0) break;
@ -95,7 +95,7 @@ namespace NLGUI
{ {
string allparam = Params; string allparam = Params;
skipBlankAtStart (allparam); skipBlankAtStart (allparam);
while (allparam.size() > 0) while (!allparam.empty())
{ {
std::string::size_type e = allparam.find('='); std::string::size_type e = allparam.find('=');
if (e == std::string::npos || e == 0) break; if (e == std::string::npos || e == 0) break;

View file

@ -149,7 +149,7 @@ namespace NLGUI
} }
// The first type in display type struct is the default display type // The first type in display type struct is the default display type
if (_DispTypes.size() == 0) if (_DispTypes.empty())
{ {
SDisplayType dt; SDisplayType dt;
dt.Name = "default"; dt.Name = "default";

View file

@ -513,7 +513,7 @@ namespace NLGUI
// redirect, get the location and try browse again // redirect, get the location and try browse again
// we cant use curl redirection because 'addHTTPGetParams()' must be called on new destination // we cant use curl redirection because 'addHTTPGetParams()' must be called on new destination
std::string location(_CurlWWW->getLocationHeader()); std::string location(_CurlWWW->getLocationHeader());
if (location.size() > 0) if (!location.empty())
{ {
#ifdef LOG_DL #ifdef LOG_DL
nlwarning("(%s) request (%d) redirected to (len %d) '%s'", _Id.c_str(), _RedirectsRemaining, location.size(), location.c_str()); nlwarning("(%s) request (%d) redirected to (len %d) '%s'", _Id.c_str(), _RedirectsRemaining, location.size(), location.c_str());
@ -615,7 +615,7 @@ namespace NLGUI
} }
RunningCurls = NewRunningCurls; RunningCurls = NewRunningCurls;
#ifdef LOG_DL #ifdef LOG_DL
if (RunningCurls > 0 || Curls.size() > 0) if (RunningCurls > 0 || !Curls.empty())
nlwarning("(%s) RunningCurls %d, _Curls %d", _Id.c_str(), RunningCurls, Curls.size()); nlwarning("(%s) RunningCurls %d, _Curls %d", _Id.c_str(), RunningCurls, Curls.size());
#endif #endif
} }
@ -1628,7 +1628,7 @@ namespace NLGUI
// Action handler parameters : "name=group_html_id|form=id_of_the_form|submit_button=button_name" // Action handler parameters : "name=group_html_id|form=id_of_the_form|submit_button=button_name"
string param = "name=" + getId() + "|form=" + toString (_Forms.size()-1) + "|submit_button=" + name + "|submit_button_type=submit"; string param = "name=" + getId() + "|form=" + toString (_Forms.size()-1) + "|submit_button=" + name + "|submit_button_type=submit";
if (text.size() > 0) if (!text.empty())
{ {
// escape AH param separator // escape AH param separator
string tmp = text; string tmp = text;
@ -3805,7 +3805,7 @@ namespace NLGUI
CUrlParser uri(url); CUrlParser uri(url);
if (uri.hash.size() > 0) if (!uri.hash.empty())
{ {
// Anchor to scroll after page has loaded // Anchor to scroll after page has loaded
_UrlFragment = uri.hash; _UrlFragment = uri.hash;
@ -3951,7 +3951,7 @@ namespace NLGUI
void CGroupHTML::registerAnchor(CInterfaceElement* elm) void CGroupHTML::registerAnchor(CInterfaceElement* elm)
{ {
if (_AnchorName.size() > 0) if (!_AnchorName.empty())
{ {
for(uint32 i=0; i < _AnchorName.size(); ++i) for(uint32 i=0; i < _AnchorName.size(); ++i)
{ {
@ -5123,7 +5123,7 @@ namespace NLGUI
#endif #endif
// create <html> markup for image downloads // create <html> markup for image downloads
if (type.find("image/") == 0 && content.size() > 0) if (type.find("image/") == 0 && !content.empty())
{ {
try try
{ {

View file

@ -1063,7 +1063,7 @@ namespace NLGUI
{ {
// update the list size // update the list size
sint32 newH = _H + child->getH(); sint32 newH = _H + child->getH();
if (_Elements.size() > 0) if (!_Elements.empty())
newH += _Space; newH += _Space;
_H = newH; _H = newH;
@ -1077,7 +1077,7 @@ namespace NLGUI
{ {
// Update the list coords // Update the list coords
sint32 newW = _W + child->getW(); sint32 newW = _W + child->getW();
if (_Elements.size() > 0) if (!_Elements.empty())
newW += _Space; newW += _Space;
_W = newW; _W = newW;
@ -1412,7 +1412,7 @@ namespace NLGUI
void CGroupList::onTextChanged() void CGroupList::onTextChanged()
{ {
if( _Elements.size() == 0 ) if( _Elements.empty() )
return; return;
CElementInfo &e = _Elements[ 0 ]; CElementInfo &e = _Elements[ 0 ];

View file

@ -1212,7 +1212,7 @@ namespace NLGUI
{ {
// update the list size // update the list size
sint32 newH = _H + child->getH(); sint32 newH = _H + child->getH();
if (_Elements.size() > 0) if (!_Elements.empty())
newH += _Space; newH += _Space;
_H = newH; _H = newH;
@ -1226,7 +1226,7 @@ namespace NLGUI
{ {
// Update the list coords // Update the list coords
sint32 newW = _W + child->getW(); sint32 newW = _W + child->getW();
if (_Elements.size() > 0) if (!_Elements.empty())
newW += _Space; newW += _Space;
_W = newW; _W = newW;
@ -1456,7 +1456,7 @@ namespace NLGUI
void CGroupParagraph::onTextChanged() void CGroupParagraph::onTextChanged()
{ {
if( _Elements.size() == 0 ) if( _Elements.empty() )
return; return;
CElementInfo &e = _Elements[ 0 ]; CElementInfo &e = _Elements[ 0 ];

View file

@ -210,7 +210,7 @@ namespace NLGUI
static DECLARE_INTERFACE_USER_FCT(userFctIdentity) static DECLARE_INTERFACE_USER_FCT(userFctIdentity)
{ {
if (args.size() > 0) if (!args.empty())
{ {
result = args[0]; result = args[0];
return true; return true;
@ -354,9 +354,9 @@ namespace NLGUI
static DECLARE_INTERFACE_USER_FCT(userFctStr) static DECLARE_INTERFACE_USER_FCT(userFctStr)
{ {
if (args.size() > 0) if (!args.empty())
{ {
ucstring res(""); ucstring res;
for (uint32 i = 0; i < args.size(); ++i) for (uint32 i = 0; i < args.size(); ++i)
{ {
args[i].toString(); args[i].toString();

View file

@ -1003,7 +1003,7 @@ namespace NLGUI
{ {
string idTmp = id, lidTmp = lid; string idTmp = id, lidTmp = lid;
// bool isFound = true; // bool isFound = true;
while (idTmp.size() > 0) while (!idTmp.empty())
{ {
string tokid, toklid; string tokid, toklid;
@ -1782,7 +1782,7 @@ namespace NLGUI
{ {
// bool bUnder = // bool bUnder =
pChild->getViewsUnder (x, y, clipX, clipY, clipW, clipH, vVB); pChild->getViewsUnder (x, y, clipX, clipY, clipW, clipH, vVB);
// if (bUnder && (vICL.size() > 0)) // if (bUnder && !vICL.empty())
// return true; // return true;
} }
} }
@ -1837,7 +1837,7 @@ namespace NLGUI
{ {
// bool bUnder = // bool bUnder =
pChild->getCtrlsUnder (x, y, clipX, clipY, clipW, clipH, vICL); pChild->getCtrlsUnder (x, y, clipX, clipY, clipW, clipH, vICL);
// if (bUnder && (vICL.size() > 0)) // if (bUnder && !vICL.empty())
// return true; // return true;
} }
} }
@ -1893,7 +1893,7 @@ namespace NLGUI
{ {
// bool bUnder = // bool bUnder =
pChild->getGroupsUnder (x, y, clipX, clipY, clipW, clipH, vIGL); pChild->getGroupsUnder (x, y, clipX, clipY, clipW, clipH, vIGL);
// if (bUnder && (vICL.size() > 0)) // if (bUnder && !vICL.empty())
// return true; // return true;
} }
} }

View file

@ -668,7 +668,7 @@ namespace NLGUI
{ {
std::vector<CTargetInfo> vTargets; std::vector<CTargetInfo> vTargets;
splitLinkTargets(Target, pIG, vTargets); splitLinkTargets(Target, pIG, vTargets);
if ((vTargets.size() > 0) && (vTargets[0].Elem)) if (!vTargets.empty() && (vTargets[0].Elem))
{ {
vTargets[0].affect(val); vTargets[0].affect(val);
} }

View file

@ -673,7 +673,7 @@ namespace NLGUI
string NewProp; string NewProp;
string RepProp; string RepProp;
while (LastProp.size() > 0) while (!LastProp.empty())
{ {
string::size_type diesPos = LastProp.find("#"); string::size_type diesPos = LastProp.find("#");
if (diesPos != string::npos) if (diesPos != string::npos)

View file

@ -1520,7 +1520,7 @@ namespace NLGUI
CSString s = str; CSString s = str;
// Create table recursively (ex: 'game.TPVPClan' will check/create the table 'game' and 'game.TPVPClan') // Create table recursively (ex: 'game.TPVPClan' will check/create the table 'game' and 'game.TPVPClan')
p = s.splitTo('.', true); p = s.splitTo('.', true);
while (p.size() > 0) while (!p.empty())
{ {
if (path.empty() ) if (path.empty() )
path = p; path = p;

View file

@ -415,7 +415,7 @@ namespace NLGUI
} }
} }
if (_TexsId.size() == 0) if (_TexsId.empty())
{ {
for (i = 0; i < _Texs.size(); ++i) for (i = 0; i < _Texs.size(); ++i)
_TexsId.push_back(rVR.getTextureIdFromName(_Texs[i])); _TexsId.push_back(rVR.getTextureIdFromName(_Texs[i]));

View file

@ -241,7 +241,7 @@ namespace NLGUI
// *************************************************************************** // ***************************************************************************
NL3D::UTextContext* CViewRenderer::getTextContext(const std::string &name) NL3D::UTextContext* CViewRenderer::getTextContext(const std::string &name)
{ {
if (name.size() > 0 && fonts.count(name) > 0) if (!name.empty() && fonts.count(name) > 0)
return fonts[name]; return fonts[name];
return textcontext; return textcontext;
@ -257,7 +257,7 @@ namespace NLGUI
driver->deleteTextContext(fonts[name]); driver->deleteTextContext(fonts[name]);
std::string fontFile = CPath::lookup(font, false); std::string fontFile = CPath::lookup(font, false);
if (fontFile.size() == 0) if (fontFile.empty())
{ {
nlwarning("Font file '%s' not found", font.c_str()); nlwarning("Font file '%s' not found", font.c_str());
return false; return false;

View file

@ -898,7 +898,7 @@ namespace NLGUI
if ((_MultiLine)&&(_Parent != NULL)) if ((_MultiLine)&&(_Parent != NULL))
{ {
// If never setuped, and if text is not empty // If never setuped, and if text is not empty
if (_Lines.size() == 0 && !_Text.empty()) if (_Lines.empty() && !_Text.empty())
invalidateContent (); invalidateContent ();
sint currentMaxW= getCurrentMultiLineMaxW(); sint currentMaxW= getCurrentMultiLineMaxW();
@ -986,7 +986,7 @@ namespace NLGUI
// *** Draw multiline // *** Draw multiline
if ((_MultiLine)&&(_Parent != NULL)) if ((_MultiLine)&&(_Parent != NULL))
{ {
if (_Lines.size() == 0) return; if (_Lines.empty()) return;
TextContext->setHotSpot (UTextContext::BottomLeft); TextContext->setHotSpot (UTextContext::BottomLeft);
TextContext->setShaded (_Shadow); TextContext->setShaded (_Shadow);
@ -1669,7 +1669,7 @@ namespace NLGUI
{ {
if (expandSpaces) if (expandSpaces)
{ {
nlassert(_Lines.size() > 0); nlassert(!_Lines.empty());
nlassert(_Lines.back()->getNumWords() > 0); nlassert(_Lines.back()->getNumWords() > 0);
// Yoyo: if the line has tab, then don't justify // Yoyo: if the line has tab, then don't justify
@ -1876,7 +1876,7 @@ namespace NLGUI
} }
// Special case for multiline limited in number of lines // Special case for multiline limited in number of lines
if ((_Lines.size() > 0) && (_MultiMaxLine > 0) && (_Lines.size() > _MultiMaxLine)) if (!_Lines.empty() && (_MultiMaxLine > 0) && (_Lines.size() > _MultiMaxLine))
{ {
while (_Lines.size() > _MultiMaxLine) while (_Lines.size() > _MultiMaxLine)
{ {
@ -1905,7 +1905,7 @@ namespace NLGUI
_H = std::max(_H, sint(_FontHeight * _MultiMinLine + (_MultiMinLine - 1) * _MultiLineSpace)); _H = std::max(_H, sint(_FontHeight * _MultiMinLine + (_MultiMinLine - 1) * _MultiLineSpace));
// Compute tooltips size // Compute tooltips size
if (_Tooltips.size() > 0) if (!_Tooltips.empty())
for (uint i=0 ; i<_Lines.size() ; ++i) for (uint i=0 ; i<_Lines.size() ; ++i)
{ {
for (uint j=0 ; j<_Lines[i]->getNumWords() ; ++j) for (uint j=0 ; j<_Lines[i]->getNumWords() ; ++j)

View file

@ -3334,7 +3334,7 @@ namespace NLGUI
{ {
const CProcAction &action = proc.Actions[i]; const CProcAction &action = proc.Actions[i];
// test if the condition for the action is valid // test if the condition for the action is valid
if( action.CondBlocks.size() > 0 ) if (!action.CondBlocks.empty())
{ {
CInterfaceExprValue result; CInterfaceExprValue result;
result.setBool( false ); result.setBool( false );

View file

@ -337,7 +337,7 @@ bool CLogicConditionNode::testLogic()
} }
// if there's no subtree we assess the subtree is true // if there's no subtree we assess the subtree is true
if( _Nodes.size() == 0 ) if( _Nodes.empty() )
{ {
return true; return true;
} }

View file

@ -653,7 +653,7 @@ bool CBigFile::getFileInternal (const std::string &sFileName, BNP *&zeBnp, BNPFi
} }
BNP &rbnp = _BNPs.find (zeBigFileName)->second; BNP &rbnp = _BNPs.find (zeBigFileName)->second;
if (rbnp.Files.size() == 0) if (rbnp.Files.empty())
{ {
return false; return false;
} }
@ -746,7 +746,7 @@ char *CBigFile::getFileNamePtr(const std::string &sFileName, const std::string &
{ {
BNP &rbnp = _BNPs.find (bigfilenamealone)->second; BNP &rbnp = _BNPs.find (bigfilenamealone)->second;
vector<BNPFile>::iterator itNBPFile; vector<BNPFile>::iterator itNBPFile;
if (rbnp.Files.size() == 0) if (rbnp.Files.empty())
return NULL; return NULL;
string lwrFileName = toLower(sFileName); string lwrFileName = toLower(sFileName);

View file

@ -210,7 +210,7 @@ void CCDBNodeBranch::init( xmlNodePtr node, IProgressCallback &progressCallBack,
} }
else else
{ {
if ( _Nodes.size() > 0 ) if (!_Nodes.empty())
for ( _IdBits=1; _Nodes.size() > unsigned(1<<_IdBits) ; _IdBits++ ) {} for ( _IdBits=1; _Nodes.size() > unsigned(1<<_IdBits) ; _IdBits++ ) {}
else else
_IdBits = 0; _IdBits = 0;

View file

@ -666,7 +666,7 @@ NLMISC_CATEGORISED_COMMAND(nel,help,"display help on a specific variable/command
CCommandRegistry &cr = CCommandRegistry::getInstance(); CCommandRegistry &cr = CCommandRegistry::getInstance();
// treat the case where we have no parameters // treat the case where we have no parameters
if (args.size() == 0) if (args.empty())
{ {
// display a list of all command categories // display a list of all command categories
log.displayNL("Help commands:"); log.displayNL("Help commands:");

View file

@ -523,7 +523,7 @@ std::string timestampToHumanReadable(uint32 timestamp)
uint32 fromHumanReadable (const std::string &str) uint32 fromHumanReadable (const std::string &str)
{ {
if (str.size() == 0) if (str.empty())
return 0; return 0;
uint32 val; uint32 val;

View file

@ -1504,7 +1504,7 @@ NLMISC_CATEGORISED_COMMAND(nel, displayMemlog, "displays the last N line of the
{ {
uint nbLines; uint nbLines;
if (args.size() == 0) nbLines = 100; if (args.empty()) nbLines = 100;
else if (args.size() == 1) NLMISC::fromString(args[0], nbLines); else if (args.size() == 1) NLMISC::fromString(args[0], nbLines);
else return false; else return false;
@ -1528,7 +1528,7 @@ NLMISC_CATEGORISED_COMMAND(nel, displayMemlog, "displays the last N line of the
NLMISC_CATEGORISED_COMMAND(nel, resetFilters, "disable all filters on Nel loggers", "[debug|info|warning|error|assert]") NLMISC_CATEGORISED_COMMAND(nel, resetFilters, "disable all filters on Nel loggers", "[debug|info|warning|error|assert]")
{ {
if(args.size() == 0) if(args.empty())
{ {
DebugLog->resetFilters(); DebugLog->resetFilters();
InfoLog->resetFilters(); InfoLog->resetFilters();
@ -1568,7 +1568,7 @@ NLMISC_CATEGORISED_COMMAND(nel, addNegativeFilterDebug, "add a negative filter o
NLMISC_CATEGORISED_COMMAND(nel, removeFilterDebug, "remove a filter on DebugLog", "[<filterstr>]") NLMISC_CATEGORISED_COMMAND(nel, removeFilterDebug, "remove a filter on DebugLog", "[<filterstr>]")
{ {
if(args.size() == 0) if(args.empty())
DebugLog->removeFilter(); DebugLog->removeFilter();
else if(args.size() == 1) else if(args.size() == 1)
DebugLog->removeFilter( args[0].c_str() ); DebugLog->removeFilter( args[0].c_str() );
@ -1578,7 +1578,7 @@ NLMISC_CATEGORISED_COMMAND(nel, removeFilterDebug, "remove a filter on DebugLog"
NLMISC_CATEGORISED_COMMAND(nel, displayFilterDebug, "display filter on DebugLog", "") NLMISC_CATEGORISED_COMMAND(nel, displayFilterDebug, "display filter on DebugLog", "")
{ {
if(args.size() != 0) return false; if(!args.empty()) return false;
DebugLog->displayFilter(log); DebugLog->displayFilter(log);
return true; return true;
} }
@ -1599,7 +1599,7 @@ NLMISC_CATEGORISED_COMMAND(nel, addNegativeFilterInfo, "add a negative filter on
NLMISC_CATEGORISED_COMMAND(nel, removeFilterInfo, "remove a filter on InfoLog", "[<filterstr>]") NLMISC_CATEGORISED_COMMAND(nel, removeFilterInfo, "remove a filter on InfoLog", "[<filterstr>]")
{ {
if(args.size() == 0) if(args.empty())
InfoLog->removeFilter(); InfoLog->removeFilter();
else if(args.size() == 1) else if(args.size() == 1)
InfoLog->removeFilter( args[0].c_str() ); InfoLog->removeFilter( args[0].c_str() );
@ -1646,7 +1646,7 @@ NLMISC_CATEGORISED_COMMAND(nel, addNegativeFilterWarning, "add a negative filter
NLMISC_CATEGORISED_COMMAND(nel, removeFilterWarning, "remove a filter on WarningLog", "[<filterstr>]") NLMISC_CATEGORISED_COMMAND(nel, removeFilterWarning, "remove a filter on WarningLog", "[<filterstr>]")
{ {
if(args.size() == 0) if(args.empty())
WarningLog->removeFilter(); WarningLog->removeFilter();
else if(args.size() == 1) else if(args.size() == 1)
WarningLog->removeFilter( args[0].c_str() ); WarningLog->removeFilter( args[0].c_str() );
@ -1656,7 +1656,7 @@ NLMISC_CATEGORISED_COMMAND(nel, removeFilterWarning, "remove a filter on Warning
NLMISC_CATEGORISED_COMMAND(nel, displayFilterWarning, "display filter on WarningLog", "") NLMISC_CATEGORISED_COMMAND(nel, displayFilterWarning, "display filter on WarningLog", "")
{ {
if(args.size() != 0) return false; if(!args.empty()) return false;
WarningLog->displayFilter(log); WarningLog->displayFilter(log);
return true; return true;
} }

View file

@ -521,7 +521,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool
std::copy(currTimer->_Name, currTimer->_Name + (endIndex - startIndex), resultName.begin() + startIndex); std::copy(currTimer->_Name, currTimer->_Name + (endIndex - startIndex), resultName.begin() + startIndex);
} }
TNodeVect &execNodes = nodeMap[currTimer]; TNodeVect &execNodes = nodeMap[currTimer];
if (execNodes.size() > 0) if (!execNodes.empty())
{ {
currNodeStats.buildFromNodes(&execNodes[0], (uint)execNodes.size(), _MsPerTick); currNodeStats.buildFromNodes(&execNodes[0], (uint)execNodes.size(), _MsPerTick);
currNodeStats.getStats(resultStats, displayEx, rootStats.TotalTime, _WantStandardDeviation); currNodeStats.getStats(resultStats, displayEx, rootStats.TotalTime, _WantStandardDeviation);

View file

@ -1999,7 +1999,7 @@ float CPolygon2D::sumDPAgainstLine(float a, float b, float c) const
// ******************************************************************************* // *******************************************************************************
bool CPolygon2D::getNonNullSeg(uint &index) const bool CPolygon2D::getNonNullSeg(uint &index) const
{ {
nlassert(Vertices.size() > 0); nlassert(!Vertices.empty());
float bestLength = 0.f; float bestLength = 0.f;
sint bestIndex = -1; sint bestIndex = -1;
for (uint k = 0; k < Vertices.size() - 1; ++k) for (uint k = 0; k < Vertices.size() - 1; ++k)
@ -2046,7 +2046,7 @@ void CPolygon2D::getLineEquation(uint index, float &a, float &b, float &c) cons
// ******************************************************************************* // *******************************************************************************
bool CPolygon2D::intersect(const CPolygon2D &other) const bool CPolygon2D::intersect(const CPolygon2D &other) const
{ {
nlassert(other.Vertices.size() > 0); nlassert(!other.Vertices.empty());
uint nonNullSegIndex; uint nonNullSegIndex;
/// get the orientation of this poly /// get the orientation of this poly
if (getNonNullSeg(nonNullSegIndex)) if (getNonNullSeg(nonNullSegIndex))

View file

@ -136,7 +136,7 @@ TMsDuration CStopWatch::getDuration() const
*/ */
TMsDuration CStopWatch::getPartialAverage() const TMsDuration CStopWatch::getPartialAverage() const
{ {
if (_Queue.size() == 0) if (_Queue.empty())
return (TMsDuration)0; return (TMsDuration)0;
else else
return (TMsDuration)(CTime::ticksToSecond( accumulate( _Queue.begin(), _Queue.end(), 0 ) / _Queue.size() ) * 1000.0); return (TMsDuration)(CTime::ticksToSecond( accumulate( _Queue.begin(), _Queue.end(), 0 ) / _Queue.size() ) * 1000.0);

View file

@ -45,7 +45,7 @@ CStringMapper *CStringMapper::createLocalMapper()
// **************************************************************************** // ****************************************************************************
TStringId CStringMapper::localMap(const std::string &str) TStringId CStringMapper::localMap(const std::string &str)
{ {
if (str.size() == 0) if (str.empty())
return 0; return 0;
CAutoFastMutex automutex(&_Mutex); CAutoFastMutex automutex(&_Mutex);

View file

@ -782,13 +782,13 @@ void setInformation (const vector<string> &alarms, const vector<string> &graphup
for (i = 0; i < alarms.size(); i+=3) for (i = 0; i < alarms.size(); i+=3)
{ {
CVarPath shardvarpath (alarms[i]); CVarPath shardvarpath (alarms[i]);
if(shardvarpath.Destination.size() == 0 || shardvarpath.Destination[0].second.empty()) if(shardvarpath.Destination.empty() || shardvarpath.Destination[0].second.empty())
continue; continue;
CVarPath servervarpath (shardvarpath.Destination[0].second); CVarPath servervarpath (shardvarpath.Destination[0].second);
if(servervarpath.Destination.size() == 0 || servervarpath.Destination[0].second.empty()) if(servervarpath.Destination.empty() || servervarpath.Destination[0].second.empty())
continue; continue;
CVarPath servicevarpath (servervarpath.Destination[0].second); CVarPath servicevarpath (servervarpath.Destination[0].second);
if(servicevarpath.Destination.size() == 0 || servicevarpath.Destination[0].second.empty()) if(servicevarpath.Destination.empty() || servicevarpath.Destination[0].second.empty())
continue; continue;
string name = servicevarpath.Destination[0].second; string name = servicevarpath.Destination[0].second;
@ -817,13 +817,13 @@ void setInformation (const vector<string> &alarms, const vector<string> &graphup
for (i = 0; i < graphupdate.size(); i+=2) for (i = 0; i < graphupdate.size(); i+=2)
{ {
CVarPath shardvarpath (graphupdate[i]); CVarPath shardvarpath (graphupdate[i]);
if(shardvarpath.Destination.size() == 0 || shardvarpath.Destination[0].second.empty()) if(shardvarpath.Destination.empty() || shardvarpath.Destination[0].second.empty())
continue; continue;
CVarPath servervarpath (shardvarpath.Destination[0].second); CVarPath servervarpath (shardvarpath.Destination[0].second);
if(servervarpath.Destination.size() == 0 || servervarpath.Destination[0].second.empty()) if(servervarpath.Destination.empty() || servervarpath.Destination[0].second.empty())
continue; continue;
CVarPath servicevarpath (servervarpath.Destination[0].second); CVarPath servicevarpath (servervarpath.Destination[0].second);
if(servicevarpath.Destination.size() == 0 || servicevarpath.Destination[0].second.empty()) if(servicevarpath.Destination.empty() || servicevarpath.Destination[0].second.empty())
continue; continue;
string VarName = servicevarpath.Destination[0].second; string VarName = servicevarpath.Destination[0].second;

View file

@ -195,7 +195,7 @@ namespace NLNET
vector<string> parts; vector<string> parts;
NLMISC::explode(name, string("."), parts); NLMISC::explode(name, string("."), parts);
if (name.size() > 0) if (!name.empty())
{ {
// at least one part in the name // at least one part in the name
// check if sub ojbcct exist // check if sub ojbcct exist
@ -208,7 +208,7 @@ namespace NLNET
sub = SubParams.back(); sub = SubParams.back();
} }
if (name.size() > 0) if (!name.empty())
{ {
// name is more deep, need to resurse // name is more deep, need to resurse
parts.erase(parts.begin()); parts.erase(parts.begin());

View file

@ -128,7 +128,7 @@ void cbRegisterBroadcast (CMessage &msgin, TSockId /* from */, CCallbackNetBase
std::vector<CInetAddress> addrs; std::vector<CInetAddress> addrs;
CNamingClient::find (sid, addrs); CNamingClient::find (sid, addrs);
if (addrs.size() == 0) if (addrs.empty())
{ {
CNamingClient::RegisteredServicesMutex.enter (); CNamingClient::RegisteredServicesMutex.enter ();
CNamingClient::RegisteredServices.push_back (CNamingClient::CServiceEntry (name, sid, addr)); CNamingClient::RegisteredServices.push_back (CNamingClient::CServiceEntry (name, sid, addr));

View file

@ -116,7 +116,7 @@ void CUdpSimSock::sendUDP (const uint8 *buffer, uint32& len, const CInetAddress
CBufferizedOutPacket *bp = new CBufferizedOutPacket (&UdpSock, buffer, len, lag, addr); CBufferizedOutPacket *bp = new CBufferizedOutPacket (&UdpSock, buffer, len, lag, addr);
// duplicate the packet // duplicate the packet
if ((float)rand()/(float)(RAND_MAX)*100.0f < _OutPacketDisordering && _BufferizedOutPackets.size() > 0) if ((float)rand()/(float)(RAND_MAX)*100.0f < _OutPacketDisordering && !_BufferizedOutPackets.empty())
{ {
CBufferizedOutPacket *bp2 = _BufferizedOutPackets.back(); CBufferizedOutPacket *bp2 = _BufferizedOutPackets.back();

View file

@ -181,8 +181,8 @@ void CVarPath::decode ()
bool CVarPath::isFinal () bool CVarPath::isFinal ()
{ {
if(Destination.size() == 0) return true; if(Destination.empty()) return true;
if(Destination[0].second.size() == 0) return true; if(Destination[0].second.empty()) return true;
return false; return false;
} }

View file

@ -222,7 +222,7 @@ void CEdgeQuad::build(const CExteriorMesh &em,
TCollisionSurfaceDescVector cd = (*pcd); TCollisionSurfaceDescVector cd = (*pcd);
if (edges[i].Link != -1 && cd.size() > 0) if (edges[i].Link != -1 && !cd.empty())
{ {
nlwarning ("In NLPACS::CEdgeQuad::build()"); nlwarning ("In NLPACS::CEdgeQuad::build()");
nlwarning ("ERROR: exterior edge %d with interior link crosses some surfaces", i); nlwarning ("ERROR: exterior edge %d with interior link crosses some surfaces", i);

View file

@ -313,7 +313,7 @@ void NLPACS::CGlobalRetriever::getBorders(const CAABBox &sbox, std::vector<std::
chainType = 3; chainType = 3;
} }
if (retriever.getFullOrderedChains().size() > 0) if (!retriever.getFullOrderedChains().empty())
{ {
const COrderedChain3f &ochain = retriever.getFullOrderedChain(entry.OChainId); const COrderedChain3f &ochain = retriever.getFullOrderedChain(entry.OChainId);

View file

@ -2559,7 +2559,7 @@ void CAudioMixerUser::changeMaxTrack(uint maxTrack)
else else
{ {
vector<CTrack *> non_erasable; vector<CTrack *> non_erasable;
while (_Tracks.size() + non_erasable.size() > maxTrack && _Tracks.size() > 0) while (_Tracks.size() + non_erasable.size() > maxTrack && !_Tracks.empty())
{ {
CTrack *track = _Tracks.back(); CTrack *track = _Tracks.back();
_Tracks.pop_back(); _Tracks.pop_back();
@ -2588,7 +2588,7 @@ void CAudioMixerUser::changeMaxTrack(uint maxTrack)
non_erasable.push_back(track); non_erasable.push_back(track);
} }
} }
while (non_erasable.size() > 0) while (!non_erasable.empty())
{ {
// put non erasable back into track list // put non erasable back into track list
_Tracks.push_back(non_erasable.back()); _Tracks.push_back(non_erasable.back());

View file

@ -277,7 +277,7 @@ void CSoundBank::load(const std::string &packedSheetDir, bool packedSheetUpdate)
maxShortId = first->second.Sound->getName().getShortId(); maxShortId = first->second.Sound->getName().getShortId();
} }
++maxShortId; // inc for size = last idx + 1 ++maxShortId; // inc for size = last idx + 1
if (container.size() == 0) if (container.empty())
{ {
nlwarning("NLSOUND: No sound sheets have been loaded, missing sound sheet directory or packed sound sheets file"); nlwarning("NLSOUND: No sound sheets have been loaded, missing sound sheet directory or packed sound sheets file");
} }

View file

@ -161,14 +161,14 @@ void LoadSceneScript (const char *ScriptName, CScene* pScene, vector<SDispCS> &D
{ {
if (nLastNbPlus >= nNbPlus) if (nLastNbPlus >= nNbPlus)
for (int i = 0; i < ((nLastNbPlus-nNbPlus)+1); ++i) for (int i = 0; i < ((nLastNbPlus-nNbPlus)+1); ++i)
if (pile.size() > 0) if (!pile.empty())
pile.pop_back(); pile.pop_back();
nLastNbPlus = nNbPlus; nLastNbPlus = nNbPlus;
CInstanceGroup *father = pScene->getGlobalInstanceGroup(); CInstanceGroup *father = pScene->getGlobalInstanceGroup();
if (pile.size() > 0) if (!pile.empty())
father = pile.back(); father = pile.back();
CInstanceGroup *ITemp = LoadInstanceGroup (nameIG); CInstanceGroup *ITemp = LoadInstanceGroup (nameIG);
@ -338,7 +338,7 @@ int main(int argc, char **argv)
} }
++itAcc; ++itAcc;
} }
if ((vCluster.size() == 0) && (DispCS[0].pIG == pCurIG)) if (vCluster.empty() && (DispCS[0].pIG == pCurIG))
{ {
vCluster.push_back (pClipTrav->RootCluster); vCluster.push_back (pClipTrav->RootCluster);
} }

View file

@ -644,7 +644,7 @@ int main(int nNbArg, char **ppArgs)
} }
} }
if (AllLightmapNames.size() == 0) if (AllLightmapNames.empty())
continue; continue;
// Load all the lightmaps // Load all the lightmaps

View file

@ -2583,7 +2583,7 @@ void CObjectViewer::evalSoundTrack (float lastTime, float currentTime)
for (uint i = 0; i < _ListInstance.size(); i++) for (uint i = 0; i < _ListInstance.size(); i++)
{ {
// Some animation in the list ? // Some animation in the list ?
if (_ListInstance[i]->Saved.PlayList.size() > 0) if (!_ListInstance[i]->Saved.PlayList.empty())
{ {
// Accumul time // Accumul time
float startTime = 0; float startTime = 0;

View file

@ -298,7 +298,7 @@ void CSoundAnimView::refresh(BOOL update)
CInstanceInfo *instanceInfo = _ObjView->getInstance(selected); CInstanceInfo *instanceInfo = _ObjView->getInstance(selected);
// Some animation in the list ? // Some animation in the list ?
if (instanceInfo->Saved.PlayList.size() > 0) if (!instanceInfo->Saved.PlayList.empty())
{ {
// Accumul time // Accumul time
float startTime = 0; float startTime = 0;

View file

@ -713,7 +713,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP
// Get the nodes // Get the nodes
std::vector<INode*> vectNode; std::vector<INode*> vectNode;
theCNelExport.getSelectedNode (vectNode); theCNelExport.getSelectedNode (vectNode);
if (vectNode.size() == 0) if (vectNode.empty())
{ {
::MessageBox(hWnd, _T("No nodes selected"), _T("Error"), MB_OK|MB_ICONEXCLAMATION); ::MessageBox(hWnd, _T("No nodes selected"), _T("Error"), MB_OK|MB_ICONEXCLAMATION);
return ret; return ret;

View file

@ -43,7 +43,7 @@ bool CNelExport::exportCollision (const std::string &sPath, std::vector<INode *>
// ULONG SelectDir(HWND Parent, char* Title, char* Path); // ULONG SelectDir(HWND Parent, char* Title, char* Path);
std::string path = std::string(sPath); std::string path = std::string(sPath);
if (path.size() == 0 || path[path.size()-1] != '\\' && path[path.size()-1] != '/') if (path.empty() || path[path.size()-1] != '\\' && path[path.size()-1] != '/')
path.insert(path.end(), '/'); path.insert(path.end(), '/');
if (meshBuildList.empty()) return true; if (meshBuildList.empty()) return true;

View file

@ -2063,7 +2063,7 @@ void sans_majuscule_au_debut_LinkToObjectAround (CMesh::CMeshBuild *pMB, CMeshBa
} }
} }
if (ivert.size() > 0) if (!ivert.empty())
{ {
// Get all faces that contains at least one shared vertex // Get all faces that contains at least one shared vertex
for (k = 0; k < wrt.vMB[i]->Faces.size(); ++k) for (k = 0; k < wrt.vMB[i]->Faces.size(); ++k)
@ -2258,7 +2258,7 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB
// Bubble sort pointer to the faces (Material sorting) // Bubble sort pointer to the faces (Material sorting)
ClearFaceWithNoLM( pMB, pMBB, AllFaces ); ClearFaceWithNoLM( pMB, pMBB, AllFaces );
if( AllFaces.size() == 0 ) if( AllFaces.empty() )
{ {
if (InfoLog) if (InfoLog)
InfoLog->display("CalculateLM : %d ms\n", timeGetTime()-t); InfoLog->display("CalculateLM : %d ms\n", timeGetTime()-t);

View file

@ -246,7 +246,7 @@ CRGBAF CRTWorld::raytrace (NLMISC::CVector &vVertex, sint32 nLightNb, uint8& rtV
RayOfLight.clip (t); RayOfLight.clip (t);
if (RayOfLight.Shapes.size() == 0) if (RayOfLight.Shapes.empty())
return CRGBAF(0.0f, 0.0f, 0.0f, 0.0f); return CRGBAF(0.0f, 0.0f, 0.0f, 0.0f);
// Next selected element // Next selected element

View file

@ -648,7 +648,7 @@ static bool BuildMeshInterfaces(const char *cMaxFileName, std::vector<CMeshInter
std::inserter(mergedNodes, mergedNodes.begin()) std::inserter(mergedNodes, mergedNodes.begin())
); );
if (mergedNodes.size() == 0) if (mergedNodes.empty())
{ {
nlwarning("Couldn't find interface : %s", maxFileName.c_str()); nlwarning("Couldn't find interface : %s", maxFileName.c_str());
} }

View file

@ -501,8 +501,8 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector<INode*>& vectNode, v
} }
// debug purpose : to remove // debug purpose : to remove
if (vClusters.size() > 0) if (!vClusters.empty())
if (aIGArray[nNumIG].Clusters.size() == 0) if (aIGArray[nNumIG].Clusters.empty())
{ {
nlwarning("ERROR: Object %s is not attached to any cluster\nbut his flag clusterize is set", tStrToUtf8(pNode->GetName()).c_str()); nlwarning("ERROR: Object %s is not attached to any cluster\nbut his flag clusterize is set", tStrToUtf8(pNode->GetName()).c_str());
} }

View file

@ -382,7 +382,7 @@ void scanFiles(const CSString &filespec)
UFormElm *fieldForm=NULL; UFormElm *fieldForm=NULL;
std::string valueString; std::string valueString;
form->getRootNode ().getNodeByName(&fieldForm, fields[i]._name.c_str()); form->getRootNode ().getNodeByName(&fieldForm, fields[i]._name);
if (fieldForm) if (fieldForm)
{ {
@ -1026,7 +1026,7 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType
const UFormElm *fieldForm=NULL; const UFormElm *fieldForm=NULL;
if (rootForm.getNodeByName(&fieldForm, var.c_str())) if (rootForm.getNodeByName(&fieldForm, var))
{ {
UFormDfn *dfnForm=const_cast<UFormElm&>(rootForm).getStructDfn(); UFormDfn *dfnForm=const_cast<UFormElm&>(rootForm).getStructDfn();
nlassert(dfnForm); nlassert(dfnForm);

View file

@ -1420,7 +1420,7 @@ void NLPACS::CZoneTessellation::compile()
bool force = false; bool force = false;
if (surf.Area < 30.0f && surf.Elements.size() > 0) if (surf.Area < 30.0f && !surf.Elements.empty())
{ {
uint i; uint i;
CAABBox aabbox; CAABBox aabbox;
@ -1688,7 +1688,7 @@ CAABBox NLPACS::CZoneTessellation::computeBBox() const
bool set = false; bool set = false;
uint i; uint i;
if (_Vertices.size() == 0) if (_Vertices.empty())
return zbox; return zbox;
zbox.setCenter(_Vertices[0]); zbox.setCenter(_Vertices[0]);

View file

@ -1503,7 +1503,7 @@ void CCharacterCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycl
// Retrieve the right sheet for clothes. // Retrieve the right sheet for clothes.
_ClothesSheet = _Sheet; _ClothesSheet = _Sheet;
if(_Sheet->IdAlternativeClothes.size() > 0) if(!_Sheet->IdAlternativeClothes.empty())
{ {
sint32 num = rnd.rand()%(_Sheet->IdAlternativeClothes.size()+1); sint32 num = rnd.rand()%(_Sheet->IdAlternativeClothes.size()+1);
if(num > 0) if(num > 0)
@ -1531,7 +1531,7 @@ void CCharacterCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycl
else else
_HairColor = (sint8)altLookProp.Element.ColorHair%SheetMngr.nbHairColor(); _HairColor = (sint8)altLookProp.Element.ColorHair%SheetMngr.nbHairColor();
// Hair Index // Hair Index
if(_Sheet->HairItemList.size() > 0) if(!_Sheet->HairItemList.empty())
{ {
sint32 num = rnd.rand()%_Sheet->HairItemList.size(); sint32 num = rnd.rand()%_Sheet->HairItemList.size();
if(num>=0 && num <_BadHairIndex) if(num>=0 && num <_BadHairIndex)
@ -10279,7 +10279,7 @@ NLMISC_COMMAND(pvpMode, "modify pvp mode", "[<pvp mode> <state>]")
if (!playerTarget) if (!playerTarget)
return false; return false;
if( args.size() == 0 ) if (args.empty())
{ {
uint16 pvpMode = playerTarget->getPvpMode(); uint16 pvpMode = playerTarget->getPvpMode();
string str; string str;

View file

@ -541,7 +541,7 @@ void CAnimationSetSheet::build(const NLGEORGES::UFormElm &rootElmt)
nlinfo("%2d state '%s' :", i, stateName.c_str()); nlinfo("%2d state '%s' :", i, stateName.c_str());
const UFormElm *elmt = 0; const UFormElm *elmt = 0;
if(rootElmt.getNodeByName(&elmt, stateName.c_str())) if(rootElmt.getNodeByName(&elmt, stateName))
{ {
bool animPresent = false; bool animPresent = false;
if(elmt) if(elmt)

View file

@ -62,7 +62,7 @@ void CMissionSheet::build(const NLGEORGES::UFormElm &item)
{ {
const UFormElm * stepStruct; const UFormElm * stepStruct;
string varName = string("step") + NLMISC::toString(i); string varName = string("step") + NLMISC::toString(i);
item.getNodeByName (&stepStruct, varName.c_str()); item.getNodeByName (&stepStruct, varName);
if (stepStruct) if (stepStruct)
{ {

View file

@ -171,7 +171,7 @@ NLMISC_COMMAND(follow, "Follow the target", "")
NLMISC_COMMAND(where, "Ask information on the position", "") NLMISC_COMMAND(where, "Ask information on the position", "")
{ {
// Check parameters. // Check parameters.
if(args.size() == 0) if(args.empty())
{ // Create the message and send. { // Create the message and send.
const string msgName = "COMMAND:WHERE"; const string msgName = "COMMAND:WHERE";
CBitMemStream out; CBitMemStream out;
@ -212,7 +212,7 @@ NLMISC_COMMAND(who, "Display all players currently in region","[<options (GM, ch
NLMISC_COMMAND(afk, "Set the player as 'away from keyboard'","[<custom text>]") NLMISC_COMMAND(afk, "Set the player as 'away from keyboard'","[<custom text>]")
{ {
string customText; string customText;
if( args.size() > 0 ) if (!args.empty())
{ {
customText = args[0]; customText = args[0];
} }
@ -738,7 +738,7 @@ NLMISC_COMMAND(bugReport, "Call the bug report tool with dump", "<AddScreenshot>
NLMISC_COMMAND(a, "Execute an admin command on you","<cmd> <arg>") NLMISC_COMMAND(a, "Execute an admin command on you","<cmd> <arg>")
{ {
if(args.size() == 0) if(args.empty())
return false; return false;
CBitMemStream out; CBitMemStream out;
@ -782,7 +782,7 @@ NLMISC_COMMAND(a, "Execute an admin command on you","<cmd> <arg>")
NLMISC_COMMAND(b, "Execute an admin command on your target","<cmd> <arg>") NLMISC_COMMAND(b, "Execute an admin command on your target","<cmd> <arg>")
{ {
if(args.size() == 0) if(args.empty())
return false; return false;
CBitMemStream out; CBitMemStream out;
@ -873,7 +873,7 @@ NLMISC_COMMAND(boxes, "Show/Hide selection boxes", "[<state> : 0 to Hide, anythi
#endif // FINAL_VERSION #endif // FINAL_VERSION
// Invert Current State // Invert Current State
if(args.size() == 0) if(args.empty())
{ {
// Invert the current value. // Invert the current value.
ClientCfg.DrawBoxes = !ClientCfg.DrawBoxes; ClientCfg.DrawBoxes = !ClientCfg.DrawBoxes;
@ -1323,7 +1323,7 @@ NLMISC_COMMAND(setMissingDynstringText, "set text of missing dynamic string"," <
NLMISC_COMMAND(ah, "Launch an action handler", "<ActionHandler> <AHparam>") NLMISC_COMMAND(ah, "Launch an action handler", "<ActionHandler> <AHparam>")
{ {
if (args.size() == 0) if (args.empty())
return false; return false;
if (!ClientCfg.AllowDebugLua && toLower(args[0]) == "lua") if (!ClientCfg.AllowDebugLua && toLower(args[0]) == "lua")
@ -2716,7 +2716,7 @@ NLMISC_COMMAND(particle, "Create a particule at the user position (play FireWork
string fn; string fn;
// Check parameters. // Check parameters.
if(args.size() == 0) if(args.empty())
{ {
fn = "FireWorkA_with_sound.ps"; fn = "FireWorkA_with_sound.ps";
} }
@ -3749,6 +3749,23 @@ NLMISC_COMMAND(test, "", "")
return true; return true;
} }
NLMISC_COMMAND(testLongBubble, "To display a bubble with a long text", "<entity>")
{
if (args.size() != 1) return false;
uint entityId;
fromString(args[0], entityId);
CInterfaceManager *pIM = CInterfaceManager::getInstance();
ucstring text = "test\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n";
uint duration = CWidgetManager::getInstance()->getSystemOption(CWidgetManager::OptionTimeoutBubbles).getValSInt32();
CEntityCL *entity = EntitiesMngr.entity(entityId);
if (entity)
InSceneBubbleManager.chatOpen(entity->dataSetId(), text, duration);
return true;
}
//----------------------------------------------- //-----------------------------------------------
/// Macro to set the new dist to front(back or side) for a given sheet. /// Macro to set the new dist to front(back or side) for a given sheet.
@ -5737,7 +5754,7 @@ NLMISC_COMMAND(em, "emote command", "<emote phrase>")
if( pIM ) if( pIM )
{ {
string emotePhrase; string emotePhrase;
if( args.size() > 0 ) if (!args.empty())
{ {
emotePhrase = args[0]; emotePhrase = args[0];
} }
@ -5762,7 +5779,7 @@ NLMISC_COMMAND(guildmotd, "Set or see the guild message of the day","<msg of the
return false; return false;
string gmotd; string gmotd;
if( args.size() > 0 ) if (!args.empty())
{ {
gmotd = args[0]; gmotd = args[0];
} }

View file

@ -396,7 +396,7 @@ void CContinentManager::select(const CVectorD &pos, NLMISC::IProgressCallback &p
{ {
CContinent *pCont = it->second; CContinent *pCont = it->second;
nlinfo("Looking into %s", pCont->SheetName.c_str()); nlinfo("Looking into %s", pCont->SheetName.c_str());
if (pCont->Zone.VPoints.size() > 0) // Patch because some continent have not been done yet if (!pCont->Zone.VPoints.empty()) // Patch because some continent have not been done yet
{ {
if (pCont->Zone.contains(fPos)) if (pCont->Zone.contains(fPos))
{ {

View file

@ -64,7 +64,7 @@ public:
static NLMISC::CVector2f getZoneCenter(const NLLIGO::CPrimZone &z) static NLMISC::CVector2f getZoneCenter(const NLLIGO::CPrimZone &z)
{ {
NLMISC::CVector2f vMin, vMax; NLMISC::CVector2f vMin, vMax;
if (z.VPoints.size() == 0) if (z.VPoints.empty())
return NLMISC::CVector2f(0,0); return NLMISC::CVector2f(0,0);
vMin = vMax = z.VPoints[0]; vMin = vMax = z.VPoints[0];
for (uint32 i = 1; i < z.VPoints.size(); ++i) for (uint32 i = 1; i < z.VPoints.size(); ++i)

View file

@ -233,7 +233,7 @@ void CDoorManager::SDoor::checkToClose()
} }
} }
if (Entities.size() == 0) if (Entities.empty())
close(); close();
else else
open(); open();

View file

@ -780,7 +780,7 @@ class CHandlerOpenTitleHelp : public IActionHandler
if (pTU != NULL) if (pTU != NULL)
{ {
sSkillsNeeded = CI18N::get("uiTitleSkillHeader"); sSkillsNeeded = CI18N::get("uiTitleSkillHeader");
if (pTU->SkillsNeeded.size() == 0 || reservedTitle) if (pTU->SkillsNeeded.empty() || reservedTitle)
{ {
sSkillsNeeded += CI18N::get("uiTitleSkillNoNeed"); sSkillsNeeded += CI18N::get("uiTitleSkillNoNeed");
} }
@ -821,7 +821,7 @@ class CHandlerOpenTitleHelp : public IActionHandler
if (pTU != NULL) if (pTU != NULL)
{ {
sBricksNeeded = CI18N::get("uiTitleBrickHeader"); sBricksNeeded = CI18N::get("uiTitleBrickHeader");
if (pTU->BricksNeeded.size() == 0 || reservedTitle) if (pTU->BricksNeeded.empty() || reservedTitle)
{ {
sBricksNeeded += CI18N::get("uiTitleBrickNoNeed"); sBricksNeeded += CI18N::get("uiTitleBrickNoNeed");
} }

View file

@ -1656,7 +1656,7 @@ DECLARE_INTERFACE_CONSTANT(getPhraseBrickSelectionMax, CDBGroupBuildPhrase::MaxS
// Get the UC name of a phraseId // Get the UC name of a phraseId
static DECLARE_INTERFACE_USER_FCT(getSPhraseName) static DECLARE_INTERFACE_USER_FCT(getSPhraseName)
{ {
if (args.size() > 0) if (!args.empty())
{ {
if(!args[0].toInteger()) if(!args[0].toInteger())
return false; return false;

View file

@ -1265,7 +1265,7 @@ public:
if (pEB == NULL) return; if (pEB == NULL) return;
ucstring text = pEB->getInputString(); ucstring text = pEB->getInputString();
// If the line is empty, do nothing // If the line is empty, do nothing
if(text.size() == 0) if(text.empty())
return; return;

View file

@ -190,7 +190,7 @@ struct CWebigNotificationThread : public NLMISC::IRunnable
// Update the mail notification icon // Update the mail notification icon
uint32 nbmail = 0; uint32 nbmail = 0;
if(notifs.size() > 0 && fromString(notifs[0], nbmail)) if(!notifs.empty() && fromString(notifs[0], nbmail))
{ {
//nlinfo("nb mail is a number %d", nbmail); //nlinfo("nb mail is a number %d", nbmail);
CInterfaceManager *pIM = CInterfaceManager::getInstance(); CInterfaceManager *pIM = CInterfaceManager::getInstance();

View file

@ -473,7 +473,7 @@ void CGroupInSceneBubbleManager::update ()
CGroupInSceneBubble *CGroupInSceneBubbleManager::newBubble (const ucstring &text) CGroupInSceneBubble *CGroupInSceneBubbleManager::newBubble (const ucstring &text)
{ {
if (!text.empty() && _Bubbles.size ()) if (!text.empty() && !_Bubbles.empty())
{ {
// Get a bubble // Get a bubble
CGroupInSceneBubble *bubble = _Bubbles[_CurrentBubble]; CGroupInSceneBubble *bubble = _Bubbles[_CurrentBubble];

View file

@ -1231,13 +1231,13 @@ void CGroupMap::checkCoords()
NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:RESPAWN_PT")->setValue32(_RespawnSelected); NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:RESPAWN_PT")->setValue32(_RespawnSelected);
else if (_MapMode == MapMode_SpawnSquad) else if (_MapMode == MapMode_SpawnSquad)
NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:SQUAD_RESPAWN_PT")->setValue32(_RespawnSelected); NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:SQUAD_RESPAWN_PT")->setValue32(_RespawnSelected);
if (_RespawnLM.size() > 0) if (!_RespawnLM.empty())
_RespawnSelectedBitmap->setParentPos(_RespawnLM[_RespawnSelected]); _RespawnSelectedBitmap->setParentPos(_RespawnLM[_RespawnSelected]);
} }
else else
{ {
_RespawnSelected = getRespawnSelected(); _RespawnSelected = getRespawnSelected();
if (_RespawnLM.size() > 0) if (!_RespawnLM.empty())
_RespawnSelectedBitmap->setParentPos(_RespawnLM[_RespawnSelected]); _RespawnSelectedBitmap->setParentPos(_RespawnLM[_RespawnSelected]);
} }
} }
@ -3030,7 +3030,7 @@ void CGroupMap::addRespawnPoints(const CRespawnPointsMsg &rpm)
// Choose the good map ! (select the first respawn point and check for first matching bounding box map // Choose the good map ! (select the first respawn point and check for first matching bounding box map
if (_MapMode != MapMode_Death) return; if (_MapMode != MapMode_Death) return;
if (_RespawnPos.size() == 0) return; if (_RespawnPos.empty()) return;
CWorldSheet *pWS = dynamic_cast<CWorldSheet*>(SheetMngr.get(CSheetId("ryzom.world"))); CWorldSheet *pWS = dynamic_cast<CWorldSheet*>(SheetMngr.get(CSheetId("ryzom.world")));
if (pWS == NULL) return; if (pWS == NULL) return;
@ -3113,7 +3113,7 @@ sint32 CGroupMap::getRespawnSelected() const
//========================================================================================================= //=========================================================================================================
void CGroupMap::setRespawnSelected(sint32 nSpawnPointIndex) void CGroupMap::setRespawnSelected(sint32 nSpawnPointIndex)
{ {
if (_RespawnPos.size() == 0) return; if (_RespawnPos.empty()) return;
if (nSpawnPointIndex < 0) return; if (nSpawnPointIndex < 0) return;
if ((uint32)nSpawnPointIndex >= _RespawnPos.size()) return; if ((uint32)nSpawnPointIndex >= _RespawnPos.size()) return;
CInterfaceManager *pIM = CInterfaceManager::getInstance(); CInterfaceManager *pIM = CInterfaceManager::getInstance();

View file

@ -409,7 +409,7 @@ void CGuildManager::update()
} }
// Search for UserEntity to find our own grade // Search for UserEntity to find our own grade
if ((UserEntity != NULL) && (_GuildMembers.size() > 0)) if ((UserEntity != NULL) && (!_GuildMembers.empty()))
{ {
uint i; uint i;
_Grade = EGSPD::CGuildGrade::Member; _Grade = EGSPD::CGuildGrade::Member;

View file

@ -323,7 +323,7 @@ bool CInterface3DScene::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
} }
// If no camera create the default one // If no camera create the default one
if (_Cameras.size() == 0) if (_Cameras.empty())
{ {
CInterface3DCamera *pCam = new CInterface3DCamera; CInterface3DCamera *pCam = new CInterface3DCamera;
_Cameras.push_back(pCam); _Cameras.push_back(pCam);
@ -494,7 +494,7 @@ void CInterface3DScene::draw ()
cam.lookAt (pos, pI3DCam->getTarget(), pI3DCam->getRoll() * (float) (NLMISC::Pi / 180)); cam.lookAt (pos, pI3DCam->getTarget(), pI3DCam->getRoll() * (float) (NLMISC::Pi / 180));
uint i; uint i;
if (_IGs.size() > 0) if (!_IGs.empty())
{ {
for (i = 0; i < _Characters.size(); ++i) for (i = 0; i < _Characters.size(); ++i)
_Characters[i]->setClusterSystem (_IGs[_CurrentCS]->getIG()); _Characters[i]->setClusterSystem (_IGs[_CurrentCS]->getIG());

View file

@ -3169,7 +3169,7 @@ void CInterfaceManager::uninitEmotes()
// reset the emotes menu // reset the emotes menu
CTextEmotListSheet *pTELS = dynamic_cast<CTextEmotListSheet*>(SheetMngr.get(CSheetId("list.text_emotes"))); CTextEmotListSheet *pTELS = dynamic_cast<CTextEmotListSheet*>(SheetMngr.get(CSheetId("list.text_emotes")));
if (pTELS != NULL && pTELS->TextEmotList.size() > 0) if (pTELS != NULL && !pTELS->TextEmotList.empty())
{ {
// get the emotes menu id // get the emotes menu id
string sPath = pTELS->TextEmotList[0].Path; string sPath = pTELS->TextEmotList[0].Path;
@ -3211,7 +3211,7 @@ void CInterfaceManager::updateEmotes()
bool CInterfaceManager::CEmoteCmd::execute(const std::string &/* rawCommandString */, const vector<string> &args, CLog &/* log */, bool /* quiet */, bool /* human */) bool CInterfaceManager::CEmoteCmd::execute(const std::string &/* rawCommandString */, const vector<string> &args, CLog &/* log */, bool /* quiet */, bool /* human */)
{ {
string customPhrase; string customPhrase;
if( args.size() > 0 ) if (!args.empty())
{ {
customPhrase = args[0]; customPhrase = args[0];
} }
@ -3817,7 +3817,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
vector<ucstring> token_vector; vector<ucstring> token_vector;
vector<ucstring> param_vector; vector<ucstring> param_vector;
splitUCString(token_string, ucstring("."), token_vector); splitUCString(token_string, ucstring("."), token_vector);
if (token_vector.size() == 0) if (token_vector.empty())
{ {
// Wrong formatting; give up on this one. // Wrong formatting; give up on this one.
start_pos = end_pos; start_pos = end_pos;
@ -3827,7 +3827,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
if (token_vector.size() == 1) if (token_vector.size() == 1)
{ {
splitUCString(token_subject, ucstring("/"), param_vector); splitUCString(token_subject, ucstring("/"), param_vector);
token_subject = (param_vector.size() > 0) ? param_vector[0] : ucstring(""); token_subject = !param_vector.empty() ? param_vector[0] : ucstring("");
token_param = ucstring("name"); token_param = ucstring("name");
} }
else if (token_vector.size() > 1) else if (token_vector.size() > 1)
@ -3836,7 +3836,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
if (token_param.luabind_substr(0, 3) != ucstring("gs(")) if (token_param.luabind_substr(0, 3) != ucstring("gs("))
{ {
splitUCString(token_vector[1], ucstring("/"), param_vector); splitUCString(token_vector[1], ucstring("/"), param_vector);
token_param = (param_vector.size() > 0) ? param_vector[0] : ucstring(""); token_param = !param_vector.empty() ? param_vector[0] : ucstring("");
} }
} }

View file

@ -60,7 +60,7 @@ void CItemSpecialEffectHelper::registerItemSpecialEffect(const string &name)
// %r : real // %r : real
// %s : string // %s : string
p = s.splitTo('%', true); p = s.splitTo('%', true);
while (p.size() > 0 && s.size() > 0) while (!p.empty() && !s.empty())
{ {
if (s[0] == 'p' || s[0] == 'n' || s[0] == 'r' || s[0] == 's') if (s[0] == 'p' || s[0] == 'n' || s[0] == 'r' || s[0] == 's')
{ {

View file

@ -365,7 +365,7 @@ void CLuaIHMRyzom::createLuaEnumTable(CLuaState &ls, const std::string &str)
// Create table recursively (ex: 'game.TPVPClan' will check/create the table 'game' and 'game.TPVPClan') // Create table recursively (ex: 'game.TPVPClan' will check/create the table 'game' and 'game.TPVPClan')
p = s.splitTo('.', true); p = s.splitTo('.', true);
while (p.size() > 0) while (!p.empty())
{ {
if (path.empty()) if (path.empty())
path = p; path = p;
@ -2917,7 +2917,7 @@ ucstring CLuaIHMRyzom::replacePvpEffectParam(const ucstring &str, sint32 paramet
// Locate parameter and store it // Locate parameter and store it
p = s.splitTo('%', true); p = s.splitTo('%', true);
while (p.size() > 0 && s.size() > 0) while (!p.empty() && !s.empty())
{ {
if (s[0] == 'p' || s[0] == 'n' || s[0] == 'r') if (s[0] == 'p' || s[0] == 'n' || s[0] == 'r')
{ {

View file

@ -916,7 +916,7 @@ public:
CAHManager::getInstance()->runActionHandler("new_macro_enter_name",NULL); CAHManager::getInstance()->runActionHandler("new_macro_enter_name",NULL);
// Check if macro has more than one command // Check if macro has more than one command
if (pMCM->CurrentEditMacro.Commands.size() == 0) return; if (pMCM->CurrentEditMacro.Commands.empty()) return;
// Add a macro // Add a macro
if (pMCM->CurrentEditMacroNb != -1) if (pMCM->CurrentEditMacroNb != -1)

View file

@ -871,7 +871,7 @@ class CHandlerContactEntry : public IActionHandler
if (pEB == NULL) return; if (pEB == NULL) return;
ucstring text = pEB->getInputString(); ucstring text = pEB->getInputString();
// If the line is empty, do nothing // If the line is empty, do nothing
if(text.size() == 0) if(text.empty())
return; return;
// Parse any tokens in the text // Parse any tokens in the text

View file

@ -302,9 +302,9 @@ void initCatDisplay()
// Check is good now ask the player if he wants to apply the patch // Check is good now ask the player if he wants to apply the patch
pPM->getInfoToDisp(InfoOnPatch); pPM->getInfoToDisp(InfoOnPatch);
if ((InfoOnPatch.NonOptCat.size() > 0) || if ((!InfoOnPatch.NonOptCat.empty()) ||
(InfoOnPatch.OptCat.size() > 0) || (!InfoOnPatch.OptCat.empty()) ||
(InfoOnPatch.ReqCat.size() > 0)) (!InfoOnPatch.ReqCat.empty()))
{ {
createOptionalCatUI(); createOptionalCatUI();
NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_CATDISP); NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_CATDISP);
@ -529,9 +529,9 @@ void loginMainLoop()
AvailablePatchs = InfoOnPatch.getAvailablePatchsBitfield(); AvailablePatchs = InfoOnPatch.getAvailablePatchsBitfield();
if ((InfoOnPatch.NonOptCat.size() > 0) || if ((!InfoOnPatch.NonOptCat.empty()) ||
(InfoOnPatch.OptCat.size() > 0) || (!InfoOnPatch.OptCat.empty()) ||
(InfoOnPatch.ReqCat.size() > 0)) (!InfoOnPatch.ReqCat.empty()))
{ {
LoginSM.pushEvent(CLoginStateMachine::ev_patch_needed); LoginSM.pushEvent(CLoginStateMachine::ev_patch_needed);
// createOptionalCatUI(); // createOptionalCatUI();

View file

@ -1315,7 +1315,7 @@ void CPatchManager::getServerFile (const std::string &name, bool bZipped, const
std::string serverPath; std::string serverPath;
std::string serverDisplayPath; std::string serverDisplayPath;
if (UsedServer >= 0 && PatchServers.size() > 0) if (UsedServer >= 0 && !PatchServers.empty())
{ {
// first use main patch servers // first use main patch servers
serverPath = PatchServers[UsedServer].ServerPath; serverPath = PatchServers[UsedServer].ServerPath;
@ -2202,7 +2202,7 @@ void CCheckThread::run ()
nlwarning(rDescFiles.getFile(i).getFileName().c_str()); nlwarning(rDescFiles.getFile(i).getFileName().c_str());
pPM->getPatchFromDesc(ftp, rDescFiles.getFile(i), false); pPM->getPatchFromDesc(ftp, rDescFiles.getFile(i), false);
// add the file if there are some patches to apply, or if an already patched version was found in the unpack directory // add the file if there are some patches to apply, or if an already patched version was found in the unpack directory
if (ftp.Patches.size() > 0 || (IncludeBackgroundPatch && !ftp.SrcFileName.empty())) if (!ftp.Patches.empty() || (IncludeBackgroundPatch && !ftp.SrcFileName.empty()))
{ {
pPM->FilesToPatch.push_back(ftp); pPM->FilesToPatch.push_back(ftp);
sTranslate = CI18N::get("uiNeededPatches") + " " + toString (ftp.Patches.size()); sTranslate = CI18N::get("uiNeededPatches") + " " + toString (ftp.Patches.size());

View file

@ -512,7 +512,7 @@ CXDeltaPatch::TApplyResult CXDeltaPatch::apply(const std::string &sFileToPatch,
return ApplyResult_UnsupportedXDeltaFormat; return ApplyResult_UnsupportedXDeltaFormat;
} }
if (_Ctrl.SourceInfo.size() == 0) if (_Ctrl.SourceInfo.empty())
{ {
errorMsg = "no source info"; errorMsg = "no source info";
return ApplyResult_Error; return ApplyResult_Error;
@ -527,7 +527,7 @@ CXDeltaPatch::TApplyResult CXDeltaPatch::apply(const std::string &sFileToPatch,
SXDeltaCtrl::SSourceInfo *pFromSource = NULL; SXDeltaCtrl::SSourceInfo *pFromSource = NULL;
// SXDeltaCtrl::SSourceInfo *pDataSource = NULL; // SXDeltaCtrl::SSourceInfo *pDataSource = NULL;
if (_Ctrl.SourceInfo.size() > 0) if (!_Ctrl.SourceInfo.empty())
{ {
SXDeltaCtrl::SSourceInfo &rInfo = _Ctrl.SourceInfo[0]; SXDeltaCtrl::SSourceInfo &rInfo = _Ctrl.SourceInfo[0];

View file

@ -484,7 +484,7 @@ NLMISC_COMMAND(dumpNPCIconCache, "Display descriptions of NPCs", "")
NLMISC_COMMAND(queryMissionGiverData, "Query mission giver data for the specified alias", "<alias>") NLMISC_COMMAND(queryMissionGiverData, "Query mission giver data for the specified alias", "<alias>")
{ {
if (args.size() == 0) if (args.empty())
return false; return false;
uint32 alias; uint32 alias;
NLMISC::fromString(args[0], alias); NLMISC::fromString(args[0], alias);

View file

@ -48,7 +48,7 @@ void CToolPick::setIgnoreInstances(const std::string & ignoreInstances)
{ {
//H_AUTO(R2_CToolPick_setIgnoreInstances) //H_AUTO(R2_CToolPick_setIgnoreInstances)
string allKind = ignoreInstances; string allKind = ignoreInstances;
while (allKind.size() > 0) while (!allKind.empty())
{ {
std::string::size_type e = allKind.find(','); std::string::size_type e = allKind.find(',');
string tmp; string tmp;

View file

@ -785,7 +785,7 @@ void CSheetManager::computeVS()
if(it == ProcessedItem.end()) if(it == ProcessedItem.end())
{ {
uint itemNumber; uint itemNumber;
if(vs[visualSlot].Element.size() == 0) if(vs[visualSlot].Element.empty())
itemNumber = 1; itemNumber = 1;
else else
itemNumber = vs[visualSlot].Element[vs[visualSlot].Element.size()-1].Index+1; itemNumber = vs[visualSlot].Element[vs[visualSlot].Element.size()-1].Index+1;

View file

@ -1612,7 +1612,7 @@ const ucchar *CStringManagerClient::getTitleLocalizedName(const ucstring &titleI
{ {
vector<ucstring> listInfos = getTitleInfos(titleId, women); vector<ucstring> listInfos = getTitleInfos(titleId, women);
if (listInfos.size() > 0) if (!listInfos.empty())
{ {
_TitleWords.push_back(listInfos[0]); _TitleWords.push_back(listInfos[0]);
return _TitleWords.back().c_str(); return _TitleWords.back().c_str();
@ -1629,7 +1629,7 @@ vector<ucstring> CStringManagerClient::getTitleInfos(const ucstring &titleId, bo
vector<ucstring> listInfos; vector<ucstring> listInfos;
splitUCString(titleId, ucstring("#"), listInfos); splitUCString(titleId, ucstring("#"), listInfos);
if (listInfos.size() > 0) if (!listInfos.empty())
{ {
if (titleId[0] != '#') if (titleId[0] != '#')
{ {

View file

@ -728,12 +728,12 @@ void CEditionSession::swap(CEditionSession& other)
void CEditionSession::update(uint32 currentTime) void CEditionSession::update(uint32 currentTime)
{ {
if (getCurrentChars().size() == 0 && DateSinceNoPlayer == 0 ) if (getCurrentChars().empty() && DateSinceNoPlayer == 0 )
{ {
DateSinceNoPlayer = currentTime; DateSinceNoPlayer = currentTime;
} }
if (getCurrentChars().size() != 0 && DateSinceNoPlayer != 0 ) if (!getCurrentChars().empty() && DateSinceNoPlayer != 0 )
{ {
DateSinceNoPlayer = 0; DateSinceNoPlayer = 0;
} }
@ -1096,7 +1096,7 @@ public:
} }
else else
{ {
if (tokens.size() == 0) if (tokens.empty())
{ {
} }

View file

@ -159,7 +159,7 @@ void sendUDP (CUdpSock *client, const uint8 *packet, uint32 packetSize, const CI
CBufferizedPacket *bp = new CBufferizedPacket (client, packet, packetSize, lag, addr); CBufferizedPacket *bp = new CBufferizedPacket (client, packet, packetSize, lag, addr);
// duplicate the packet // duplicate the packet
if ((float)rand()/(float)(RAND_MAX)*100.0f < PacketDisordering && BufferizedPackets.size() > 0) if ((float)rand()/(float)(RAND_MAX)*100.0f < PacketDisordering && !BufferizedPackets.empty())
{ {
CBufferizedPacket *bp2 = BufferizedPackets.back(); CBufferizedPacket *bp2 = BufferizedPackets.back();

View file

@ -16,7 +16,6 @@
#include "stdpch.h" #include "stdpch.h"
#include <functional>
#include "deposit.h" #include "deposit.h"
#include "player_manager/character.h" #include "player_manager/character.h"
#include "player_manager/player_manager.h" #include "player_manager/player_manager.h"

View file

@ -370,7 +370,7 @@ void CConfigFile::setDefaultProfileIndex(int index)
bool CConfigFile::isRyzomInstallerConfigured() const bool CConfigFile::isRyzomInstallerConfigured() const
{ {
return m_profiles.size() > 0; return !m_profiles.isEmpty();
} }
QString CConfigFile::getInstallationDirectory() const QString CConfigFile::getInstallationDirectory() const

View file

@ -110,7 +110,7 @@ void CExport::delAllIGZoneUnderPoint (float fCellSize, CPrimPoint *pPoint, const
void CExport::delAllIGZoneUnderPath (float fCellSize, CPrimPath *pPath, const string &sIGOutputDir) void CExport::delAllIGZoneUnderPath (float fCellSize, CPrimPath *pPath, const string &sIGOutputDir)
{ {
if (pPath == NULL) return; if (pPath == NULL) return;
if (pPath->VPoints.size() == 0) return; if (pPath->VPoints.empty()) return;
uint32 i, j; uint32 i, j;
CVector vMin, vMax; CVector vMin, vMax;
@ -195,7 +195,7 @@ void CExport::delAllIGZoneUnderPath (float fCellSize, CPrimPath *pPath, const st
void CExport::delAllIGZoneUnderPatat (float fCellSize, CPrimZone *pPatat, const string &sIGOutputDir) void CExport::delAllIGZoneUnderPatat (float fCellSize, CPrimZone *pPatat, const string &sIGOutputDir)
{ {
if (pPatat == NULL) return; if (pPatat == NULL) return;
if (pPatat->VPoints.size() == 0) return; if (pPatat->VPoints.empty()) return;
uint32 i, j; uint32 i, j;
CVector vMin, vMax; CVector vMin, vMax;
@ -294,7 +294,7 @@ bool CExport::isPatatNeedUpdate (float fCellSize, CPrimZone *pPatat, const strin
CVector vMin, vMax; CVector vMin, vMax;
CTools::chdir (sIGOutputDir); CTools::chdir (sIGOutputDir);
if (pPatat->VPoints.size() == 0) if (pPatat->VPoints.empty())
return false; return false;
vMin = vMax = pPatat->VPoints[0]; vMin = vMax = pPatat->VPoints[0];
for (i = 0; i < pPatat->VPoints.size(); ++i) for (i = 0; i < pPatat->VPoints.size(); ++i)
@ -394,7 +394,7 @@ bool CExport::isPathNeedUpdate (float fCellSize, CPrimPath *pPath, const string
CVector vMin, vMax; CVector vMin, vMax;
CTools::chdir (sIGOutputDir); CTools::chdir (sIGOutputDir);
if (pPath->VPoints.size() == 0) if (pPath->VPoints.empty())
return false; return false;
vMin = vMax = pPath->VPoints[0]; vMin = vMax = pPath->VPoints[0];
for (i = 0; i < pPath->VPoints.size(); ++i) for (i = 0; i < pPath->VPoints.size(); ++i)
@ -1245,7 +1245,7 @@ bool CExport::doExport (SExportOptions &opt, IExportCB *expCB, vector<SExportPri
_ExportCB = expCB; _ExportCB = expCB;
// Does we have something to export // Does we have something to export
if ((selection != NULL) && (selection->size() == 0)) if ((selection != NULL) && (selection->empty()))
{ {
if (_ExportCB) if (_ExportCB)
_ExportCB->dispInfo ("Nothing to export"); _ExportCB->dispInfo ("Nothing to export");
@ -1983,7 +1983,7 @@ void CExport::writeFloraIG (const string &LandFile, bool bTestForWriting)
{ {
sint32 i, j, k; sint32 i, j, k;
if (_FloraInsts.size() == 0) if (_FloraInsts.empty())
return; return;
CZoneRegion zoneRegion; CZoneRegion zoneRegion;

View file

@ -235,7 +235,7 @@ CActionString::CActionString (IAction::TTypeAction type, const std::string &newV
bool vdfnArray; bool vdfnArray;
CForm *form=doc.getFormPtr (); CForm *form=doc.getFormPtr ();
CFormElm *elm = doc.getRootNode (slot); CFormElm *elm = doc.getRootNode (slot);
nlverify ( elm->getNodeByName (_FormName.c_str (), &parentDfn, indexDfn, nlverify ( elm->getNodeByName (_FormName, &parentDfn, indexDfn,
&nodeDfn, &nodeType, &node, type, array, vdfnArray, true, NLGEORGES_FIRST_ROUND) ); &nodeDfn, &nodeType, &node, type, array, vdfnArray, true, NLGEORGES_FIRST_ROUND) );
if (node) if (node)
{ {
@ -364,7 +364,7 @@ bool CActionString::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, b
bool parentVDnfArray; bool parentVDnfArray;
CForm *form=doc.getFormPtr (); CForm *form=doc.getFormPtr ();
CFormElm *elm = doc.getRootNode (_Slot); CFormElm *elm = doc.getRootNode (_Slot);
nlverify ( elm->getNodeByName (_FormName.c_str (), &parentDfn, indexDfn, nlverify ( elm->getNodeByName (_FormName, &parentDfn, indexDfn,
&nodeDfn, &nodeType, &node, type, array, parentVDnfArray, true, NLGEORGES_FIRST_ROUND) ); &nodeDfn, &nodeType, &node, type, array, parentVDnfArray, true, NLGEORGES_FIRST_ROUND) );
nlassert (node); nlassert (node);
CFormElmAtom *atom = safe_cast<CFormElmAtom*> (node); CFormElmAtom *atom = safe_cast<CFormElmAtom*> (node);
@ -437,14 +437,14 @@ bool CActionString::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, b
bool vdfnArray; bool vdfnArray;
CForm *form=doc.getFormPtr (); CForm *form=doc.getFormPtr ();
CFormElm *elm = doc.getRootNode (_Slot); CFormElm *elm = doc.getRootNode (_Slot);
nlverify ( elm->getNodeByName (_FormName.c_str (), &parentDfn, indexDfn, nlverify ( elm->getNodeByName (_FormName, &parentDfn, indexDfn,
&nodeDfn, &nodeType, &node, type, array, vdfnArray, true, NLGEORGES_FIRST_ROUND) ); &nodeDfn, &nodeType, &node, type, array, vdfnArray, true, NLGEORGES_FIRST_ROUND) );
if (node) if (node)
{ {
CFormElmArray* array = safe_cast<CFormElmArray*> (node->getParent ()); CFormElmArray* array = safe_cast<CFormElmArray*> (node->getParent ());
array->Elements[idInParent].Name = _Value[index]; array->Elements[idInParent].Name = _Value[index];
modified = true; modified = true;
update (true, DoNothing, doc, _FormName.c_str ()); update (true, DoNothing, doc, _FormName);
} }
} }
break; break;
@ -716,14 +716,14 @@ bool CActionStringVector::doAction (CGeorgesEditDoc &doc, bool redo, bool &modif
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc.getFormPtr (); CForm *form=doc.getFormPtr ();
CFormElm *elm = doc.getRootNode (slot); CFormElm *elm = doc.getRootNode (slot);
nlverify ( elm->getNodeByName (_FormName.c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true) ); nlverify ( elm->getNodeByName (_FormName, &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true) );
// Is a type entry ? // Is a type entry ?
if ((type == UFormDfn::EntryType) && array) if ((type == UFormDfn::EntryType) && array)
{ {
// Create the array // Create the array
bool created; bool created;
nlverify ( elm->createNodeByName (_FormName.c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, created) ); nlverify ( elm->createNodeByName (_FormName, &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, created) );
nlassert (node); nlassert (node);
// Get the atom // Get the atom
@ -921,7 +921,7 @@ bool CActionStringVectorVector::doAction (CGeorgesEditDoc &doc, bool redo, bool
// *************************************************************************** // ***************************************************************************
CActionBuffer::CActionBuffer (IAction::TTypeAction type, const uint8 *buffer, uint bufferSize, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot) : IAction (type, selId, slot) CActionBuffer::CActionBuffer(IAction::TTypeAction type, const uint8 *buffer, uint bufferSize, CGeorgesEditDoc &doc, const std::string &formName, const std::string &userData, uint selId, uint slot) : IAction(type, selId, slot)
{ {
// New value // New value
_FormName = formName; _FormName = formName;

View file

@ -548,7 +548,7 @@ void CFormDialog::setToDocument (uint widget)
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (Widgets[widget]->getSlot ()); CFormElm *elm = doc->getRootNode (Widgets[widget]->getSlot ());
nlverify ( elm->getNodeByName (Widgets[widget]->getFormName ().c_str (), &parentDfn, indexDfn, nlverify ( elm->getNodeByName (Widgets[widget]->getFormName (), &parentDfn, indexDfn,
&nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
// Must create array or virtual dfn ? // Must create array or virtual dfn ?
@ -811,7 +811,7 @@ BOOL CFormDialog::OnCommand(WPARAM wParam, LPARAM lParam)
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (Widgets[widgetId]->getSlot ()); CFormElm *elm = doc->getRootNode (Widgets[widgetId]->getSlot ());
nlverify ( elm->getNodeByName (Widgets[widgetId]->getFormName ().c_str (), &parentDfn, indexDfn, nlverify ( elm->getNodeByName (Widgets[widgetId]->getFormName (), &parentDfn, indexDfn,
&nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
nlassert (parentDfn); nlassert (parentDfn);
@ -943,7 +943,7 @@ BOOL CFormDialog::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
// Search for the node // Search for the node
nlverify ((const CFormElm*)(doc->getRootNode (Widgets[i]->getSlot ()))->getNodeByName nlverify ((const CFormElm*)(doc->getRootNode (Widgets[i]->getSlot ()))->getNodeByName
(Widgets[i]->getFormName ().c_str (), &parentDfn, lastElement, &nodeDfn, &nodeType, (Widgets[i]->getFormName (), &parentDfn, lastElement, &nodeDfn, &nodeType,
&node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND)); &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND));
// Todo: multiply here by the spinner precision // Todo: multiply here by the spinner precision
@ -954,8 +954,8 @@ BOOL CFormDialog::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
value -= (float)(lpnmud->iDelta) * increment; value -= (float)(lpnmud->iDelta) * increment;
// Print the result // Print the result
char result[512]; TCHAR result[512];
sprintf (result, "%g", value); _stprintf (result, _T("%g"), value);
// Set the windnow text // Set the windnow text
combo->Combo.SetWindowText (result); combo->Combo.SetWindowText (result);
@ -1097,7 +1097,7 @@ void CFormDialog::getFromDocument ()
UFormDfn::TEntryType type; UFormDfn::TEntryType type;
// Search for the node // Search for the node
nlverify (((const CFormElm*)(doc->getRootNode (subObject->getSlot ())))->getNodeByName (subObject->getFormName ().c_str (), &parentDfn, lastElement, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND)); nlverify (((const CFormElm*)(doc->getRootNode (subObject->getSlot ())))->getNodeByName (subObject->getFormName (), &parentDfn, lastElement, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND));
// Should have a parent DFN, else it is the root element // Should have a parent DFN, else it is the root element
if (parentDfn) if (parentDfn)
@ -1342,7 +1342,7 @@ void IFormWidget::updateLabel ()
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (getSlot ()); CFormElm *elm = doc->getRootNode (getSlot ());
nlverify ( elm->getNodeByName (FormName.c_str (), &parentDfn, indexDfn, nlverify ( elm->getNodeByName (FormName, &parentDfn, indexDfn,
&nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
// Does the node exist ? // Does the node exist ?
@ -1401,7 +1401,7 @@ bool IFormWidget::getNode (const CFormDfn **parentDfn, uint &lastElement, const
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (getSlot ()); CFormElm *elm = doc->getRootNode (getSlot ());
return (elm->getNodeByName (FormName.c_str (), parentDfn, return (elm->getNodeByName (FormName, parentDfn,
lastElement, nodeDfn, nodeType, node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); lastElement, nodeDfn, nodeType, node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
} }
return false; return false;
@ -1558,7 +1558,7 @@ void CFormMemCombo::create (DWORD wStyle, RECT &currentPos, CFormDialog *parent,
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (getSlot ()); CFormElm *elm = doc->getRootNode (getSlot ());
nlverify ( elm->getNodeByName (FormName.c_str (), &parentDfn, indexDfn, nlverify ( elm->getNodeByName (FormName, &parentDfn, indexDfn,
&nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
FirstId = dialog_index; FirstId = dialog_index;
@ -1710,7 +1710,7 @@ void CFormMemCombo::getFromDocument (CForm &form)
UFormDfn::TEntryType type; UFormDfn::TEntryType type;
bool array; bool array;
bool parentVDfnArray; bool parentVDfnArray;
nlverify (((const CFormElm*)doc->getRootNode(getSlot ()))->getNodeByName (FormName.c_str(), &parentDfn, lastElement, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND)); nlverify (((const CFormElm*)doc->getRootNode(getSlot ()))->getNodeByName (FormName, &parentDfn, lastElement, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND));
nlassert (array); nlassert (array);
// Node exist ? // Node exist ?
@ -1723,13 +1723,13 @@ void CFormMemCombo::getFromDocument (CForm &form)
Combo.SetWindowText (label); Combo.SetWindowText (label);
if (arrayNode->getForm () == &form) if (arrayNode->getForm () == &form)
Label.SetWindowText ("Array size:"); Label.SetWindowText (_T("Array size:"));
else else
Label.SetWindowText ("Array size: (in parent form)"); Label.SetWindowText (_T("Array size: (in parent form)"));
} }
else else
{ {
Combo.SetWindowText ("0"); Combo.SetWindowText (_T("0"));
} }
Combo.UpdateData (FALSE); Combo.UpdateData (FALSE);
} }
@ -1743,7 +1743,7 @@ void CFormMemCombo::getFromDocument (CForm &form)
UFormDfn::TEntryType type; UFormDfn::TEntryType type;
bool array; bool array;
bool parentVDfnArray; bool parentVDfnArray;
nlverify (((const CFormElm*)doc->getRootNode (getSlot ()))->getNodeByName (FormName.c_str(), &parentDfn, lastElement, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND)); nlverify (((const CFormElm*)doc->getRootNode (getSlot ()))->getNodeByName (FormName, &parentDfn, lastElement, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND));
nlassert (!array); nlassert (!array);
// Node exist ? // Node exist ?
@ -1751,11 +1751,11 @@ void CFormMemCombo::getFromDocument (CForm &form)
if (node) if (node)
{ {
CFormElmVirtualStruct *virtualNode = safe_cast<CFormElmVirtualStruct*> (node); CFormElmVirtualStruct *virtualNode = safe_cast<CFormElmVirtualStruct*> (node);
Combo.SetWindowText (virtualNode->DfnFilename.c_str()); Combo.SetWindowText (utf8ToTStr(virtualNode->DfnFilename));
} }
else else
{ {
Combo.SetWindowText (""); Combo.SetWindowText (_T(""));
} }
Combo.UpdateData (FALSE); Combo.UpdateData (FALSE);
} }

View file

@ -1025,7 +1025,7 @@ void CGeorgesEditApp::OnUpdateFileSaveAll(CCmdUI* pCmdUI)
pCmdUI->Enable (getActiveDocument () != NULL); pCmdUI->Enable (getActiveDocument () != NULL);
} }
bool CGeorgesEditApp::SerialIntoMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard) bool CGeorgesEditApp::SerialIntoMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard)
{ {
// Ok, get the node // Ok, get the node
const CFormDfn *parentDfn; const CFormDfn *parentDfn;
@ -1228,7 +1228,7 @@ bool CGeorgesEditApp::FillMemStreamWithClipboard (const char *formName, CGeorges
return false; return false;
} }
bool CGeorgesEditApp::SerialFromMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot) bool CGeorgesEditApp::SerialFromMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot)
{ {
// The form pointer // The form pointer
CForm *form = doc->getFormPtr (); CForm *form = doc->getFormPtr ();

View file

@ -119,11 +119,11 @@ public:
public: public:
// Memory stream // Memory stream
NLMISC::CMemStream MemStream; NLMISC::CMemStream MemStream;
bool FillMemStreamWithClipboard (const char *formName, CGeorgesEditDoc *doc, uint slot); bool FillMemStreamWithClipboard (const std::string &formName, CGeorgesEditDoc *doc, uint slot);
void FillMemStreamWithBuffer (const uint8 *buffer, uint size); void FillMemStreamWithBuffer (const uint8 *buffer, uint size);
bool SerialIntoMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard); bool SerialIntoMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard);
bool SerialFromMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot); bool SerialFromMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot);
// Init // Init
BOOL initInstance (int nCmdShow, bool exeStandalone, int x, int y, int cx, int cy); BOOL initInstance (int nCmdShow, bool exeStandalone, int x, int y, int cx, int cy);
@ -136,7 +136,7 @@ public:
// From IEdit // From IEdit
NLGEORGES::IEditDocument *getActiveDocument (); NLGEORGES::IEditDocument *getActiveDocument ();
NLGEORGES::IEditDocument *createDocument (const char *dfnName, const char *pathName); NLGEORGES::IEditDocument *createDocument (const std::string &dfnName, const std::string &pathName);
virtual void getSearchPath (std::string &searchPath); virtual void getSearchPath (std::string &searchPath);
virtual NLMISC::CConfigFile &getConfigFile() { return ConfigFile; } virtual NLMISC::CConfigFile &getConfigFile() { return ConfigFile; }
@ -153,10 +153,10 @@ public:
CImageListEx ImageList; CImageListEx ImageList;
// Get a template form // Get a template form
CMultiDocTemplate *getFormDocTemplate (const char *dfnName); CMultiDocTemplate *getFormDocTemplate (const std::string &dfnName);
void saveWindowState (const CWnd *wnd, const char *name, bool controlBar); void saveWindowState (const CWnd *wnd, const std::string &name, bool controlBar);
void loadWindowState (CWnd *wnd, const char *name, bool changeShowWindow, bool controlBar); void loadWindowState (CWnd *wnd, const std::string &name, bool changeShowWindow, bool controlBar);
// Overrides // Overrides
// ClassWizard generated virtual function overrides // ClassWizard generated virtual function overrides
@ -176,8 +176,8 @@ public:
void releasePlugins (); void releasePlugins ();
// Dialog function // Dialog function
void outputError (const char* message); void outputError (const std::string &message);
bool yesNo (const char* message); bool yesNo (const std::string &message);
bool getColor (NLMISC::CRGBA &color); bool getColor (NLMISC::CRGBA &color);
// Browse an URL // Browse an URL

View file

@ -355,7 +355,7 @@ CGeorgesEditDocSub *CGeorgesEditDoc::addStruct (CGeorgesEditDocSub *parent, CFor
{ {
// Get the node by name // Get the node by name
UFormElm *uNode; UFormElm *uNode;
if (formPtr->getParent (parent)->getRootNode ().getNodeByName (&uNode, entryName.c_str(), NULL, false) && uNode) if (formPtr->getParent (parent)->getRootNode ().getNodeByName (&uNode, entryName, NULL, false) && uNode)
{ {
nextArray = safe_cast<CFormElmArray*> (uNode); nextArray = safe_cast<CFormElmArray*> (uNode);
} }
@ -382,7 +382,7 @@ CGeorgesEditDocSub *CGeorgesEditDoc::addStruct (CGeorgesEditDocSub *parent, CFor
{ {
// Get the node by name // Get the node by name
UFormElm *uNode; UFormElm *uNode;
if (formPtr->getParent (parent)->getRootNode ().getNodeByName (&uNode, entryName.c_str(), NULL, false) && uNode) if (formPtr->getParent (parent)->getRootNode ().getNodeByName (&uNode, entryName, NULL, false) && uNode)
{ {
nextForm = safe_cast<CFormElmStruct*> (uNode); nextForm = safe_cast<CFormElmStruct*> (uNode);
} }
@ -414,7 +414,7 @@ CGeorgesEditDocSub *CGeorgesEditDoc::addStruct (CGeorgesEditDocSub *parent, CFor
{ {
// Get the node by name // Get the node by name
UFormElm *uNode; UFormElm *uNode;
if (formPtr->getParent (parent)->getRootNode ().getNodeByName (&uNode, entryName.c_str(), NULL, false) && uNode) if (formPtr->getParent (parent)->getRootNode ().getNodeByName (&uNode, entryName, NULL, false) && uNode)
{ {
nextArray = safe_cast<CFormElmArray*> (uNode); nextArray = safe_cast<CFormElmArray*> (uNode);
} }
@ -1546,7 +1546,7 @@ int CGeorgesEditDocSub::getItemImage (CGeorgesEditDoc *doc) const
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (getSlot ()); CFormElm *elm = doc->getRootNode (getSlot ());
nlverify ( elm->getNodeByName (getFormName ().c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); nlverify ( elm->getNodeByName (getFormName (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
if (array) if (array)
{ {

View file

@ -248,7 +248,7 @@ void CGeorgesImpl::PutGroupText (const std::vector<std::string>& _vText, bool ap
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (subDoc->getSlot ()); CFormElm *elm = doc->getRootNode (subDoc->getSlot ());
nlverify ( elm->getNodeByName (subDoc->getFormName ().c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); nlverify ( elm->getNodeByName (subDoc->getFormName (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
// Is a type entry ? // Is a type entry ?
if ((type == UFormDfn::EntryType) && array) if ((type == UFormDfn::EntryType) && array)
@ -314,7 +314,7 @@ void CGeorgesImpl::PutText (const std::string& _sText)
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (subDoc->getSlot ()); CFormElm *elm = doc->getRootNode (subDoc->getSlot ());
nlverify ( elm->getNodeByName (subDoc->getFormName ().c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); nlverify ( elm->getNodeByName (subDoc->getFormName (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
// It is an array ? // It is an array ?
if (array&&(type == UFormDfn::EntryType)) if (array&&(type == UFormDfn::EntryType))
@ -374,7 +374,7 @@ void CGeorgesImpl::LineUp ()
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (subDoc->getSlot ()); CFormElm *elm = doc->getRootNode (subDoc->getSlot ());
nlverify ( elm->getNodeByName (subDoc->getFormName ().c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); nlverify ( elm->getNodeByName (subDoc->getFormName (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
// Is a type entry ? // Is a type entry ?
if ( (type == UFormDfn::EntryType) && !array ) if ( (type == UFormDfn::EntryType) && !array )
@ -417,7 +417,7 @@ void CGeorgesImpl::LineDown ()
bool parentVDfnArray; bool parentVDfnArray;
CForm *form=doc->getFormPtr (); CForm *form=doc->getFormPtr ();
CFormElm *elm = doc->getRootNode (subDoc->getSlot ()); CFormElm *elm = doc->getRootNode (subDoc->getSlot ());
nlverify ( elm->getNodeByName (subDoc->getFormName ().c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); nlverify ( elm->getNodeByName (subDoc->getFormName (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
// Is a type entry ? // Is a type entry ?
if ( (type == UFormDfn::EntryType) && !array ) if ( (type == UFormDfn::EntryType) && !array )

Some files were not shown because too many files have changed in this diff Show more