本文整理汇总了C++中CUtlDict::IsValidIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ CUtlDict::IsValidIndex方法的具体用法?C++ CUtlDict::IsValidIndex怎么用?C++ CUtlDict::IsValidIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtlDict
的用法示例。
在下文中一共展示了CUtlDict::IsValidIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindMacroTexture
CMacroTextureData* FindMacroTexture( const char *pFilename )
{
int index = g_MacroTextureLookup.Find( pFilename );
if ( g_MacroTextureLookup.IsValidIndex( index ) )
return g_MacroTextureLookup[index];
else
return NULL;
}
示例2:
//-----------------------------------------------------------------------------
// FIXME: Need some better understanding of when textures should be added to
// the texture dictionary here. Is it only for files, for example?
// Texture dictionary...
//-----------------------------------------------------------------------------
ITextureInternal *CTextureManager::LoadTexture( const char *pTextureName, const char *pTextureGroupName )
{
ITextureInternal *pNewTexture = ITextureInternal::CreateFileTexture( pTextureName, pTextureGroupName );
if ( pNewTexture )
{
int iIndex = m_TextureExcludes.Find( pNewTexture->GetName() );
if ( m_TextureExcludes.IsValidIndex( iIndex ) )
{
// mark the new texture as excluded
int nDimensionsLimit = m_TextureExcludes[iIndex];
pNewTexture->MarkAsExcluded( ( nDimensionsLimit == 0 ), nDimensionsLimit );
}
// Stick the texture onto the board
pNewTexture->Download();
// FIXME: If there's been an error loading, we don't also want this error...
}
return pNewTexture;
}
示例3: FindNext
int CTextureManager::FindNext( int iIndex, ITextureInternal **pTexInternal )
{
if ( iIndex == -1 && m_TextureList.Count() )
{
iIndex = m_TextureList.First();
}
else if ( !m_TextureList.Count() || !m_TextureList.IsValidIndex( iIndex ) )
{
*pTexInternal = NULL;
return -1;
}
*pTexInternal = m_TextureList[iIndex];
iIndex = m_TextureList.Next( iIndex );
if ( iIndex == m_TextureList.InvalidIndex() )
{
// end of list
iIndex = -1;
}
return iIndex;
}