Beispiel #1
0
bool ccMaterialSet::append(const ccMaterialSet& source)
{
	try
	{
		for (ccMaterialSet::const_iterator it=source.begin(); it!=source.end(); ++it)
		{
			ccMaterial::CShared mtl = *it;
			if (addMaterial(mtl) <= 0)
				ccLog::WarningDebug(QString("[ccMaterialSet::append] Material %1 couldn't be added to material set and will be ignored").arg(mtl->getName()));
		}
	}
	catch(.../*const std::bad_alloc&*/) //out of memory
	{
		ccLog::Warning("[ccMaterialSet::append] Not enough memory");
		return false;
	}

	return true;
}
Beispiel #2
0
bool ccMaterialSet::append(const ccMaterialSet& source)
{
	try
	{
		reserve(size()+source.size());
	}
	catch(.../*const std::bad_alloc&*/) //out of memory
	{
		ccLog::Warning("[ccMaterialSet::append] Not enough memory");
		return false;
	}
	
	for (ccMaterialSet::const_iterator it = source.begin(); it!=source.end(); ++it)
	{
		push_back(*it);
		back().texture.detach();
	}

	return true;
}
Beispiel #3
0
bool ccMaterialSet::append(const ccMaterialSet& source)
{
	try
	{
		reserve(size()+source.size());
	}
	catch(.../*const std::bad_alloc&*/) //out of memory
	{
		ccLog::Warning("[ccMaterialSet::append] Not enough memory");
		return false;
	}
	
	for (ccMaterialSet::const_iterator it = source.begin(); it!=source.end(); ++it)
	{
		push_back(*it);
		//back().getTexture().detach(); //FIXME: was in the old version (non shared images)... still meaningful? or even necessary?
	}

	return true;
}