mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-25 18:10:54 +00:00
Merge with develop
This commit is contained in:
parent
bbf15b7a80
commit
c7ef9d9773
109 changed files with 288 additions and 275 deletions
|
@ -120,7 +120,7 @@ public:
|
|||
|
||||
void setWorldMatrix (const NLMISC::CMatrix &WM);
|
||||
|
||||
bool isRoot() { return _LocalVolume.size() == 0; }
|
||||
bool isRoot() { return _LocalVolume.empty(); }
|
||||
|
||||
//\name Sound related.
|
||||
//@{
|
||||
|
|
|
@ -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());
|
||||
|
||||
// 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());
|
||||
|
||||
// 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());
|
||||
|
||||
// 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());
|
||||
|
||||
// free the georges loader if necessary
|
||||
|
|
|
@ -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, 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);
|
||||
else
|
||||
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, 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);
|
||||
else
|
||||
return createUIElement(templateName, parentID, NULL, 0, updateLinks);
|
||||
|
|
|
@ -133,7 +133,7 @@ bool CClipTrav::fullSearch (vector<CCluster*>& vCluster, const CVector& pos)
|
|||
if (pIG->_ClusterInstances[i]->isIn(pos))
|
||||
vCluster.push_back (pIG->_ClusterInstances[i]);
|
||||
}
|
||||
if (vCluster.size() > 0)
|
||||
if (!vCluster.empty())
|
||||
return true;*/
|
||||
|
||||
return true;
|
||||
|
|
|
@ -541,7 +541,7 @@ void CMeshGeom::render(IDriver *drv, CTransformShape *trans, float polygonCount,
|
|||
skeleton= mi->getSkeletonModel();
|
||||
// The mesh must not be skinned for render()
|
||||
nlassert(!(_Skinned && mi->isSkinned() && skeleton));
|
||||
bool bMorphApplied = _MeshMorpher->BlendShapes.size() > 0;
|
||||
bool bMorphApplied = !_MeshMorpher->BlendShapes.empty();
|
||||
bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace();
|
||||
|
||||
|
||||
|
@ -733,7 +733,7 @@ void CMeshGeom::renderSkin(CTransformShape *trans, float alphaMRM)
|
|||
skeleton= mi->getSkeletonModel();
|
||||
// must be skinned for renderSkin()
|
||||
nlassert(_Skinned && mi->isSkinned() && skeleton);
|
||||
bool bMorphApplied = _MeshMorpher->BlendShapes.size() > 0;
|
||||
bool bMorphApplied = !_MeshMorpher->BlendShapes.empty();
|
||||
bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace();
|
||||
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ void CMeshMorpher::update (std::vector<CAnimatedMorph> *pBSFactor)
|
|||
|
||||
if (_VBOri == NULL)
|
||||
return;
|
||||
if (BlendShapes.size() == 0)
|
||||
if (BlendShapes.empty())
|
||||
return;
|
||||
|
||||
if (_VBOri->getNumVertices() != _VBDst->getNumVertices())
|
||||
|
@ -164,21 +164,21 @@ void CMeshMorpher::update (std::vector<CAnimatedMorph> *pBSFactor)
|
|||
// Modify Pos/Norm/TgSpace.
|
||||
//------------
|
||||
if (_VBDst->getVertexFormat() & CVertexBuffer::PositionFlag)
|
||||
if (rBS.deltaPos.size() > 0)
|
||||
if (!rBS.deltaPos.empty())
|
||||
{
|
||||
CVector *pV = dstvba.getVertexCoordPointer (vp);
|
||||
*pV += rBS.deltaPos[j] * rFactor;
|
||||
}
|
||||
|
||||
if (_VBDst->getVertexFormat() & CVertexBuffer::NormalFlag)
|
||||
if (rBS.deltaNorm.size() > 0)
|
||||
if (!rBS.deltaNorm.empty())
|
||||
{
|
||||
CVector *pV = dstvba.getNormalCoordPointer (vp);
|
||||
*pV += rBS.deltaNorm[j] * rFactor;
|
||||
}
|
||||
|
||||
if (_UseTgSpace)
|
||||
if (rBS.deltaTgSpace.size() > 0)
|
||||
if (!rBS.deltaTgSpace.empty())
|
||||
{
|
||||
CVector *pV = (CVector*)dstvba.getTexCoordPointer (vp, tgSpaceStage);
|
||||
*pV += rBS.deltaTgSpace[j] * rFactor;
|
||||
|
@ -187,14 +187,14 @@ void CMeshMorpher::update (std::vector<CAnimatedMorph> *pBSFactor)
|
|||
// Modify UV0 / Color
|
||||
//------------
|
||||
if (_VBDst->getVertexFormat() & CVertexBuffer::TexCoord0Flag)
|
||||
if (rBS.deltaUV.size() > 0)
|
||||
if (!rBS.deltaUV.empty())
|
||||
{
|
||||
CUV *pUV = dstvba.getTexCoordPointer (vp);
|
||||
*pUV += rBS.deltaUV[j] * rFactor;
|
||||
}
|
||||
|
||||
if (_VBDst->getVertexFormat() & CVertexBuffer::PrimaryColorFlag)
|
||||
if (rBS.deltaCol.size() > 0)
|
||||
if (!rBS.deltaCol.empty())
|
||||
{
|
||||
// todo hulud d3d vertex color RGBA / BGRA
|
||||
CRGBA *pRGBA = (CRGBA*)dstvba.getColorPointer (vp);
|
||||
|
@ -224,7 +224,7 @@ void CMeshMorpher::updateSkinned (std::vector<CAnimatedMorph> *pBSFactor)
|
|||
|
||||
if (_VBOri == NULL)
|
||||
return;
|
||||
if (BlendShapes.size() == 0)
|
||||
if (BlendShapes.empty())
|
||||
return;
|
||||
|
||||
if (_VBOri->getNumVertices() != _VBDst->getNumVertices())
|
||||
|
@ -292,21 +292,21 @@ void CMeshMorpher::updateSkinned (std::vector<CAnimatedMorph> *pBSFactor)
|
|||
// Modify Pos/Norm/TgSpace.
|
||||
//------------
|
||||
if (_Vertices != NULL)
|
||||
if (rBS.deltaPos.size() > 0)
|
||||
if (!rBS.deltaPos.empty())
|
||||
{
|
||||
CVector *pV = &(_Vertices->operator[](vp));
|
||||
*pV += rBS.deltaPos[j] * rFactor;
|
||||
}
|
||||
|
||||
if (_Normals != NULL)
|
||||
if (rBS.deltaNorm.size() > 0)
|
||||
if (!rBS.deltaNorm.empty())
|
||||
{
|
||||
CVector *pV = &(_Normals->operator[](vp));
|
||||
*pV += rBS.deltaNorm[j] * rFactor;
|
||||
}
|
||||
|
||||
if (_UseTgSpace && _TgSpace != NULL)
|
||||
if (rBS.deltaTgSpace.size() > 0)
|
||||
if (!rBS.deltaTgSpace.empty())
|
||||
{
|
||||
CVector *pV = &((*_TgSpace)[vp]);
|
||||
*pV += rBS.deltaTgSpace[j] * rFactor;
|
||||
|
@ -315,14 +315,14 @@ void CMeshMorpher::updateSkinned (std::vector<CAnimatedMorph> *pBSFactor)
|
|||
// Modify UV0 / Color
|
||||
//------------
|
||||
if (_VBDst->getVertexFormat() & CVertexBuffer::TexCoord0Flag)
|
||||
if (rBS.deltaUV.size() > 0)
|
||||
if (!rBS.deltaUV.empty())
|
||||
{
|
||||
CUV *pUV = dstvba.getTexCoordPointer (vp);
|
||||
*pUV += rBS.deltaUV[j] * rFactor;
|
||||
}
|
||||
|
||||
if (_VBDst->getVertexFormat() & CVertexBuffer::PrimaryColorFlag)
|
||||
if (rBS.deltaCol.size() > 0)
|
||||
if (!rBS.deltaCol.empty())
|
||||
{
|
||||
// todo hulud d3d vertex color RGBA / BGRA
|
||||
CRGBA *pRGBA = (CRGBA*)dstvba.getColorPointer (vp);
|
||||
|
@ -371,7 +371,7 @@ void CMeshMorpher::updateRawSkin (CVertexBuffer *vbOri,
|
|||
|
||||
if (vbOri == NULL)
|
||||
return;
|
||||
if (BlendShapes.size() == 0)
|
||||
if (BlendShapes.empty())
|
||||
return;
|
||||
|
||||
nlassert(vbOri->getVertexFormat() == (CVertexBuffer::PositionFlag | CVertexBuffer::NormalFlag |CVertexBuffer::TexCoord0Flag) );
|
||||
|
|
|
@ -938,7 +938,7 @@ void CMeshMRMGeom::render(IDriver *drv, CTransformShape *trans, float polygonCou
|
|||
skeleton = mi->getSkeletonModel();
|
||||
// The mesh must not be skinned for render()
|
||||
nlassert(!(_Skinned && mi->isSkinned() && skeleton));
|
||||
bool bMorphApplied = _MeshMorpher.BlendShapes.size() > 0;
|
||||
bool bMorphApplied = !_MeshMorpher.BlendShapes.empty();
|
||||
bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace();
|
||||
|
||||
|
||||
|
@ -1146,7 +1146,7 @@ void CMeshMRMGeom::renderSkin(CTransformShape *trans, float alphaMRM)
|
|||
skeleton = mi->getSkeletonModel();
|
||||
// must be skinned for renderSkin()
|
||||
nlassert(_Skinned && mi->isSkinned() && skeleton);
|
||||
bool bMorphApplied = _MeshMorpher.BlendShapes.size() > 0;
|
||||
bool bMorphApplied = !_MeshMorpher.BlendShapes.empty();
|
||||
bool useNormal= (_VBufferFinal.getVertexFormat() & CVertexBuffer::NormalFlag)!=0;
|
||||
bool useTangentSpace = _MeshVertexProgram && _MeshVertexProgram->needTangentSpace();
|
||||
|
||||
|
@ -1312,7 +1312,7 @@ sint CMeshMRMGeom::renderSkinGroupGeom(CMeshMRMInstance *mi, float alphaMRM, uin
|
|||
skeleton = mi->getSkeletonModel();
|
||||
// must be skinned for renderSkin()
|
||||
nlassert(_Skinned && mi->isSkinned() && skeleton);
|
||||
bool bMorphApplied = _MeshMorpher.BlendShapes.size() > 0;
|
||||
bool bMorphApplied = !_MeshMorpher.BlendShapes.empty();
|
||||
bool useNormal= (_VBufferFinal.getVertexFormat() & CVertexBuffer::NormalFlag)!=0;
|
||||
nlassert(useNormal);
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@ void CMeshMRMSkinnedGeom::build(CMesh::CMeshBuild &m,
|
|||
|
||||
// No Blend Shapes
|
||||
//================================================
|
||||
nlassert (meshBuildMRM.BlendShapes.size() == 0);
|
||||
nlassert (meshBuildMRM.BlendShapes.empty());
|
||||
|
||||
// Compact bone id and build a bone id names
|
||||
//================================================
|
||||
|
|
|
@ -96,7 +96,7 @@ void CPointLightNamedArray::build(const std::vector<CPointLightNamed> &pointLi
|
|||
// Regroup.
|
||||
// ---------
|
||||
_PointLightGroupMap.clear();
|
||||
if(_PointLights.size() > 0 )
|
||||
if (!_PointLights.empty())
|
||||
{
|
||||
bool first= true;
|
||||
string precName;
|
||||
|
|
|
@ -239,7 +239,7 @@ void CPSLocated::releaseAllRef()
|
|||
// If this happen, you can register with the registerDTorObserver
|
||||
// (observer pattern)
|
||||
// and override notifyTargetRemove to call releaseCollisionInfo
|
||||
nlassert(_IntegrableForces.size() == 0);
|
||||
nlassert(_IntegrableForces.empty());
|
||||
nlassert(_NonIntegrableForceNbRefs == 0);
|
||||
CHECK_PS_INTEGRITY
|
||||
}
|
||||
|
@ -839,7 +839,7 @@ CPSLocated::~CPSLocated()
|
|||
// If this happen, you can register with the registerDTorObserver
|
||||
// (observer pattern)
|
||||
// and override notifyTargetRemove to call releaseCollisionInfo
|
||||
nlassert(_IntegrableForces.size() == 0);
|
||||
nlassert(_IntegrableForces.empty());
|
||||
nlassert(_NonIntegrableForceNbRefs == 0);
|
||||
|
||||
// delete all bindable
|
||||
|
|
|
@ -1234,7 +1234,7 @@ bool CPSConstraintMesh::update(std::vector<sint> *numVertsVect /*= NULL*/)
|
|||
uint numVerts = 0;
|
||||
uint8 uvRouting[CVertexBuffer::MaxStage];
|
||||
|
||||
if (_MeshShapeFileName.size() == 0)
|
||||
if (_MeshShapeFileName.empty())
|
||||
{
|
||||
_MeshShapeFileName.resize(1);
|
||||
_MeshShapeFileName[0] = DummyShapeName;
|
||||
|
@ -1386,7 +1386,7 @@ bool CPSConstraintMesh::update(std::vector<sint> *numVertsVect /*= NULL*/)
|
|||
_GlobalAnimDate = _Owner->getOwner()->getSystemDate();
|
||||
_Touched = 0;
|
||||
_ValidBuild = ok ? 1 : 0;
|
||||
nlassert(_Meshes.size() > 0);
|
||||
nlassert(!_Meshes.empty());
|
||||
|
||||
return ok;
|
||||
|
||||
|
@ -1491,7 +1491,7 @@ void CPSConstraintMesh::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
|
|||
{
|
||||
if (!f.isReading())
|
||||
{
|
||||
if (_MeshShapeFileName.size() > 0)
|
||||
if (!_MeshShapeFileName.empty())
|
||||
{
|
||||
f.serial(_MeshShapeFileName[0]);
|
||||
}
|
||||
|
@ -1751,7 +1751,7 @@ void CPSConstraintMesh::draw(bool opaque)
|
|||
_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))
|
||||
{
|
||||
|
|
|
@ -753,7 +753,7 @@ bool CInstanceGroup::addToSceneWhenAllShapesLoaded (CScene& scene, IDriver *driv
|
|||
for (i = 0; i < _Instances.size(); ++i)
|
||||
if (_Instances[i] != NULL && !_InstancesInfos[i].DontAddToScene)
|
||||
{
|
||||
if (_InstancesInfos[i].Clusters.size() > 0)
|
||||
if (!_InstancesInfos[i].Clusters.empty())
|
||||
{
|
||||
_Instances[i]->clipUnlinkFromAll();
|
||||
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
|
||||
// -----------------
|
||||
// If some PointLight to animate
|
||||
if(_PointLightArray.getPointLights().size() > 0)
|
||||
if(!_PointLightArray.getPointLights().empty())
|
||||
scene.addInstanceGroupForLightAnimation(this);
|
||||
|
||||
_AddToSceneState = StateAdded;
|
||||
|
@ -1040,7 +1040,7 @@ bool CInstanceGroup::removeFromScene (CScene& scene)
|
|||
// UnRegister the instanceGroup for light animation
|
||||
// -----------------
|
||||
// If some PointLight to animate
|
||||
if(_PointLightArray.getPointLights().size() > 0)
|
||||
if(!_PointLightArray.getPointLights().empty())
|
||||
scene.removeInstanceGroupForLightAnimation(this);
|
||||
|
||||
if (_AddRemoveInstance)
|
||||
|
@ -1117,7 +1117,7 @@ void CInstanceGroup::setClusterSystemForInstances(CInstanceGroup *pIG)
|
|||
{
|
||||
_ClusterSystemForInstances = pIG;
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -589,10 +589,7 @@ void CShapeBank::cancelLoadAsync (const std::string &shapeNameNotLwr)
|
|||
|
||||
bool CShapeBank::isShapeWaiting ()
|
||||
{
|
||||
if (WaitingShapes.size() == 0)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
return !WaitingShapes.empty();
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -78,7 +78,7 @@ uint32 CTextContext::textPush (const char *format, ...)
|
|||
CComputedString csTmp;
|
||||
|
||||
_CacheStrings.push_back (csTmp);
|
||||
if (_CacheFreePlaces.size() == 0)
|
||||
if (_CacheFreePlaces.empty())
|
||||
_CacheFreePlaces.resize (1);
|
||||
_CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1;
|
||||
_CacheNbFreePlaces = 1;
|
||||
|
@ -104,7 +104,7 @@ uint32 CTextContext::textPush (const ucstring &str)
|
|||
CComputedString csTmp;
|
||||
|
||||
_CacheStrings.push_back (csTmp);
|
||||
if (_CacheFreePlaces.size() == 0)
|
||||
if (_CacheFreePlaces.empty())
|
||||
_CacheFreePlaces.resize (1);
|
||||
_CacheFreePlaces[0] = (uint32)_CacheStrings.size()-1;
|
||||
_CacheNbFreePlaces = 1;
|
||||
|
|
|
@ -441,7 +441,7 @@ void CTileBank::cleanUnusedData ()
|
|||
// ***************************************************************************
|
||||
CTileNoiseMap *CTileBank::getTileNoiseMap (uint tileNumber, uint tileSubNoise)
|
||||
{
|
||||
if (_DisplacementMap.size() == 0)
|
||||
if (_DisplacementMap.empty())
|
||||
{
|
||||
// it happens when serial a tile bank with version < 4
|
||||
return NULL;
|
||||
|
|
|
@ -2851,7 +2851,7 @@ bool CZoneLighter::isLightableShape(IShape &shape)
|
|||
void CZoneLighter::lightShapes(uint zoneID, const CLightDesc& description)
|
||||
{
|
||||
/// 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 currShapeIndex = 0;
|
||||
|
@ -3785,7 +3785,7 @@ uint CZoneLighter::getAPatch (uint process)
|
|||
|
||||
nlassert(index < _PatchInfo.size());
|
||||
|
||||
if (access.value().size() == 0)
|
||||
if (access.value().empty())
|
||||
// no more patches
|
||||
return 0xffffffff;
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ bool CZoneManager::isWorkComplete (CZoneManager::SZoneManagerWork &rWork)
|
|||
// ------------------------------------------------------------------------------------------------
|
||||
void CZoneManager::clear()
|
||||
{
|
||||
nlassert(_LoadingZones.size() == 0);
|
||||
nlassert(_LoadingZones.empty());
|
||||
_LoadedZones.clear();
|
||||
_RemovingZone = false;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace NLGUI
|
|||
string allparam = Params;
|
||||
skipBlankAtStart (allparam);
|
||||
string param = toLower (ParamName);
|
||||
while (allparam.size() > 0)
|
||||
while (!allparam.empty())
|
||||
{
|
||||
std::string::size_type e = allparam.find('=');
|
||||
if (e == std::string::npos || e == 0) break;
|
||||
|
@ -95,7 +95,7 @@ namespace NLGUI
|
|||
{
|
||||
string allparam = Params;
|
||||
skipBlankAtStart (allparam);
|
||||
while (allparam.size() > 0)
|
||||
while (!allparam.empty())
|
||||
{
|
||||
std::string::size_type e = allparam.find('=');
|
||||
if (e == std::string::npos || e == 0) break;
|
||||
|
|
|
@ -149,7 +149,7 @@ namespace NLGUI
|
|||
}
|
||||
|
||||
// The first type in display type struct is the default display type
|
||||
if (_DispTypes.size() == 0)
|
||||
if (_DispTypes.empty())
|
||||
{
|
||||
SDisplayType dt;
|
||||
dt.Name = "default";
|
||||
|
|
|
@ -513,7 +513,7 @@ namespace NLGUI
|
|||
// redirect, get the location and try browse again
|
||||
// we cant use curl redirection because 'addHTTPGetParams()' must be called on new destination
|
||||
std::string location(_CurlWWW->getLocationHeader());
|
||||
if (location.size() > 0)
|
||||
if (!location.empty())
|
||||
{
|
||||
#ifdef LOG_DL
|
||||
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;
|
||||
#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());
|
||||
#endif
|
||||
}
|
||||
|
@ -1628,7 +1628,7 @@ namespace NLGUI
|
|||
|
||||
// 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";
|
||||
if (text.size() > 0)
|
||||
if (!text.empty())
|
||||
{
|
||||
// escape AH param separator
|
||||
string tmp = text;
|
||||
|
@ -3805,7 +3805,7 @@ namespace NLGUI
|
|||
|
||||
|
||||
CUrlParser uri(url);
|
||||
if (uri.hash.size() > 0)
|
||||
if (!uri.hash.empty())
|
||||
{
|
||||
// Anchor to scroll after page has loaded
|
||||
_UrlFragment = uri.hash;
|
||||
|
@ -3951,7 +3951,7 @@ namespace NLGUI
|
|||
|
||||
void CGroupHTML::registerAnchor(CInterfaceElement* elm)
|
||||
{
|
||||
if (_AnchorName.size() > 0)
|
||||
if (!_AnchorName.empty())
|
||||
{
|
||||
for(uint32 i=0; i < _AnchorName.size(); ++i)
|
||||
{
|
||||
|
@ -5123,7 +5123,7 @@ namespace NLGUI
|
|||
#endif
|
||||
|
||||
// create <html> markup for image downloads
|
||||
if (type.find("image/") == 0 && content.size() > 0)
|
||||
if (type.find("image/") == 0 && !content.empty())
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -1063,7 +1063,7 @@ namespace NLGUI
|
|||
{
|
||||
// update the list size
|
||||
sint32 newH = _H + child->getH();
|
||||
if (_Elements.size() > 0)
|
||||
if (!_Elements.empty())
|
||||
newH += _Space;
|
||||
_H = newH;
|
||||
|
||||
|
@ -1077,7 +1077,7 @@ namespace NLGUI
|
|||
{
|
||||
// Update the list coords
|
||||
sint32 newW = _W + child->getW();
|
||||
if (_Elements.size() > 0)
|
||||
if (!_Elements.empty())
|
||||
newW += _Space;
|
||||
_W = newW;
|
||||
|
||||
|
@ -1412,7 +1412,7 @@ namespace NLGUI
|
|||
|
||||
void CGroupList::onTextChanged()
|
||||
{
|
||||
if( _Elements.size() == 0 )
|
||||
if( _Elements.empty() )
|
||||
return;
|
||||
|
||||
CElementInfo &e = _Elements[ 0 ];
|
||||
|
|
|
@ -1212,7 +1212,7 @@ namespace NLGUI
|
|||
{
|
||||
// update the list size
|
||||
sint32 newH = _H + child->getH();
|
||||
if (_Elements.size() > 0)
|
||||
if (!_Elements.empty())
|
||||
newH += _Space;
|
||||
_H = newH;
|
||||
|
||||
|
@ -1226,7 +1226,7 @@ namespace NLGUI
|
|||
{
|
||||
// Update the list coords
|
||||
sint32 newW = _W + child->getW();
|
||||
if (_Elements.size() > 0)
|
||||
if (!_Elements.empty())
|
||||
newW += _Space;
|
||||
_W = newW;
|
||||
|
||||
|
@ -1456,7 +1456,7 @@ namespace NLGUI
|
|||
|
||||
void CGroupParagraph::onTextChanged()
|
||||
{
|
||||
if( _Elements.size() == 0 )
|
||||
if( _Elements.empty() )
|
||||
return;
|
||||
|
||||
CElementInfo &e = _Elements[ 0 ];
|
||||
|
|
|
@ -210,7 +210,7 @@ namespace NLGUI
|
|||
|
||||
static DECLARE_INTERFACE_USER_FCT(userFctIdentity)
|
||||
{
|
||||
if (args.size() > 0)
|
||||
if (!args.empty())
|
||||
{
|
||||
result = args[0];
|
||||
return true;
|
||||
|
@ -354,9 +354,9 @@ namespace NLGUI
|
|||
|
||||
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)
|
||||
{
|
||||
args[i].toString();
|
||||
|
|
|
@ -1003,7 +1003,7 @@ namespace NLGUI
|
|||
{
|
||||
string idTmp = id, lidTmp = lid;
|
||||
// bool isFound = true;
|
||||
while (idTmp.size() > 0)
|
||||
while (!idTmp.empty())
|
||||
{
|
||||
string tokid, toklid;
|
||||
|
||||
|
@ -1782,7 +1782,7 @@ namespace NLGUI
|
|||
{
|
||||
// bool bUnder =
|
||||
pChild->getViewsUnder (x, y, clipX, clipY, clipW, clipH, vVB);
|
||||
// if (bUnder && (vICL.size() > 0))
|
||||
// if (bUnder && !vICL.empty())
|
||||
// return true;
|
||||
}
|
||||
}
|
||||
|
@ -1837,7 +1837,7 @@ namespace NLGUI
|
|||
{
|
||||
// bool bUnder =
|
||||
pChild->getCtrlsUnder (x, y, clipX, clipY, clipW, clipH, vICL);
|
||||
// if (bUnder && (vICL.size() > 0))
|
||||
// if (bUnder && !vICL.empty())
|
||||
// return true;
|
||||
}
|
||||
}
|
||||
|
@ -1893,7 +1893,7 @@ namespace NLGUI
|
|||
{
|
||||
// bool bUnder =
|
||||
pChild->getGroupsUnder (x, y, clipX, clipY, clipW, clipH, vIGL);
|
||||
// if (bUnder && (vICL.size() > 0))
|
||||
// if (bUnder && !vICL.empty())
|
||||
// return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -668,7 +668,7 @@ namespace NLGUI
|
|||
{
|
||||
std::vector<CTargetInfo> vTargets;
|
||||
splitLinkTargets(Target, pIG, vTargets);
|
||||
if ((vTargets.size() > 0) && (vTargets[0].Elem))
|
||||
if (!vTargets.empty() && (vTargets[0].Elem))
|
||||
{
|
||||
vTargets[0].affect(val);
|
||||
}
|
||||
|
|
|
@ -673,7 +673,7 @@ namespace NLGUI
|
|||
string NewProp;
|
||||
string RepProp;
|
||||
|
||||
while (LastProp.size() > 0)
|
||||
while (!LastProp.empty())
|
||||
{
|
||||
string::size_type diesPos = LastProp.find("#");
|
||||
if (diesPos != string::npos)
|
||||
|
|
|
@ -1520,7 +1520,7 @@ namespace NLGUI
|
|||
CSString s = str;
|
||||
// Create table recursively (ex: 'game.TPVPClan' will check/create the table 'game' and 'game.TPVPClan')
|
||||
p = s.splitTo('.', true);
|
||||
while (p.size() > 0)
|
||||
while (!p.empty())
|
||||
{
|
||||
if (path.empty() )
|
||||
path = p;
|
||||
|
|
|
@ -415,7 +415,7 @@ namespace NLGUI
|
|||
}
|
||||
}
|
||||
|
||||
if (_TexsId.size() == 0)
|
||||
if (_TexsId.empty())
|
||||
{
|
||||
for (i = 0; i < _Texs.size(); ++i)
|
||||
_TexsId.push_back(rVR.getTextureIdFromName(_Texs[i]));
|
||||
|
|
|
@ -241,7 +241,7 @@ namespace NLGUI
|
|||
// ***************************************************************************
|
||||
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 textcontext;
|
||||
|
@ -257,7 +257,7 @@ namespace NLGUI
|
|||
driver->deleteTextContext(fonts[name]);
|
||||
|
||||
std::string fontFile = CPath::lookup(font, false);
|
||||
if (fontFile.size() == 0)
|
||||
if (fontFile.empty())
|
||||
{
|
||||
nlwarning("Font file '%s' not found", font.c_str());
|
||||
return false;
|
||||
|
|
|
@ -898,7 +898,7 @@ namespace NLGUI
|
|||
if ((_MultiLine)&&(_Parent != NULL))
|
||||
{
|
||||
// If never setuped, and if text is not empty
|
||||
if (_Lines.size() == 0 && !_Text.empty())
|
||||
if (_Lines.empty() && !_Text.empty())
|
||||
invalidateContent ();
|
||||
|
||||
sint currentMaxW= getCurrentMultiLineMaxW();
|
||||
|
@ -986,7 +986,7 @@ namespace NLGUI
|
|||
// *** Draw multiline
|
||||
if ((_MultiLine)&&(_Parent != NULL))
|
||||
{
|
||||
if (_Lines.size() == 0) return;
|
||||
if (_Lines.empty()) return;
|
||||
|
||||
TextContext->setHotSpot (UTextContext::BottomLeft);
|
||||
TextContext->setShaded (_Shadow);
|
||||
|
@ -1669,7 +1669,7 @@ namespace NLGUI
|
|||
{
|
||||
if (expandSpaces)
|
||||
{
|
||||
nlassert(_Lines.size() > 0);
|
||||
nlassert(!_Lines.empty());
|
||||
nlassert(_Lines.back()->getNumWords() > 0);
|
||||
|
||||
// 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
|
||||
if ((_Lines.size() > 0) && (_MultiMaxLine > 0) && (_Lines.size() > _MultiMaxLine))
|
||||
if (!_Lines.empty() && (_MultiMaxLine > 0) && (_Lines.size() > _MultiMaxLine))
|
||||
{
|
||||
while (_Lines.size() > _MultiMaxLine)
|
||||
{
|
||||
|
@ -1905,7 +1905,7 @@ namespace NLGUI
|
|||
_H = std::max(_H, sint(_FontHeight * _MultiMinLine + (_MultiMinLine - 1) * _MultiLineSpace));
|
||||
|
||||
// Compute tooltips size
|
||||
if (_Tooltips.size() > 0)
|
||||
if (!_Tooltips.empty())
|
||||
for (uint i=0 ; i<_Lines.size() ; ++i)
|
||||
{
|
||||
for (uint j=0 ; j<_Lines[i]->getNumWords() ; ++j)
|
||||
|
|
|
@ -3334,7 +3334,7 @@ namespace NLGUI
|
|||
{
|
||||
const CProcAction &action = proc.Actions[i];
|
||||
// test if the condition for the action is valid
|
||||
if( action.CondBlocks.size() > 0 )
|
||||
if (!action.CondBlocks.empty())
|
||||
{
|
||||
CInterfaceExprValue result;
|
||||
result.setBool( false );
|
||||
|
|
|
@ -337,7 +337,7 @@ bool CLogicConditionNode::testLogic()
|
|||
}
|
||||
|
||||
// if there's no subtree we assess the subtree is true
|
||||
if( _Nodes.size() == 0 )
|
||||
if( _Nodes.empty() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -653,7 +653,7 @@ bool CBigFile::getFileInternal (const std::string &sFileName, BNP *&zeBnp, BNPFi
|
|||
}
|
||||
|
||||
BNP &rbnp = _BNPs.find (zeBigFileName)->second;
|
||||
if (rbnp.Files.size() == 0)
|
||||
if (rbnp.Files.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -746,7 +746,7 @@ char *CBigFile::getFileNamePtr(const std::string &sFileName, const std::string &
|
|||
{
|
||||
BNP &rbnp = _BNPs.find (bigfilenamealone)->second;
|
||||
vector<BNPFile>::iterator itNBPFile;
|
||||
if (rbnp.Files.size() == 0)
|
||||
if (rbnp.Files.empty())
|
||||
return NULL;
|
||||
string lwrFileName = toLower(sFileName);
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ void CCDBNodeBranch::init( xmlNodePtr node, IProgressCallback &progressCallBack,
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( _Nodes.size() > 0 )
|
||||
if (!_Nodes.empty())
|
||||
for ( _IdBits=1; _Nodes.size() > unsigned(1<<_IdBits) ; _IdBits++ ) {}
|
||||
else
|
||||
_IdBits = 0;
|
||||
|
|
|
@ -666,7 +666,7 @@ NLMISC_CATEGORISED_COMMAND(nel,help,"display help on a specific variable/command
|
|||
CCommandRegistry &cr = CCommandRegistry::getInstance();
|
||||
|
||||
// treat the case where we have no parameters
|
||||
if (args.size() == 0)
|
||||
if (args.empty())
|
||||
{
|
||||
// display a list of all command categories
|
||||
log.displayNL("Help commands:");
|
||||
|
|
|
@ -523,7 +523,7 @@ std::string timestampToHumanReadable(uint32 timestamp)
|
|||
|
||||
uint32 fromHumanReadable (const std::string &str)
|
||||
{
|
||||
if (str.size() == 0)
|
||||
if (str.empty())
|
||||
return 0;
|
||||
|
||||
uint32 val;
|
||||
|
|
|
@ -1504,7 +1504,7 @@ NLMISC_CATEGORISED_COMMAND(nel, displayMemlog, "displays the last N line of the
|
|||
{
|
||||
uint nbLines;
|
||||
|
||||
if (args.size() == 0) nbLines = 100;
|
||||
if (args.empty()) nbLines = 100;
|
||||
else if (args.size() == 1) NLMISC::fromString(args[0], nbLines);
|
||||
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]")
|
||||
{
|
||||
if(args.size() == 0)
|
||||
if(args.empty())
|
||||
{
|
||||
DebugLog->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>]")
|
||||
{
|
||||
if(args.size() == 0)
|
||||
if(args.empty())
|
||||
DebugLog->removeFilter();
|
||||
else if(args.size() == 1)
|
||||
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", "")
|
||||
{
|
||||
if(args.size() != 0) return false;
|
||||
if(!args.empty()) return false;
|
||||
DebugLog->displayFilter(log);
|
||||
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>]")
|
||||
{
|
||||
if(args.size() == 0)
|
||||
if(args.empty())
|
||||
InfoLog->removeFilter();
|
||||
else if(args.size() == 1)
|
||||
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>]")
|
||||
{
|
||||
if(args.size() == 0)
|
||||
if(args.empty())
|
||||
WarningLog->removeFilter();
|
||||
else if(args.size() == 1)
|
||||
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", "")
|
||||
{
|
||||
if(args.size() != 0) return false;
|
||||
if(!args.empty()) return false;
|
||||
WarningLog->displayFilter(log);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -521,7 +521,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool
|
|||
std::copy(currTimer->_Name, currTimer->_Name + (endIndex - startIndex), resultName.begin() + startIndex);
|
||||
}
|
||||
TNodeVect &execNodes = nodeMap[currTimer];
|
||||
if (execNodes.size() > 0)
|
||||
if (!execNodes.empty())
|
||||
{
|
||||
currNodeStats.buildFromNodes(&execNodes[0], (uint)execNodes.size(), _MsPerTick);
|
||||
currNodeStats.getStats(resultStats, displayEx, rootStats.TotalTime, _WantStandardDeviation);
|
||||
|
|
|
@ -1999,7 +1999,7 @@ float CPolygon2D::sumDPAgainstLine(float a, float b, float c) const
|
|||
// *******************************************************************************
|
||||
bool CPolygon2D::getNonNullSeg(uint &index) const
|
||||
{
|
||||
nlassert(Vertices.size() > 0);
|
||||
nlassert(!Vertices.empty());
|
||||
float bestLength = 0.f;
|
||||
sint bestIndex = -1;
|
||||
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
|
||||
{
|
||||
nlassert(other.Vertices.size() > 0);
|
||||
nlassert(!other.Vertices.empty());
|
||||
uint nonNullSegIndex;
|
||||
/// get the orientation of this poly
|
||||
if (getNonNullSeg(nonNullSegIndex))
|
||||
|
|
|
@ -136,7 +136,7 @@ TMsDuration CStopWatch::getDuration() const
|
|||
*/
|
||||
TMsDuration CStopWatch::getPartialAverage() const
|
||||
{
|
||||
if (_Queue.size() == 0)
|
||||
if (_Queue.empty())
|
||||
return (TMsDuration)0;
|
||||
else
|
||||
return (TMsDuration)(CTime::ticksToSecond( accumulate( _Queue.begin(), _Queue.end(), 0 ) / _Queue.size() ) * 1000.0);
|
||||
|
|
|
@ -45,7 +45,7 @@ CStringMapper *CStringMapper::createLocalMapper()
|
|||
// ****************************************************************************
|
||||
TStringId CStringMapper::localMap(const std::string &str)
|
||||
{
|
||||
if (str.size() == 0)
|
||||
if (str.empty())
|
||||
return 0;
|
||||
|
||||
CAutoFastMutex automutex(&_Mutex);
|
||||
|
|
|
@ -782,13 +782,13 @@ void setInformation (const vector<string> &alarms, const vector<string> &graphup
|
|||
for (i = 0; i < alarms.size(); i+=3)
|
||||
{
|
||||
CVarPath shardvarpath (alarms[i]);
|
||||
if(shardvarpath.Destination.size() == 0 || shardvarpath.Destination[0].second.empty())
|
||||
if(shardvarpath.Destination.empty() || shardvarpath.Destination[0].second.empty())
|
||||
continue;
|
||||
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;
|
||||
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;
|
||||
|
||||
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)
|
||||
{
|
||||
CVarPath shardvarpath (graphupdate[i]);
|
||||
if(shardvarpath.Destination.size() == 0 || shardvarpath.Destination[0].second.empty())
|
||||
if(shardvarpath.Destination.empty() || shardvarpath.Destination[0].second.empty())
|
||||
continue;
|
||||
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;
|
||||
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;
|
||||
|
||||
string VarName = servicevarpath.Destination[0].second;
|
||||
|
|
|
@ -195,7 +195,7 @@ namespace NLNET
|
|||
vector<string> parts;
|
||||
NLMISC::explode(name, string("."), parts);
|
||||
|
||||
if (name.size() > 0)
|
||||
if (!name.empty())
|
||||
{
|
||||
// at least one part in the name
|
||||
// check if sub ojbcct exist
|
||||
|
@ -208,7 +208,7 @@ namespace NLNET
|
|||
sub = SubParams.back();
|
||||
}
|
||||
|
||||
if (name.size() > 0)
|
||||
if (!name.empty())
|
||||
{
|
||||
// name is more deep, need to resurse
|
||||
parts.erase(parts.begin());
|
||||
|
|
|
@ -128,7 +128,7 @@ void cbRegisterBroadcast (CMessage &msgin, TSockId /* from */, CCallbackNetBase
|
|||
std::vector<CInetAddress> addrs;
|
||||
CNamingClient::find (sid, addrs);
|
||||
|
||||
if (addrs.size() == 0)
|
||||
if (addrs.empty())
|
||||
{
|
||||
CNamingClient::RegisteredServicesMutex.enter ();
|
||||
CNamingClient::RegisteredServices.push_back (CNamingClient::CServiceEntry (name, sid, addr));
|
||||
|
|
|
@ -116,7 +116,7 @@ void CUdpSimSock::sendUDP (const uint8 *buffer, uint32& len, const CInetAddress
|
|||
CBufferizedOutPacket *bp = new CBufferizedOutPacket (&UdpSock, buffer, len, lag, addr);
|
||||
|
||||
// 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();
|
||||
|
||||
|
|
|
@ -181,8 +181,8 @@ void CVarPath::decode ()
|
|||
|
||||
bool CVarPath::isFinal ()
|
||||
{
|
||||
if(Destination.size() == 0) return true;
|
||||
if(Destination[0].second.size() == 0) return true;
|
||||
if(Destination.empty()) return true;
|
||||
if(Destination[0].second.empty()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ void CEdgeQuad::build(const CExteriorMesh &em,
|
|||
|
||||
TCollisionSurfaceDescVector cd = (*pcd);
|
||||
|
||||
if (edges[i].Link != -1 && cd.size() > 0)
|
||||
if (edges[i].Link != -1 && !cd.empty())
|
||||
{
|
||||
nlwarning ("In NLPACS::CEdgeQuad::build()");
|
||||
nlwarning ("ERROR: exterior edge %d with interior link crosses some surfaces", i);
|
||||
|
|
|
@ -313,7 +313,7 @@ void NLPACS::CGlobalRetriever::getBorders(const CAABBox &sbox, std::vector<std::
|
|||
chainType = 3;
|
||||
}
|
||||
|
||||
if (retriever.getFullOrderedChains().size() > 0)
|
||||
if (!retriever.getFullOrderedChains().empty())
|
||||
{
|
||||
const COrderedChain3f &ochain = retriever.getFullOrderedChain(entry.OChainId);
|
||||
|
||||
|
|
|
@ -2559,7 +2559,7 @@ void CAudioMixerUser::changeMaxTrack(uint maxTrack)
|
|||
else
|
||||
{
|
||||
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();
|
||||
_Tracks.pop_back();
|
||||
|
@ -2588,7 +2588,7 @@ void CAudioMixerUser::changeMaxTrack(uint maxTrack)
|
|||
non_erasable.push_back(track);
|
||||
}
|
||||
}
|
||||
while (non_erasable.size() > 0)
|
||||
while (!non_erasable.empty())
|
||||
{
|
||||
// put non erasable back into track list
|
||||
_Tracks.push_back(non_erasable.back());
|
||||
|
|
|
@ -277,7 +277,7 @@ void CSoundBank::load(const std::string &packedSheetDir, bool packedSheetUpdate)
|
|||
maxShortId = first->second.Sound->getName().getShortId();
|
||||
}
|
||||
++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");
|
||||
}
|
||||
|
|
|
@ -161,14 +161,14 @@ void LoadSceneScript (const char *ScriptName, CScene* pScene, vector<SDispCS> &D
|
|||
{
|
||||
if (nLastNbPlus >= nNbPlus)
|
||||
for (int i = 0; i < ((nLastNbPlus-nNbPlus)+1); ++i)
|
||||
if (pile.size() > 0)
|
||||
if (!pile.empty())
|
||||
pile.pop_back();
|
||||
|
||||
nLastNbPlus = nNbPlus;
|
||||
|
||||
CInstanceGroup *father = pScene->getGlobalInstanceGroup();
|
||||
|
||||
if (pile.size() > 0)
|
||||
if (!pile.empty())
|
||||
father = pile.back();
|
||||
|
||||
CInstanceGroup *ITemp = LoadInstanceGroup (nameIG);
|
||||
|
@ -338,7 +338,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
++itAcc;
|
||||
}
|
||||
if ((vCluster.size() == 0) && (DispCS[0].pIG == pCurIG))
|
||||
if (vCluster.empty() && (DispCS[0].pIG == pCurIG))
|
||||
{
|
||||
vCluster.push_back (pClipTrav->RootCluster);
|
||||
}
|
||||
|
|
|
@ -644,7 +644,7 @@ int main(int nNbArg, char **ppArgs)
|
|||
}
|
||||
}
|
||||
|
||||
if (AllLightmapNames.size() == 0)
|
||||
if (AllLightmapNames.empty())
|
||||
continue;
|
||||
|
||||
// Load all the lightmaps
|
||||
|
|
|
@ -2583,7 +2583,7 @@ void CObjectViewer::evalSoundTrack (float lastTime, float currentTime)
|
|||
for (uint i = 0; i < _ListInstance.size(); i++)
|
||||
{
|
||||
// Some animation in the list ?
|
||||
if (_ListInstance[i]->Saved.PlayList.size() > 0)
|
||||
if (!_ListInstance[i]->Saved.PlayList.empty())
|
||||
{
|
||||
// Accumul time
|
||||
float startTime = 0;
|
||||
|
|
|
@ -298,7 +298,7 @@ void CSoundAnimView::refresh(BOOL update)
|
|||
CInstanceInfo *instanceInfo = _ObjView->getInstance(selected);
|
||||
|
||||
// Some animation in the list ?
|
||||
if (instanceInfo->Saved.PlayList.size() > 0)
|
||||
if (!instanceInfo->Saved.PlayList.empty())
|
||||
{
|
||||
// Accumul time
|
||||
float startTime = 0;
|
||||
|
|
|
@ -713,7 +713,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP
|
|||
// Get the nodes
|
||||
std::vector<INode*> vectNode;
|
||||
theCNelExport.getSelectedNode (vectNode);
|
||||
if (vectNode.size() == 0)
|
||||
if (vectNode.empty())
|
||||
{
|
||||
::MessageBox(hWnd, _T("No nodes selected"), _T("Error"), MB_OK|MB_ICONEXCLAMATION);
|
||||
return ret;
|
||||
|
|
|
@ -43,7 +43,7 @@ bool CNelExport::exportCollision (const std::string &sPath, std::vector<INode *>
|
|||
// ULONG SelectDir(HWND Parent, char* Title, char* Path);
|
||||
|
||||
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(), '/');
|
||||
|
||||
if (meshBuildList.empty()) return true;
|
||||
|
|
|
@ -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
|
||||
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)
|
||||
ClearFaceWithNoLM( pMB, pMBB, AllFaces );
|
||||
if( AllFaces.size() == 0 )
|
||||
if( AllFaces.empty() )
|
||||
{
|
||||
if (InfoLog)
|
||||
InfoLog->display("CalculateLM : %d ms\n", timeGetTime()-t);
|
||||
|
|
|
@ -246,7 +246,7 @@ CRGBAF CRTWorld::raytrace (NLMISC::CVector &vVertex, sint32 nLightNb, uint8& rtV
|
|||
|
||||
RayOfLight.clip (t);
|
||||
|
||||
if (RayOfLight.Shapes.size() == 0)
|
||||
if (RayOfLight.Shapes.empty())
|
||||
return CRGBAF(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
// Next selected element
|
||||
|
|
|
@ -648,7 +648,7 @@ static bool BuildMeshInterfaces(const char *cMaxFileName, std::vector<CMeshInter
|
|||
std::inserter(mergedNodes, mergedNodes.begin())
|
||||
);
|
||||
|
||||
if (mergedNodes.size() == 0)
|
||||
if (mergedNodes.empty())
|
||||
{
|
||||
nlwarning("Couldn't find interface : %s", maxFileName.c_str());
|
||||
}
|
||||
|
|
|
@ -501,8 +501,8 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector<INode*>& vectNode, v
|
|||
}
|
||||
|
||||
// debug purpose : to remove
|
||||
if (vClusters.size() > 0)
|
||||
if (aIGArray[nNumIG].Clusters.size() == 0)
|
||||
if (!vClusters.empty())
|
||||
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());
|
||||
}
|
||||
|
|
|
@ -382,7 +382,7 @@ void scanFiles(const CSString &filespec)
|
|||
UFormElm *fieldForm=NULL;
|
||||
std::string valueString;
|
||||
|
||||
form->getRootNode ().getNodeByName(&fieldForm, fields[i]._name.c_str());
|
||||
form->getRootNode ().getNodeByName(&fieldForm, fields[i]._name);
|
||||
|
||||
if (fieldForm)
|
||||
{
|
||||
|
@ -1026,7 +1026,7 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType
|
|||
|
||||
const UFormElm *fieldForm=NULL;
|
||||
|
||||
if (rootForm.getNodeByName(&fieldForm, var.c_str()))
|
||||
if (rootForm.getNodeByName(&fieldForm, var))
|
||||
{
|
||||
UFormDfn *dfnForm=const_cast<UFormElm&>(rootForm).getStructDfn();
|
||||
nlassert(dfnForm);
|
||||
|
|
|
@ -1420,7 +1420,7 @@ void NLPACS::CZoneTessellation::compile()
|
|||
|
||||
bool force = false;
|
||||
|
||||
if (surf.Area < 30.0f && surf.Elements.size() > 0)
|
||||
if (surf.Area < 30.0f && !surf.Elements.empty())
|
||||
{
|
||||
uint i;
|
||||
CAABBox aabbox;
|
||||
|
@ -1688,7 +1688,7 @@ CAABBox NLPACS::CZoneTessellation::computeBBox() const
|
|||
bool set = false;
|
||||
uint i;
|
||||
|
||||
if (_Vertices.size() == 0)
|
||||
if (_Vertices.empty())
|
||||
return zbox;
|
||||
|
||||
zbox.setCenter(_Vertices[0]);
|
||||
|
|
|
@ -1503,7 +1503,7 @@ void CCharacterCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycl
|
|||
|
||||
// Retrieve the right sheet for clothes.
|
||||
_ClothesSheet = _Sheet;
|
||||
if(_Sheet->IdAlternativeClothes.size() > 0)
|
||||
if(!_Sheet->IdAlternativeClothes.empty())
|
||||
{
|
||||
sint32 num = rnd.rand()%(_Sheet->IdAlternativeClothes.size()+1);
|
||||
if(num > 0)
|
||||
|
@ -1531,7 +1531,7 @@ void CCharacterCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycl
|
|||
else
|
||||
_HairColor = (sint8)altLookProp.Element.ColorHair%SheetMngr.nbHairColor();
|
||||
// Hair Index
|
||||
if(_Sheet->HairItemList.size() > 0)
|
||||
if(!_Sheet->HairItemList.empty())
|
||||
{
|
||||
sint32 num = rnd.rand()%_Sheet->HairItemList.size();
|
||||
if(num>=0 && num <_BadHairIndex)
|
||||
|
@ -10279,7 +10279,7 @@ NLMISC_COMMAND(pvpMode, "modify pvp mode", "[<pvp mode> <state>]")
|
|||
if (!playerTarget)
|
||||
return false;
|
||||
|
||||
if( args.size() == 0 )
|
||||
if (args.empty())
|
||||
{
|
||||
uint16 pvpMode = playerTarget->getPvpMode();
|
||||
string str;
|
||||
|
|
|
@ -541,7 +541,7 @@ void CAnimationSetSheet::build(const NLGEORGES::UFormElm &rootElmt)
|
|||
nlinfo("%2d state '%s' :", i, stateName.c_str());
|
||||
|
||||
const UFormElm *elmt = 0;
|
||||
if(rootElmt.getNodeByName(&elmt, stateName.c_str()))
|
||||
if(rootElmt.getNodeByName(&elmt, stateName))
|
||||
{
|
||||
bool animPresent = false;
|
||||
if(elmt)
|
||||
|
|
|
@ -62,7 +62,7 @@ void CMissionSheet::build(const NLGEORGES::UFormElm &item)
|
|||
{
|
||||
const UFormElm * stepStruct;
|
||||
string varName = string("step") + NLMISC::toString(i);
|
||||
item.getNodeByName (&stepStruct, varName.c_str());
|
||||
item.getNodeByName (&stepStruct, varName);
|
||||
|
||||
if (stepStruct)
|
||||
{
|
||||
|
|
|
@ -171,7 +171,7 @@ NLMISC_COMMAND(follow, "Follow the target", "")
|
|||
NLMISC_COMMAND(where, "Ask information on the position", "")
|
||||
{
|
||||
// Check parameters.
|
||||
if(args.size() == 0)
|
||||
if(args.empty())
|
||||
{ // Create the message and send.
|
||||
const string msgName = "COMMAND:WHERE";
|
||||
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>]")
|
||||
{
|
||||
string customText;
|
||||
if( args.size() > 0 )
|
||||
if (!args.empty())
|
||||
{
|
||||
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>")
|
||||
{
|
||||
if(args.size() == 0)
|
||||
if(args.empty())
|
||||
return false;
|
||||
|
||||
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>")
|
||||
{
|
||||
if(args.size() == 0)
|
||||
if(args.empty())
|
||||
return false;
|
||||
|
||||
CBitMemStream out;
|
||||
|
@ -873,7 +873,7 @@ NLMISC_COMMAND(boxes, "Show/Hide selection boxes", "[<state> : 0 to Hide, anythi
|
|||
#endif // FINAL_VERSION
|
||||
|
||||
// Invert Current State
|
||||
if(args.size() == 0)
|
||||
if(args.empty())
|
||||
{
|
||||
// Invert the current value.
|
||||
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>")
|
||||
{
|
||||
if (args.size() == 0)
|
||||
if (args.empty())
|
||||
return false;
|
||||
|
||||
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;
|
||||
|
||||
// Check parameters.
|
||||
if(args.size() == 0)
|
||||
if(args.empty())
|
||||
{
|
||||
fn = "FireWorkA_with_sound.ps";
|
||||
}
|
||||
|
@ -3749,6 +3749,23 @@ NLMISC_COMMAND(test, "", "")
|
|||
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.
|
||||
|
@ -5737,7 +5754,7 @@ NLMISC_COMMAND(em, "emote command", "<emote phrase>")
|
|||
if( pIM )
|
||||
{
|
||||
string emotePhrase;
|
||||
if( args.size() > 0 )
|
||||
if (!args.empty())
|
||||
{
|
||||
emotePhrase = args[0];
|
||||
}
|
||||
|
@ -5762,7 +5779,7 @@ NLMISC_COMMAND(guildmotd, "Set or see the guild message of the day","<msg of the
|
|||
return false;
|
||||
|
||||
string gmotd;
|
||||
if( args.size() > 0 )
|
||||
if (!args.empty())
|
||||
{
|
||||
gmotd = args[0];
|
||||
}
|
||||
|
|
|
@ -396,7 +396,7 @@ void CContinentManager::select(const CVectorD &pos, NLMISC::IProgressCallback &p
|
|||
{
|
||||
CContinent *pCont = it->second;
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
static NLMISC::CVector2f getZoneCenter(const NLLIGO::CPrimZone &z)
|
||||
{
|
||||
NLMISC::CVector2f vMin, vMax;
|
||||
if (z.VPoints.size() == 0)
|
||||
if (z.VPoints.empty())
|
||||
return NLMISC::CVector2f(0,0);
|
||||
vMin = vMax = z.VPoints[0];
|
||||
for (uint32 i = 1; i < z.VPoints.size(); ++i)
|
||||
|
|
|
@ -233,7 +233,7 @@ void CDoorManager::SDoor::checkToClose()
|
|||
}
|
||||
}
|
||||
|
||||
if (Entities.size() == 0)
|
||||
if (Entities.empty())
|
||||
close();
|
||||
else
|
||||
open();
|
||||
|
|
|
@ -780,7 +780,7 @@ class CHandlerOpenTitleHelp : public IActionHandler
|
|||
if (pTU != NULL)
|
||||
{
|
||||
sSkillsNeeded = CI18N::get("uiTitleSkillHeader");
|
||||
if (pTU->SkillsNeeded.size() == 0 || reservedTitle)
|
||||
if (pTU->SkillsNeeded.empty() || reservedTitle)
|
||||
{
|
||||
sSkillsNeeded += CI18N::get("uiTitleSkillNoNeed");
|
||||
}
|
||||
|
@ -821,7 +821,7 @@ class CHandlerOpenTitleHelp : public IActionHandler
|
|||
if (pTU != NULL)
|
||||
{
|
||||
sBricksNeeded = CI18N::get("uiTitleBrickHeader");
|
||||
if (pTU->BricksNeeded.size() == 0 || reservedTitle)
|
||||
if (pTU->BricksNeeded.empty() || reservedTitle)
|
||||
{
|
||||
sBricksNeeded += CI18N::get("uiTitleBrickNoNeed");
|
||||
}
|
||||
|
|
|
@ -1656,7 +1656,7 @@ DECLARE_INTERFACE_CONSTANT(getPhraseBrickSelectionMax, CDBGroupBuildPhrase::MaxS
|
|||
// Get the UC name of a phraseId
|
||||
static DECLARE_INTERFACE_USER_FCT(getSPhraseName)
|
||||
{
|
||||
if (args.size() > 0)
|
||||
if (!args.empty())
|
||||
{
|
||||
if(!args[0].toInteger())
|
||||
return false;
|
||||
|
|
|
@ -1265,7 +1265,7 @@ public:
|
|||
if (pEB == NULL) return;
|
||||
ucstring text = pEB->getInputString();
|
||||
// If the line is empty, do nothing
|
||||
if(text.size() == 0)
|
||||
if(text.empty())
|
||||
return;
|
||||
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ struct CWebigNotificationThread : public NLMISC::IRunnable
|
|||
// Update the mail notification icon
|
||||
|
||||
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);
|
||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||
|
|
|
@ -473,7 +473,7 @@ void CGroupInSceneBubbleManager::update ()
|
|||
|
||||
CGroupInSceneBubble *CGroupInSceneBubbleManager::newBubble (const ucstring &text)
|
||||
{
|
||||
if (!text.empty() && _Bubbles.size ())
|
||||
if (!text.empty() && !_Bubbles.empty())
|
||||
{
|
||||
// Get a bubble
|
||||
CGroupInSceneBubble *bubble = _Bubbles[_CurrentBubble];
|
||||
|
|
|
@ -1231,13 +1231,13 @@ void CGroupMap::checkCoords()
|
|||
NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:RESPAWN_PT")->setValue32(_RespawnSelected);
|
||||
else if (_MapMode == MapMode_SpawnSquad)
|
||||
NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:SQUAD_RESPAWN_PT")->setValue32(_RespawnSelected);
|
||||
if (_RespawnLM.size() > 0)
|
||||
if (!_RespawnLM.empty())
|
||||
_RespawnSelectedBitmap->setParentPos(_RespawnLM[_RespawnSelected]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_RespawnSelected = getRespawnSelected();
|
||||
if (_RespawnLM.size() > 0)
|
||||
if (!_RespawnLM.empty())
|
||||
_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
|
||||
if (_MapMode != MapMode_Death) return;
|
||||
if (_RespawnPos.size() == 0) return;
|
||||
if (_RespawnPos.empty()) return;
|
||||
|
||||
CWorldSheet *pWS = dynamic_cast<CWorldSheet*>(SheetMngr.get(CSheetId("ryzom.world")));
|
||||
if (pWS == NULL) return;
|
||||
|
@ -3113,7 +3113,7 @@ sint32 CGroupMap::getRespawnSelected() const
|
|||
//=========================================================================================================
|
||||
void CGroupMap::setRespawnSelected(sint32 nSpawnPointIndex)
|
||||
{
|
||||
if (_RespawnPos.size() == 0) return;
|
||||
if (_RespawnPos.empty()) return;
|
||||
if (nSpawnPointIndex < 0) return;
|
||||
if ((uint32)nSpawnPointIndex >= _RespawnPos.size()) return;
|
||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||
|
|
|
@ -409,7 +409,7 @@ void CGuildManager::update()
|
|||
}
|
||||
|
||||
// Search for UserEntity to find our own grade
|
||||
if ((UserEntity != NULL) && (_GuildMembers.size() > 0))
|
||||
if ((UserEntity != NULL) && (!_GuildMembers.empty()))
|
||||
{
|
||||
uint i;
|
||||
_Grade = EGSPD::CGuildGrade::Member;
|
||||
|
|
|
@ -323,7 +323,7 @@ bool CInterface3DScene::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
|
|||
}
|
||||
|
||||
// If no camera create the default one
|
||||
if (_Cameras.size() == 0)
|
||||
if (_Cameras.empty())
|
||||
{
|
||||
CInterface3DCamera *pCam = new CInterface3DCamera;
|
||||
_Cameras.push_back(pCam);
|
||||
|
@ -494,7 +494,7 @@ void CInterface3DScene::draw ()
|
|||
cam.lookAt (pos, pI3DCam->getTarget(), pI3DCam->getRoll() * (float) (NLMISC::Pi / 180));
|
||||
|
||||
uint i;
|
||||
if (_IGs.size() > 0)
|
||||
if (!_IGs.empty())
|
||||
{
|
||||
for (i = 0; i < _Characters.size(); ++i)
|
||||
_Characters[i]->setClusterSystem (_IGs[_CurrentCS]->getIG());
|
||||
|
|
|
@ -3169,7 +3169,7 @@ void CInterfaceManager::uninitEmotes()
|
|||
|
||||
// reset the emotes menu
|
||||
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
|
||||
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 */)
|
||||
{
|
||||
string customPhrase;
|
||||
if( args.size() > 0 )
|
||||
if (!args.empty())
|
||||
{
|
||||
customPhrase = args[0];
|
||||
}
|
||||
|
@ -3817,7 +3817,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
|
|||
vector<ucstring> token_vector;
|
||||
vector<ucstring> param_vector;
|
||||
splitUCString(token_string, ucstring("."), token_vector);
|
||||
if (token_vector.size() == 0)
|
||||
if (token_vector.empty())
|
||||
{
|
||||
// Wrong formatting; give up on this one.
|
||||
start_pos = end_pos;
|
||||
|
@ -3827,7 +3827,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
|
|||
if (token_vector.size() == 1)
|
||||
{
|
||||
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");
|
||||
}
|
||||
else if (token_vector.size() > 1)
|
||||
|
@ -3836,7 +3836,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
|
|||
if (token_param.luabind_substr(0, 3) != ucstring("gs("))
|
||||
{
|
||||
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("");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ void CItemSpecialEffectHelper::registerItemSpecialEffect(const string &name)
|
|||
// %r : real
|
||||
// %s : string
|
||||
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')
|
||||
{
|
||||
|
|
|
@ -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')
|
||||
p = s.splitTo('.', true);
|
||||
|
||||
while (p.size() > 0)
|
||||
while (!p.empty())
|
||||
{
|
||||
if (path.empty())
|
||||
path = p;
|
||||
|
@ -2917,7 +2917,7 @@ ucstring CLuaIHMRyzom::replacePvpEffectParam(const ucstring &str, sint32 paramet
|
|||
// Locate parameter and store it
|
||||
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')
|
||||
{
|
||||
|
|
|
@ -916,7 +916,7 @@ public:
|
|||
CAHManager::getInstance()->runActionHandler("new_macro_enter_name",NULL);
|
||||
|
||||
// Check if macro has more than one command
|
||||
if (pMCM->CurrentEditMacro.Commands.size() == 0) return;
|
||||
if (pMCM->CurrentEditMacro.Commands.empty()) return;
|
||||
|
||||
// Add a macro
|
||||
if (pMCM->CurrentEditMacroNb != -1)
|
||||
|
|
|
@ -871,7 +871,7 @@ class CHandlerContactEntry : public IActionHandler
|
|||
if (pEB == NULL) return;
|
||||
ucstring text = pEB->getInputString();
|
||||
// If the line is empty, do nothing
|
||||
if(text.size() == 0)
|
||||
if(text.empty())
|
||||
return;
|
||||
|
||||
// Parse any tokens in the text
|
||||
|
|
|
@ -302,9 +302,9 @@ void initCatDisplay()
|
|||
// Check is good now ask the player if he wants to apply the patch
|
||||
pPM->getInfoToDisp(InfoOnPatch);
|
||||
|
||||
if ((InfoOnPatch.NonOptCat.size() > 0) ||
|
||||
(InfoOnPatch.OptCat.size() > 0) ||
|
||||
(InfoOnPatch.ReqCat.size() > 0))
|
||||
if ((!InfoOnPatch.NonOptCat.empty()) ||
|
||||
(!InfoOnPatch.OptCat.empty()) ||
|
||||
(!InfoOnPatch.ReqCat.empty()))
|
||||
{
|
||||
createOptionalCatUI();
|
||||
NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_CATDISP);
|
||||
|
@ -529,9 +529,9 @@ void loginMainLoop()
|
|||
|
||||
AvailablePatchs = InfoOnPatch.getAvailablePatchsBitfield();
|
||||
|
||||
if ((InfoOnPatch.NonOptCat.size() > 0) ||
|
||||
(InfoOnPatch.OptCat.size() > 0) ||
|
||||
(InfoOnPatch.ReqCat.size() > 0))
|
||||
if ((!InfoOnPatch.NonOptCat.empty()) ||
|
||||
(!InfoOnPatch.OptCat.empty()) ||
|
||||
(!InfoOnPatch.ReqCat.empty()))
|
||||
{
|
||||
LoginSM.pushEvent(CLoginStateMachine::ev_patch_needed);
|
||||
// createOptionalCatUI();
|
||||
|
|
|
@ -1315,7 +1315,7 @@ void CPatchManager::getServerFile (const std::string &name, bool bZipped, const
|
|||
std::string serverPath;
|
||||
std::string serverDisplayPath;
|
||||
|
||||
if (UsedServer >= 0 && PatchServers.size() > 0)
|
||||
if (UsedServer >= 0 && !PatchServers.empty())
|
||||
{
|
||||
// first use main patch servers
|
||||
serverPath = PatchServers[UsedServer].ServerPath;
|
||||
|
@ -2202,7 +2202,7 @@ void CCheckThread::run ()
|
|||
nlwarning(rDescFiles.getFile(i).getFileName().c_str());
|
||||
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
|
||||
if (ftp.Patches.size() > 0 || (IncludeBackgroundPatch && !ftp.SrcFileName.empty()))
|
||||
if (!ftp.Patches.empty() || (IncludeBackgroundPatch && !ftp.SrcFileName.empty()))
|
||||
{
|
||||
pPM->FilesToPatch.push_back(ftp);
|
||||
sTranslate = CI18N::get("uiNeededPatches") + " " + toString (ftp.Patches.size());
|
||||
|
|
|
@ -512,7 +512,7 @@ CXDeltaPatch::TApplyResult CXDeltaPatch::apply(const std::string &sFileToPatch,
|
|||
return ApplyResult_UnsupportedXDeltaFormat;
|
||||
}
|
||||
|
||||
if (_Ctrl.SourceInfo.size() == 0)
|
||||
if (_Ctrl.SourceInfo.empty())
|
||||
{
|
||||
errorMsg = "no source info";
|
||||
return ApplyResult_Error;
|
||||
|
@ -527,7 +527,7 @@ CXDeltaPatch::TApplyResult CXDeltaPatch::apply(const std::string &sFileToPatch,
|
|||
SXDeltaCtrl::SSourceInfo *pFromSource = NULL;
|
||||
// SXDeltaCtrl::SSourceInfo *pDataSource = NULL;
|
||||
|
||||
if (_Ctrl.SourceInfo.size() > 0)
|
||||
if (!_Ctrl.SourceInfo.empty())
|
||||
{
|
||||
SXDeltaCtrl::SSourceInfo &rInfo = _Ctrl.SourceInfo[0];
|
||||
|
||||
|
|
|
@ -484,7 +484,7 @@ NLMISC_COMMAND(dumpNPCIconCache, "Display descriptions of NPCs", "")
|
|||
|
||||
NLMISC_COMMAND(queryMissionGiverData, "Query mission giver data for the specified alias", "<alias>")
|
||||
{
|
||||
if (args.size() == 0)
|
||||
if (args.empty())
|
||||
return false;
|
||||
uint32 alias;
|
||||
NLMISC::fromString(args[0], alias);
|
||||
|
|
|
@ -48,7 +48,7 @@ void CToolPick::setIgnoreInstances(const std::string & ignoreInstances)
|
|||
{
|
||||
//H_AUTO(R2_CToolPick_setIgnoreInstances)
|
||||
string allKind = ignoreInstances;
|
||||
while (allKind.size() > 0)
|
||||
while (!allKind.empty())
|
||||
{
|
||||
std::string::size_type e = allKind.find(',');
|
||||
string tmp;
|
||||
|
|
|
@ -785,7 +785,7 @@ void CSheetManager::computeVS()
|
|||
if(it == ProcessedItem.end())
|
||||
{
|
||||
uint itemNumber;
|
||||
if(vs[visualSlot].Element.size() == 0)
|
||||
if(vs[visualSlot].Element.empty())
|
||||
itemNumber = 1;
|
||||
else
|
||||
itemNumber = vs[visualSlot].Element[vs[visualSlot].Element.size()-1].Index+1;
|
||||
|
|
|
@ -1612,7 +1612,7 @@ const ucchar *CStringManagerClient::getTitleLocalizedName(const ucstring &titleI
|
|||
{
|
||||
vector<ucstring> listInfos = getTitleInfos(titleId, women);
|
||||
|
||||
if (listInfos.size() > 0)
|
||||
if (!listInfos.empty())
|
||||
{
|
||||
_TitleWords.push_back(listInfos[0]);
|
||||
return _TitleWords.back().c_str();
|
||||
|
@ -1629,7 +1629,7 @@ vector<ucstring> CStringManagerClient::getTitleInfos(const ucstring &titleId, bo
|
|||
vector<ucstring> listInfos;
|
||||
splitUCString(titleId, ucstring("#"), listInfos);
|
||||
|
||||
if (listInfos.size() > 0)
|
||||
if (!listInfos.empty())
|
||||
{
|
||||
if (titleId[0] != '#')
|
||||
{
|
||||
|
|
|
@ -728,12 +728,12 @@ void CEditionSession::swap(CEditionSession& other)
|
|||
void CEditionSession::update(uint32 currentTime)
|
||||
{
|
||||
|
||||
if (getCurrentChars().size() == 0 && DateSinceNoPlayer == 0 )
|
||||
if (getCurrentChars().empty() && DateSinceNoPlayer == 0 )
|
||||
{
|
||||
DateSinceNoPlayer = currentTime;
|
||||
}
|
||||
|
||||
if (getCurrentChars().size() != 0 && DateSinceNoPlayer != 0 )
|
||||
if (!getCurrentChars().empty() && DateSinceNoPlayer != 0 )
|
||||
{
|
||||
DateSinceNoPlayer = 0;
|
||||
}
|
||||
|
@ -1096,7 +1096,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
if (tokens.size() == 0)
|
||||
if (tokens.empty())
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ void sendUDP (CUdpSock *client, const uint8 *packet, uint32 packetSize, const CI
|
|||
CBufferizedPacket *bp = new CBufferizedPacket (client, packet, packetSize, lag, addr);
|
||||
|
||||
// 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();
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
|
||||
#include "stdpch.h"
|
||||
#include <functional>
|
||||
#include "deposit.h"
|
||||
#include "player_manager/character.h"
|
||||
#include "player_manager/player_manager.h"
|
||||
|
|
|
@ -370,7 +370,7 @@ void CConfigFile::setDefaultProfileIndex(int index)
|
|||
|
||||
bool CConfigFile::isRyzomInstallerConfigured() const
|
||||
{
|
||||
return m_profiles.size() > 0;
|
||||
return !m_profiles.isEmpty();
|
||||
}
|
||||
|
||||
QString CConfigFile::getInstallationDirectory() const
|
||||
|
|
|
@ -110,7 +110,7 @@ void CExport::delAllIGZoneUnderPoint (float fCellSize, CPrimPoint *pPoint, const
|
|||
void CExport::delAllIGZoneUnderPath (float fCellSize, CPrimPath *pPath, const string &sIGOutputDir)
|
||||
{
|
||||
if (pPath == NULL) return;
|
||||
if (pPath->VPoints.size() == 0) return;
|
||||
if (pPath->VPoints.empty()) return;
|
||||
uint32 i, j;
|
||||
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)
|
||||
{
|
||||
if (pPatat == NULL) return;
|
||||
if (pPatat->VPoints.size() == 0) return;
|
||||
if (pPatat->VPoints.empty()) return;
|
||||
uint32 i, j;
|
||||
CVector vMin, vMax;
|
||||
|
||||
|
@ -294,7 +294,7 @@ bool CExport::isPatatNeedUpdate (float fCellSize, CPrimZone *pPatat, const strin
|
|||
CVector vMin, vMax;
|
||||
|
||||
CTools::chdir (sIGOutputDir);
|
||||
if (pPatat->VPoints.size() == 0)
|
||||
if (pPatat->VPoints.empty())
|
||||
return false;
|
||||
vMin = vMax = pPatat->VPoints[0];
|
||||
for (i = 0; i < pPatat->VPoints.size(); ++i)
|
||||
|
@ -394,7 +394,7 @@ bool CExport::isPathNeedUpdate (float fCellSize, CPrimPath *pPath, const string
|
|||
CVector vMin, vMax;
|
||||
|
||||
CTools::chdir (sIGOutputDir);
|
||||
if (pPath->VPoints.size() == 0)
|
||||
if (pPath->VPoints.empty())
|
||||
return false;
|
||||
vMin = vMax = pPath->VPoints[0];
|
||||
for (i = 0; i < pPath->VPoints.size(); ++i)
|
||||
|
@ -1245,7 +1245,7 @@ bool CExport::doExport (SExportOptions &opt, IExportCB *expCB, vector<SExportPri
|
|||
_ExportCB = expCB;
|
||||
|
||||
// Does we have something to export
|
||||
if ((selection != NULL) && (selection->size() == 0))
|
||||
if ((selection != NULL) && (selection->empty()))
|
||||
{
|
||||
if (_ExportCB)
|
||||
_ExportCB->dispInfo ("Nothing to export");
|
||||
|
@ -1983,7 +1983,7 @@ void CExport::writeFloraIG (const string &LandFile, bool bTestForWriting)
|
|||
{
|
||||
sint32 i, j, k;
|
||||
|
||||
if (_FloraInsts.size() == 0)
|
||||
if (_FloraInsts.empty())
|
||||
return;
|
||||
|
||||
CZoneRegion zoneRegion;
|
||||
|
|
|
@ -235,7 +235,7 @@ CActionString::CActionString (IAction::TTypeAction type, const std::string &newV
|
|||
bool vdfnArray;
|
||||
CForm *form=doc.getFormPtr ();
|
||||
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) );
|
||||
if (node)
|
||||
{
|
||||
|
@ -364,7 +364,7 @@ bool CActionString::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, b
|
|||
bool parentVDnfArray;
|
||||
CForm *form=doc.getFormPtr ();
|
||||
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) );
|
||||
nlassert (node);
|
||||
CFormElmAtom *atom = safe_cast<CFormElmAtom*> (node);
|
||||
|
@ -437,14 +437,14 @@ bool CActionString::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, b
|
|||
bool vdfnArray;
|
||||
CForm *form=doc.getFormPtr ();
|
||||
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) );
|
||||
if (node)
|
||||
{
|
||||
CFormElmArray* array = safe_cast<CFormElmArray*> (node->getParent ());
|
||||
array->Elements[idInParent].Name = _Value[index];
|
||||
modified = true;
|
||||
update (true, DoNothing, doc, _FormName.c_str ());
|
||||
update (true, DoNothing, doc, _FormName);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -716,14 +716,14 @@ bool CActionStringVector::doAction (CGeorgesEditDoc &doc, bool redo, bool &modif
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc.getFormPtr ();
|
||||
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 ?
|
||||
if ((type == UFormDfn::EntryType) && array)
|
||||
{
|
||||
// Create the array
|
||||
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);
|
||||
|
||||
// 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
|
||||
_FormName = formName;
|
||||
|
|
|
@ -548,7 +548,7 @@ void CFormDialog::setToDocument (uint widget)
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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) );
|
||||
|
||||
// Must create array or virtual dfn ?
|
||||
|
@ -811,7 +811,7 @@ BOOL CFormDialog::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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) );
|
||||
nlassert (parentDfn);
|
||||
|
||||
|
@ -943,7 +943,7 @@ BOOL CFormDialog::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
|
|||
|
||||
// Search for the node
|
||||
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));
|
||||
|
||||
// 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;
|
||||
|
||||
// Print the result
|
||||
char result[512];
|
||||
sprintf (result, "%g", value);
|
||||
TCHAR result[512];
|
||||
_stprintf (result, _T("%g"), value);
|
||||
|
||||
// Set the windnow text
|
||||
combo->Combo.SetWindowText (result);
|
||||
|
@ -1097,7 +1097,7 @@ void CFormDialog::getFromDocument ()
|
|||
UFormDfn::TEntryType type;
|
||||
|
||||
// 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
|
||||
if (parentDfn)
|
||||
|
@ -1342,7 +1342,7 @@ void IFormWidget::updateLabel ()
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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) );
|
||||
|
||||
// Does the node exist ?
|
||||
|
@ -1401,7 +1401,7 @@ bool IFormWidget::getNode (const CFormDfn **parentDfn, uint &lastElement, const
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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) );
|
||||
}
|
||||
return false;
|
||||
|
@ -1558,7 +1558,7 @@ void CFormMemCombo::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent,
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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) );
|
||||
|
||||
FirstId = dialog_index;
|
||||
|
@ -1710,7 +1710,7 @@ void CFormMemCombo::getFromDocument (CForm &form)
|
|||
UFormDfn::TEntryType type;
|
||||
bool array;
|
||||
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);
|
||||
|
||||
// Node exist ?
|
||||
|
@ -1723,13 +1723,13 @@ void CFormMemCombo::getFromDocument (CForm &form)
|
|||
Combo.SetWindowText (label);
|
||||
|
||||
if (arrayNode->getForm () == &form)
|
||||
Label.SetWindowText ("Array size:");
|
||||
Label.SetWindowText (_T("Array size:"));
|
||||
else
|
||||
Label.SetWindowText ("Array size: (in parent form)");
|
||||
Label.SetWindowText (_T("Array size: (in parent form)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Combo.SetWindowText ("0");
|
||||
Combo.SetWindowText (_T("0"));
|
||||
}
|
||||
Combo.UpdateData (FALSE);
|
||||
}
|
||||
|
@ -1743,7 +1743,7 @@ void CFormMemCombo::getFromDocument (CForm &form)
|
|||
UFormDfn::TEntryType type;
|
||||
bool array;
|
||||
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);
|
||||
|
||||
// Node exist ?
|
||||
|
@ -1751,11 +1751,11 @@ void CFormMemCombo::getFromDocument (CForm &form)
|
|||
if (node)
|
||||
{
|
||||
CFormElmVirtualStruct *virtualNode = safe_cast<CFormElmVirtualStruct*> (node);
|
||||
Combo.SetWindowText (virtualNode->DfnFilename.c_str());
|
||||
Combo.SetWindowText (utf8ToTStr(virtualNode->DfnFilename));
|
||||
}
|
||||
else
|
||||
{
|
||||
Combo.SetWindowText ("");
|
||||
Combo.SetWindowText (_T(""));
|
||||
}
|
||||
Combo.UpdateData (FALSE);
|
||||
}
|
||||
|
|
|
@ -1025,7 +1025,7 @@ void CGeorgesEditApp::OnUpdateFileSaveAll(CCmdUI* pCmdUI)
|
|||
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
|
||||
const CFormDfn *parentDfn;
|
||||
|
@ -1228,7 +1228,7 @@ bool CGeorgesEditApp::FillMemStreamWithClipboard (const char *formName, CGeorges
|
|||
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
|
||||
CForm *form = doc->getFormPtr ();
|
||||
|
|
|
@ -119,11 +119,11 @@ public:
|
|||
public:
|
||||
// Memory stream
|
||||
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);
|
||||
|
||||
bool SerialIntoMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard);
|
||||
bool SerialFromMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot);
|
||||
bool SerialIntoMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard);
|
||||
bool SerialFromMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot);
|
||||
|
||||
// Init
|
||||
BOOL initInstance (int nCmdShow, bool exeStandalone, int x, int y, int cx, int cy);
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
|
||||
// From IEdit
|
||||
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 NLMISC::CConfigFile &getConfigFile() { return ConfigFile; }
|
||||
|
||||
|
@ -153,10 +153,10 @@ public:
|
|||
CImageListEx ImageList;
|
||||
|
||||
// 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 loadWindowState (CWnd *wnd, const char *name, bool changeShowWindow, bool controlBar);
|
||||
void saveWindowState (const CWnd *wnd, const std::string &name, bool controlBar);
|
||||
void loadWindowState (CWnd *wnd, const std::string &name, bool changeShowWindow, bool controlBar);
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
|
@ -176,8 +176,8 @@ public:
|
|||
void releasePlugins ();
|
||||
|
||||
// Dialog function
|
||||
void outputError (const char* message);
|
||||
bool yesNo (const char* message);
|
||||
void outputError (const std::string &message);
|
||||
bool yesNo (const std::string &message);
|
||||
bool getColor (NLMISC::CRGBA &color);
|
||||
|
||||
// Browse an URL
|
||||
|
|
|
@ -355,7 +355,7 @@ CGeorgesEditDocSub *CGeorgesEditDoc::addStruct (CGeorgesEditDocSub *parent, CFor
|
|||
{
|
||||
// Get the node by name
|
||||
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);
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ CGeorgesEditDocSub *CGeorgesEditDoc::addStruct (CGeorgesEditDocSub *parent, CFor
|
|||
{
|
||||
// Get the node by name
|
||||
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);
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ CGeorgesEditDocSub *CGeorgesEditDoc::addStruct (CGeorgesEditDocSub *parent, CFor
|
|||
{
|
||||
// Get the node by name
|
||||
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);
|
||||
}
|
||||
|
@ -1546,7 +1546,7 @@ int CGeorgesEditDocSub::getItemImage (CGeorgesEditDoc *doc) const
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ void CGeorgesImpl::PutGroupText (const std::vector<std::string>& _vText, bool ap
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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 ?
|
||||
if ((type == UFormDfn::EntryType) && array)
|
||||
|
@ -314,7 +314,7 @@ void CGeorgesImpl::PutText (const std::string& _sText)
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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 ?
|
||||
if (array&&(type == UFormDfn::EntryType))
|
||||
|
@ -374,7 +374,7 @@ void CGeorgesImpl::LineUp ()
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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 ?
|
||||
if ( (type == UFormDfn::EntryType) && !array )
|
||||
|
@ -417,7 +417,7 @@ void CGeorgesImpl::LineDown ()
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
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 ?
|
||||
if ( (type == UFormDfn::EntryType) && !array )
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue