本文整理汇总了C++中cegui::DefaultResourceProvider::clearResourceGroupDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ DefaultResourceProvider::clearResourceGroupDirectory方法的具体用法?C++ DefaultResourceProvider::clearResourceGroupDirectory怎么用?C++ DefaultResourceProvider::clearResourceGroupDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::DefaultResourceProvider
的用法示例。
在下文中一共展示了DefaultResourceProvider::clearResourceGroupDirectory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnOkClick
//--------------------------------------------------------------------------------
void DialogResourceGroups::OnOkClick( wxCommandEvent& event )
{
// dump the grid values into a map
ResourceGroupsMap newGroups;
int sz = m_groupsGrid->GetNumberRows();
for ( int i = 0; i < sz; ++i )
newGroups[ m_groupsGrid->GetCellValue( i, 0 ) ] =
m_groupsGrid->GetCellValue( i, 1 );
// build a list of deleted groups
wxArrayString deletedGroups;
ResourceGroupsMap::iterator iter = m_resourceGroups.begin();
while ( iter != m_resourceGroups.end() )
{
if ( newGroups.count( iter->first ) == 0 )
deletedGroups.Add( iter->first );
++iter;
}
// set our map to equal the new set of defined groups
m_resourceGroups = newGroups;
// get the resource provier from CEGUI::System
CEGUI::DefaultResourceProvider* rp =
static_cast<CEGUI::DefaultResourceProvider*>(
CEGUI::System::getSingleton().getResourceProvider() );
// erase groups that were deleted
for ( size_t j = 0; j < deletedGroups.size(); ++j )
rp->clearResourceGroupDirectory( CEGUIHelper::ToCEGUIString( deletedGroups[ j ] ) );
// update all groups according to our map
iter = m_resourceGroups.begin();
while ( iter != m_resourceGroups.end() )
{
rp->setResourceGroupDirectory(
CEGUIHelper::ToCEGUIString( iter->first ),
CEGUIHelper::ToCEGUIString( iter->second ) );
++iter;
}
// Set the default resource group
rp->setDefaultResourceGroup(
CEGUIHelper::ToCEGUIString( m_defaultGroupName ) );
// wipe out backup info incase some strangeness happens
m_backupResourceGroups.clear();
m_backupDefaultGroupName.clear();
event.Skip();
}