本文整理汇总了C++中LLViewerImage::getDesiredDiscardLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerImage::getDesiredDiscardLevel方法的具体用法?C++ LLViewerImage::getDesiredDiscardLevel怎么用?C++ LLViewerImage::getDesiredDiscardLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerImage
的用法示例。
在下文中一共展示了LLViewerImage::getDesiredDiscardLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shutdown
void LLViewerImageList::shutdown()
{
// clear out preloads
mImagePreloads.clear();
// Write out list of currently loaded textures for precaching on startup
typedef std::set<std::pair<S32,LLViewerImage*> > image_area_list_t;
image_area_list_t image_area_list;
for (image_priority_list_t::iterator iter = mImageList.begin();
iter != mImageList.end(); ++iter)
{
LLViewerImage* image = *iter;
if (!image->getUseDiscard() ||
image->needsAux() ||
image->getTargetHost() != LLHost::invalid)
{
continue; // avoid UI, baked, and other special images
}
S32 desired = image->getDesiredDiscardLevel();
if (desired >= 0 && desired < MAX_DISCARD_LEVEL)
{
S32 pixel_area = image->getWidth(desired) * image->getHeight(desired);
image_area_list.insert(std::make_pair(pixel_area, image));
}
}
LLSD imagelist;
const S32 max_count = 1000;
S32 count = 0;
for (image_area_list_t::reverse_iterator riter = image_area_list.rbegin();
riter != image_area_list.rend(); ++riter)
{
LLViewerImage* image = riter->second;
imagelist[count]["area"] = riter->first;
imagelist[count]["uuid"] = image->getID();
if (++count >= max_count)
break;
}
if (count > 0 && !gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "").empty())
{
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name());
llofstream file;
file.open(filename);
LLSDSerialize::toPrettyXML(imagelist, file);
}
//
// Clean up "loaded" callbacks.
//
mCallbackList.clear();
// Flush all of the references
mLoadingStreamList.clear();
mCreateTextureList.clear();
mUUIDMap.clear();
mImageList.clear();
}
示例2: dump
void LLViewerImageList::dump()
{
llinfos << "LLViewerImageList::dump()" << llendl;
for (image_priority_list_t::iterator it = mImageList.begin(); it != mImageList.end(); ++it)
{
LLViewerImage* image = *it;
llinfos << "priority " << image->getDecodePriority()
<< " boost " << image->getBoostLevel()
<< " size " << image->getWidth() << "x" << image->getHeight()
<< " discard " << image->getDiscardLevel()
<< " desired " << image->getDesiredDiscardLevel()
<< " http://asset.siva.lindenlab.com/" << image->getID() << ".texture"
<< llendl;
}
}