本文整理汇总了C++中LLSimInfo::getMapImageID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLSimInfo::getMapImageID方法的具体用法?C++ LLSimInfo::getMapImageID怎么用?C++ LLSimInfo::getMapImageID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLSimInfo
的用法示例。
在下文中一共展示了LLSimInfo::getMapImageID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertGridToHandle
LLPointer<LLViewerImage> LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load)
{
// Check the input data
llassert(level <= MAP_LEVELS);
llassert(level >= 1);
// If the *loading* level changed, cleared the new level from "missed" tiles
// so that we get a chance to reload them
if (load && (level != mCurrentLevel))
{
cleanMissedTilesFromLevel(level);
mCurrentLevel = level;
}
// Build the region handle
U64 handle = convertGridToHandle(grid_x, grid_y);
// Check if the image is around already
sublevel_tiles_t& level_mipmap = mWorldObjectsMipMap[level-1];
sublevel_tiles_t::iterator found = level_mipmap.find(handle);
// If not there and load on, go load it
if (found == level_mipmap.end())
{
if (load)
{
// Load it
LLPointer<LLViewerImage> img;
// <edit>
//this is a hack for opensims.
if(LLViewerLogin::getInstance()->getGridChoice() < GRID_INFO_OTHER)
img = loadObjectsTile(grid_x, grid_y, level);
else
{
LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle);
if(info)
{
img = gImageList.getImage(info->getMapImageID(), MIPMAP_TRUE, FALSE);
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP);
}
else
return NULL;
}
// </edit>
// Insert the image in the map
level_mipmap.insert(sublevel_tiles_t::value_type( handle, img ));
// Find the element again in the map (it's there now...)
found = level_mipmap.find(handle);
}
else
{
// Return with NULL if not found and we're not trying to load
return NULL;
}
}
// Get the image pointer and check if this asset is missing
LLPointer<LLViewerImage> img = found->second;
if (img->isMissingAsset())
{
// Return NULL if asset missing
return NULL;
}
else
{
// Boost the tile level so to mark it's in use *if* load on
if (load)
{
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP_VISIBLE);
}
return img;
}
}