本文整理汇总了C++中LLViewerImage::addTextureStats方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerImage::addTextureStats方法的具体用法?C++ LLViewerImage::addTextureStats怎么用?C++ LLViewerImage::addTextureStats使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerImage
的用法示例。
在下文中一共展示了LLViewerImage::addTextureStats方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateTextures
void LLVOTextBubble::updateTextures(LLAgent &agent)
{
// Update the image levels of all textures...
// First we do some quick checks.
U32 i;
// This doesn't take into account whether the object is in front
// or behind...
LLVector3 position_local = getPositionAgent() - agent.getCameraPositionAgent();
F32 dot_product = position_local * agent.getFrameAgent().getAtAxis();
F32 cos_angle = dot_product / position_local.magVec();
if (cos_angle > 1.f)
{
cos_angle = 1.f;
}
for (i = 0; i < getNumTEs(); i++)
{
const LLTextureEntry *te = getTE(i);
F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT);
LLViewerImage *imagep = getTEImage(i);
if (imagep)
{
imagep->addTextureStats(mPixelArea, texel_area_ratio, cos_angle);
}
}
}
示例2: doPrefetchImages
void LLViewerImageList::doPrefetchImages()
{
#if 1
if (LLAppViewer::instance()->getPurgeCache())
{
// cache was purged, no point
return;
}
// Pre-fetch textures from last logout
LLSD imagelist;
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name());
llifstream file;
file.open(filename);
if (file.is_open())
{
LLSDSerialize::fromXML(imagelist, file);
}
for (LLSD::array_iterator iter = imagelist.beginArray();
iter != imagelist.endArray(); ++iter)
{
LLSD imagesd = *iter;
LLUUID uuid = imagesd["uuid"];
S32 pixel_area = imagesd["area"];
LLViewerImage* image = getImage(uuid, MIPMAP_TRUE, FALSE);
if (image)
{
image->addTextureStats((F32)pixel_area);
}
}
#endif
}
示例3: updateTextures
void LLVOTextBubble::updateTextures()
{
// Update the image levels of all textures...
for (U32 i = 0; i < getNumTEs(); i++)
{
const LLTextureEntry *te = getTE(i);
F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT);
texel_area_ratio = llclamp(texel_area_ratio, .125f, 16.f);
LLViewerImage *imagep = getTEImage(i);
if (imagep)
{
imagep->addTextureStats(mPixelArea / texel_area_ratio);
}
}
}