コード例 #1
0
    //-----------------------------------------------------------------------
    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);
    }
コード例 #2
0
ファイル: array.cpp プロジェクト: AMG194/godot
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);
	}
}
コード例 #3
0
    void Octree::_removeNode( PCZSceneNode * n )
    {
        mNodes.erase(n);
		((OctreeZoneData*)n ->getZoneData(mZone))->setOctant( 0 );

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

    //update total counts.
    _unref();
}
コード例 #5
0
ファイル: dictionary.cpp プロジェクト: Blake-Hudson/godot
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;
}
コード例 #6
0
ファイル: dictionary.cpp プロジェクト: brakhane/godot
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;
}
コード例 #7
0
ファイル: array.cpp プロジェクト: Paulloz/godot
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;
}
コード例 #8
0
ファイル: array.cpp プロジェクト: AMG194/godot
Array::~Array() {

	_unref();
}
コード例 #9
0
ファイル: name2id.c プロジェクト: ajinkya93/OpenBSD
void
label_unref(u_int16_t id)
{
	_unref(&relay_labels, id);
}
コード例 #10
0
ファイル: name2id.c プロジェクト: ajinkya93/OpenBSD
void
tag_unref(u_int16_t id)
{
	_unref(&relay_tags, id);
}
コード例 #11
0
ファイル: name2id.c プロジェクト: Cougar/openbgpd-linux-port
void
pftable_unref(u_int16_t id)
{
	_unref(&pftable_labels, id);
}
コード例 #12
0
ファイル: name2id.c プロジェクト: Cougar/openbgpd-linux-port
void
rtlabel_unref(u_int16_t id)
{
	_unref(&rt_labels, id);
}
コード例 #13
0
ファイル: dictionary.cpp プロジェクト: Blake-Hudson/godot
Dictionary::~Dictionary() {

	_unref();
}