本文整理汇总了C++中Asset::GetAllFlagsSet方法的典型用法代码示例。如果您正苦于以下问题:C++ Asset::GetAllFlagsSet方法的具体用法?C++ Asset::GetAllFlagsSet怎么用?C++ Asset::GetAllFlagsSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset
的用法示例。
在下文中一共展示了Asset::GetAllFlagsSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAttr
bool ProjectViewModel::GetAttr( const wxDataViewItem& item, unsigned int column, wxDataViewItemAttr& attr ) const
{
if ( !item.IsOk() )
{
return false;
}
Asset *node = static_cast< Asset* >( item.GetID() );
HELIUM_ASSERT( node );
// bold the entry if the node is active
attr.SetBold( node->IsPackage() );
if ( node->GetAllFlagsSet( Asset::FLAG_EDITOR_FORCIBLY_LOADED ) )
{
attr.SetColour( *wxBLACK );
}
else
{
attr.SetColour( *wxLIGHT_GREY );
}
// italicize the entry if it is modified
attr.SetItalic( node->GetAllFlagsSet( Asset::FLAG_CHANGED_SINCE_LOADED ) );
if ( node->GetAllFlagsSet( Asset::FLAG_CHANGED_SINCE_LOADED ) )
{
attr.SetColour( *wxRED );
}
return true;
}
示例2: BeginLoadObject
/// Begin asynchronous loading of an object.
///
/// @param[in] path Asset path.
///
/// @return ID for the load request if started successfully, invalid index if not.
///
/// @see TryFinishLoad(), FinishLoad()
size_t AssetLoader::BeginLoadObject( AssetPath path )
{
HELIUM_TRACE( TraceLevels::Info, TXT(" AssetLoader::BeginLoadObject - Loading path %s\n"), *path.ToString() );
// Search for an existing load request with the given path.
ConcurrentHashMap< AssetPath, LoadRequest* >::ConstAccessor requestConstAccessor;
if( m_loadRequestMap.Find( requestConstAccessor, path ) )
{
LoadRequest* pRequest = requestConstAccessor->Second();
HELIUM_ASSERT( pRequest );
AtomicIncrementRelease( pRequest->requestCount );
// We can release now, as the request shouldn't get released now that we've incremented its reference count.
requestConstAccessor.Release();
return m_loadRequestPool.GetIndex( pRequest );
}
Asset *pAsset = Asset::Find<Asset>( path );
if ( pAsset && !pAsset->GetAllFlagsSet( Asset::FLAG_LOADED ) )
{
pAsset = NULL;
}
PackageLoader *pPackageLoader = 0;
if ( pAsset )
{
HELIUM_TRACE(
TraceLevels::Info,
TXT( "AssetLoader::BeginLoadObject(): Object \"%s\" already loaded.\n" ),
*path.ToString() );
}
else
{
// Get the package loader to use for the given object.
pPackageLoader = GetPackageLoader( path );
if( !pPackageLoader )
{
HELIUM_TRACE(
TraceLevels::Error,
TXT( "AssetLoader::BeginLoadObject(): Failed to locate package loader for \"%s\".\n" ),
*path.ToString() );
return Invalid< size_t >();
}
}
// Add the load request.
LoadRequest* pRequest = m_loadRequestPool.Allocate();
pRequest->path = path;
pRequest->pPackageLoader = pPackageLoader;
SetInvalid( pRequest->packageLoadRequestId );
pRequest->stateFlags = pAsset ?
(pAsset->GetFlags() & Asset::FLAG_BROKEN ? LOAD_FLAG_FULLY_LOADED | LOAD_FLAG_ERROR : LOAD_FLAG_FULLY_LOADED ) :
0;
pRequest->requestCount = 1;
HELIUM_ASSERT( !pRequest->spObject );
pRequest->spObject = pAsset;
ConcurrentHashMap< AssetPath, LoadRequest* >::Accessor requestAccessor;
if( m_loadRequestMap.Insert( requestAccessor, KeyValue< AssetPath, LoadRequest* >( path, pRequest ) ) )
{
// New load request was created, so tick it once to get the load process running.
requestAccessor.Release();
TickLoadRequest( pRequest );
}
else
{
// A matching request was added while we were building our request, so reuse it.
m_loadRequestPool.Release( pRequest );
pRequest = requestAccessor->Second();
HELIUM_ASSERT( pRequest );
AtomicIncrementRelease( pRequest->requestCount );
// We can release now, as the request shouldn't get released now that we've incremented its reference count.
requestAccessor.Release();
}
return m_loadRequestPool.GetIndex( pRequest );
}