当前位置: 首页>>代码示例>>C++>>正文


C++ LLViewerTexture::getDiscardLevel方法代码示例

本文整理汇总了C++中LLViewerTexture::getDiscardLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerTexture::getDiscardLevel方法的具体用法?C++ LLViewerTexture::getDiscardLevel怎么用?C++ LLViewerTexture::getDiscardLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLViewerTexture的用法示例。


在下文中一共展示了LLViewerTexture::getDiscardLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: exportNextTexture

void LLObjectBackup::exportNextTexture()
{
	if (mTexturesList.empty())
	{
		llinfos << "Finished exporting textures." << llendl;
		return;
	}

	LLUUID id;
	std::list<LLUUID>::iterator iter;
	iter = mTexturesList.begin();

	while (1)
	{
		if (iter == mTexturesList.end())
		{
			mNextTextureReady = true;
			return;
		}

		id = (*iter);

		LLViewerTexture* imagep = LLViewerTextureManager::findTexture(id);
		if (imagep != NULL)
		{
			S32 cur_discard = imagep->getDiscardLevel();
			if (cur_discard > 0)
			{
				if (imagep->getBoostLevel() != LLViewerTexture::BOOST_PREVIEW)
				{
					// we want to force discard 0: this one does this.
					imagep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW);
				}
			}
			else
			{
				break;
			}
		}
		else
		{
			llwarns << "We *DON'T* have the texture " << llendl;
			mNonExportedTextures |= TEXTURE_MISSING;
		}
		iter++;
	}

	mTexturesList.remove(id);

	llinfos << "Requesting texture " << id << llendl;
	LLImageJ2C* mFormattedImage = new LLImageJ2C;
	CacheReadResponder* responder = new CacheReadResponder(id, mFormattedImage);
  	LLAppViewer::getTextureCache()->readFromCache(id, LLWorkerThread::PRIORITY_HIGH, 0, 999999, responder);
}
开发者ID:Kiera,项目名称:Crow,代码行数:54,代码来源:llviewerobjectbackup.cpp

示例2: exportNextTexture

void LLObjectBackup::exportNextTexture()
{
	LLUUID id;
	textures_set_t::iterator iter = mTexturesList.begin();
	while (true)
	{
		if (mTexturesList.empty())
		{
			mCheckNextTexture = true;
			LL_INFOS() << "Finished exporting textures." << LL_ENDL;
			return;
		}
		if (iter == mTexturesList.end())
		{
			// Not yet ready, wait and re-check at next idle callback...
			mCheckNextTexture = true;
			return;
		}

		id = *iter++;
		if (id.isNull())
		{
			// NULL texture id: just remove and ignore.
			mTexturesList.erase(id);
			LL_DEBUGS("ObjectBackup") << "Null texture UUID found, ignoring."
									  << LL_ENDL;
			continue;
		}

		LLViewerTexture* imagep = LLViewerTextureManager::findTexture(id);
		if (imagep)
		{
			if (imagep->getDiscardLevel() > 0)
			{
				// Boost texture loading
				imagep->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
				LL_DEBUGS("ObjectBackup") << "Boosting texture: " << id
										  << LL_ENDL;
				LLViewerFetchedTexture* tex;
				tex = LLViewerTextureManager::staticCastToFetchedTexture(imagep);
				if (tex && tex->getDesiredDiscardLevel() > 0)
				{
					// Set min discard level to 0
					tex->setMinDiscardLevel(0);
					LL_DEBUGS("ObjectBackup") << "Min discard level set to 0 for texture: "
											  << id << LL_ENDL;
				}
			}
			else
			{
				// Texture is ready !
				break;
			}
		}
		else
		{
			LL_WARNS() << "We *DON'T* have the texture " << id << LL_ENDL;
			mNonExportedTextures |= TEXTURE_MISSING;
			mTexturesList.erase(id);
		}
	}

	mTexturesList.erase(id);

	LL_INFOS() << "Requesting texture " << id << " from cache." << LL_ENDL;
	LLImageJ2C* mFormattedImage = new LLImageJ2C;
	BackupCacheReadResponder* responder;
	responder = new BackupCacheReadResponder(id, mFormattedImage);
	LLAppViewer::getTextureCache()->readFromCache(id,
												  LLWorkerThread::PRIORITY_HIGH,
												  0, 999999, responder);
}
开发者ID:HanHeld,项目名称:SingularityViewerFeb2016,代码行数:72,代码来源:llviewerobjectbackup.cpp


注:本文中的LLViewerTexture::getDiscardLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。