//-----------------------------------------------------------------------
    void PagingLandScapeOctree::_removeNode(PagingLandScapeOctreeNode * n)
    {  
        assert (!mNodes.empty());

		NodeList::iterator it;
       
		it = std::find (mNodes.begin (), mNodes.end (), n); 
		if (it != mNodes.end ()) 
			mNodes.erase (it);
			
        if (n->isStaticNode ())
		{
			it = std::find(mStaticNodes.begin (), mStaticNodes.end (), n); 
			if (it != mStaticNodes.end ()) 
				mStaticNodes.erase (it);
        }
        else
        {
			it = std::find(mMovingNodes.begin (), mMovingNodes.end (), n); 
			if (it != mMovingNodes.end ()) 
				mMovingNodes.erase (it);
        }
        n->setOctant(0);
        //update total counts.
        _unref(mNumNodes == 1);
    }
Exemple #2
0
void Array::_ref(const Array& p_from) const {

	ArrayPrivate *_fp = p_from._p;

	ERR_FAIL_COND(!_fp); // should NOT happen.

	if (_fp == _p)
		return; //wathever it is, nothing to do here move along

	bool success = _fp->refcount.ref();

	ERR_FAIL_COND(!success); //should really not happen either

	_unref();

	if (_fp->shared) {

		_p = p_from._p;

	} else {

		_p = memnew( ArrayPrivate );
		_p->shared=false;
		_p->refcount.init();
		_p->array=_fp->array;

		if (_fp->refcount.unref())
			memdelete(_fp);
	}
}
    void Octree::_removeNode( PCZSceneNode * n )
    {
        mNodes.erase(n);
		((OctreeZoneData*)n ->getZoneData(mZone))->setOctant( 0 );

        //update total counts.
        _unref();
    }
void Octree::_removeNode( OctreeNode * n )
{
    mNodes.erase( std::find( mNodes.begin(), mNodes.end(), n ) );
    n -> setOctant( 0 );

    //update total counts.
    _unref();
}
Exemple #5
0
void Dictionary::_copy_on_write() const {

	//make a copy of what we have
	if (_p->shared)
		return;

	DictionaryPrivate *p = memnew(DictionaryPrivate);
	p->shared=_p->shared;
	p->variant_map=_p->variant_map;
	p->refcount.init();
	_unref();
	_p=p;
}
Exemple #6
0
void Dictionary::_ref(const Dictionary &p_from) const {

	//make a copy first (thread safe)
	if (!p_from._p->refcount.ref())
		return; // couldn't copy

	//if this is the same, unreference the other one
	if (p_from._p == _p) {
		_p->refcount.unref();
		return;
	}
	if (_p)
		_unref();
	_p = p_from._p;
}
Exemple #7
0
void Array::_ref(const Array &p_from) const {

	ArrayPrivate *_fp = p_from._p;

	ERR_FAIL_COND(!_fp); // should NOT happen.

	if (_fp == _p)
		return; // whatever it is, nothing to do here move along

	bool success = _fp->refcount.ref();

	ERR_FAIL_COND(!success); // should really not happen either

	_unref();

	_p = p_from._p;
}
Exemple #8
0
Array::~Array() {

	_unref();
}
Exemple #9
0
void
label_unref(u_int16_t id)
{
	_unref(&relay_labels, id);
}
Exemple #10
0
void
tag_unref(u_int16_t id)
{
	_unref(&relay_tags, id);
}
Exemple #11
0
void
pftable_unref(u_int16_t id)
{
	_unref(&pftable_labels, id);
}
Exemple #12
0
void
rtlabel_unref(u_int16_t id)
{
	_unref(&rt_labels, id);
}
Exemple #13
0
Dictionary::~Dictionary() {

	_unref();
}