本文整理汇总了C++中item_map_t::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ item_map_t::empty方法的具体用法?C++ item_map_t::empty怎么用?C++ item_map_t::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类item_map_t
的用法示例。
在下文中一共展示了item_map_t::empty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertEmbeddedItem
// Inserts a new unique entry
BOOL LLEmbeddedItems::insertEmbeddedItem( LLInventoryItem* item, llwchar* ext_char, bool is_new)
{
// Now insert a new one
llwchar wc_emb;
if (!sFreeEntries.empty())
{
wc_emb = sFreeEntries.top();
sFreeEntries.pop();
}
else if (sEntries.empty())
{
wc_emb = LLTextEditor::FIRST_EMBEDDED_CHAR;
}
else
{
item_map_t::iterator last = sEntries.end();
--last;
wc_emb = last->first;
if (wc_emb >= LLTextEditor::LAST_EMBEDDED_CHAR)
{
return FALSE;
}
++wc_emb;
}
sEntries[wc_emb].mItem = item;
sEntries[wc_emb].mSaved = is_new ? FALSE : TRUE;
*ext_char = wc_emb;
mEmbeddedUsedChars.insert(wc_emb);
return TRUE;
}
示例2: bindEmbeddedChars
void LLEmbeddedItems::bindEmbeddedChars( const LLFontGL* font ) const
{
if( sEntries.empty() )
{
return;
}
for (std::set<llwchar>::const_iterator iter1 = mEmbeddedUsedChars.begin(); iter1 != mEmbeddedUsedChars.end(); ++iter1)
{
llwchar wch = *iter1;
item_map_t::iterator iter2 = sEntries.find(wch);
if (iter2 == sEntries.end())
{
continue;
}
LLInventoryItem* item = iter2->second.mItem;
if (!item)
{
continue;
}
LLUIImagePtr image = get_item_icon(item->getType(),
item->getInventoryType(),
0,
item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS);//LLUI::getUIImage(img_name);
font->addEmbeddedChar( wch, image->getImage(), item->getName() );
}
}
示例3: unbindEmbeddedChars
void LLEmbeddedItems::unbindEmbeddedChars( const LLFontGL* font ) const
{
if( sEntries.empty() )
{
return;
}
for (std::set<llwchar>::const_iterator iter1 = mEmbeddedUsedChars.begin(); iter1 != mEmbeddedUsedChars.end(); ++iter1)
{
font->removeEmbeddedChar(*iter1);
}
}
示例4: bindEmbeddedChars
void LLEmbeddedItems::bindEmbeddedChars( const LLFontGL* font ) const
{
if( sEntries.empty() )
{
return;
}
for (std::set<llwchar>::const_iterator iter1 = mEmbeddedUsedChars.begin(); iter1 != mEmbeddedUsedChars.end(); ++iter1)
{
llwchar wch = *iter1;
item_map_t::iterator iter2 = sEntries.find(wch);
if (iter2 == sEntries.end())
{
continue;
}
LLInventoryItem* item = iter2->second.mItem;
if (!item)
{
continue;
}
const char* img_name;
switch( item->getType() )
{
case LLAssetType::AT_TEXTURE:
if(item->getInventoryType() == LLInventoryType::IT_SNAPSHOT)
{
img_name = "inv_item_snapshot.tga";
}
else
{
img_name = "inv_item_texture.tga";
}
break;
case LLAssetType::AT_SOUND: img_name = "inv_item_sound.tga"; break;
case LLAssetType::AT_CALLINGCARD: img_name = "inv_item_callingcard_online.tga"; break;
case LLAssetType::AT_LANDMARK:
if (item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED)
{
img_name = "inv_item_landmark_visited.tga";
}
else
{
img_name = "inv_item_landmark.tga";
}
break;
case LLAssetType::AT_CLOTHING: img_name = "inv_item_clothing.tga"; break;
case LLAssetType::AT_OBJECT:
if (item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
{
img_name = "inv_item_object_multi.tga";
}
else
{
img_name = "inv_item_object.tga";
}
break;
case LLAssetType::AT_NOTECARD: img_name = "inv_item_notecard.tga"; break;
case LLAssetType::AT_LSL_TEXT: img_name = "inv_item_script.tga"; break;
case LLAssetType::AT_BODYPART: img_name = "inv_item_skin.tga"; break;
case LLAssetType::AT_ANIMATION: img_name = "inv_item_animation.tga";break;
case LLAssetType::AT_GESTURE: img_name = "inv_item_gesture.tga"; break;
default: llassert(0); continue;
}
LLUIImagePtr image = LLUI::getUIImage(img_name);
font->addEmbeddedChar( wch, image->getImage(), item->getName() );
}
}