本文整理汇总了C++中Linker::Prepare方法的典型用法代码示例。如果您正苦于以下问题:C++ Linker::Prepare方法的具体用法?C++ Linker::Prepare怎么用?C++ Linker::Prepare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Linker
的用法示例。
在下文中一共展示了Linker::Prepare方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TickLink
/// Update object reference linking for the given object load request.
///
/// @param[in] pRequest Load request to update.
///
/// @return True if linking still requires processing, false if it is complete.
bool GameObjectLoader::TickLink( LoadRequest* pRequest )
{
HELIUM_ASSERT( pRequest );
HELIUM_ASSERT( !( pRequest->stateFlags & ( LOAD_FLAG_PRECACHED | LOAD_FLAG_LOADED ) ) );
// Make sure each dependency has finished its preload process.
bool bHavePendingLinkEntries = false;
DynArray< LinkEntry >& rLinkTable = pRequest->linkTable;
size_t linkTableSize = rLinkTable.GetSize();
for( size_t linkIndex = 0; linkIndex < linkTableSize; ++linkIndex )
{
LinkEntry& rLinkEntry = rLinkTable[ linkIndex ];
if( IsValid( rLinkEntry.loadId ) )
{
LoadRequest* pLinkRequest = m_loadRequestPool.GetObject( rLinkEntry.loadId );
HELIUM_ASSERT( pLinkRequest );
if( pLinkRequest->stateFlags & LOAD_FLAG_PRELOADED )
{
rLinkEntry.spObject = pLinkRequest->spObject;
}
else
{
bHavePendingLinkEntries = true;
}
}
}
if( bHavePendingLinkEntries )
{
return false;
}
// Ready to link.
GameObject* pObject = pRequest->spObject;
if( pObject )
{
uint32_t objectFlags = pObject->GetFlags();
if( !( objectFlags & GameObject::FLAG_LINKED ) )
{
if( !( objectFlags & GameObject::FLAG_BROKEN ) )
{
Linker linker;
linker.Prepare( rLinkTable.GetData(), static_cast< uint32_t >( linkTableSize ) );
if( !linker.Serialize( pObject ) )
{
pObject->SetFlags( GameObject::FLAG_BROKEN );
}
}
pObject->SetFlags( GameObject::FLAG_LINKED );
}
}
AtomicOrRelease( pRequest->stateFlags, LOAD_FLAG_LINKED );
return true;
}