本文整理汇总了C++中utArray::front方法的典型用法代码示例。如果您正苦于以下问题:C++ utArray::front方法的具体用法?C++ utArray::front怎么用?C++ utArray::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utArray
的用法示例。
在下文中一共展示了utArray::front方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loom_asset_pump
void loom_asset_pump()
{
// Currently we only want to do this on the main thread so piggy back on the
// native delegate sanity check to bail if on secondary thread.
if(platform_getCurrentThreadId() != LS::NativeDelegate::smMainThreadID && LS::NativeDelegate::smMainThreadID != 0xBAADF00D)
return;
loom_mutex_lock(gAssetLock);
// Talk to the asset server.
loom_asset_serviceServer();
// For now just blast all the data from each file into the asset.
while(gAssetLoadQueue.size())
{
loom_asset_t *asset = gAssetLoadQueue.front();
// Figure out the type from the path.
utString path = asset->name;
int type = loom_asset_recognizeAssetTypeFromPath(path);
if(type == 0)
{
lmLog(gAssetLogGroup, "Could not infer type of resource '%s', skipping it...", path.c_str());
asset->state = loom_asset_t::Unloaded;
gAssetLoadQueue.erase((UTsize)0, true);
continue;
}
// Open the file.
void *ptr;
long size;
if(!platform_mapFile(asset->name.c_str(), &ptr, &size))
{
lmAssert(false, "Could not open file '%s'.", asset->name.c_str());
}
// Deserialize it.
LoomAssetCleanupCallback dtor = NULL;
void *assetBits = loom_asset_deserializeAsset(path, type, size, ptr, &dtor);
// Close the file.
platform_unmapFile(ptr);
// Instate the asset.
asset->instate(type, assetBits, dtor);
// Done! Update queue.
gAssetLoadQueue.erase((UTsize)0, true);
}
loom_mutex_unlock(gAssetLock);
}