当前位置: 首页>>代码示例>>C++>>正文


C++ Asset::GetAllFlagsSet方法代码示例

本文整理汇总了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;
}
开发者ID:KETMGaming,项目名称:Helium,代码行数:34,代码来源:ProjectViewModel.cpp

示例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 );
}
开发者ID:kevindqc,项目名称:Helium,代码行数:88,代码来源:AssetLoader.cpp


注:本文中的Asset::GetAllFlagsSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。