本文整理汇总了C++中Asset::load方法的典型用法代码示例。如果您正苦于以下问题:C++ Asset::load方法的具体用法?C++ Asset::load怎么用?C++ Asset::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset
的用法示例。
在下文中一共展示了Asset::load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void ParticleRendererComponent::initialize()
{
if( !d->item )
{
d->item = GluonGraphics::Engine::instance()->createItem( "default" );
}
if( d->material )
{
Asset* materialAsset = qobject_cast<Asset*>( d->material->parent() );
if( materialAsset )
materialAsset->load();
Asset* texture = 0;
if( d->material->property( "texture0" ).type() == QVariant::String )
{
QString theName( d->material->property( "texture0" ).toString() );
QString theObjectName = GluonObject::nameToObjectName( theName );
texture = gameProject()->findChild<Asset*>( theObjectName );
if( !texture )
debug( QString( "Texture failed to load - attempted to load texture named %1 (searched for %2)" ).arg( theName ).arg( theObjectName ) );
}
else
texture = qobject_cast<Asset*>( GluonCore::GluonObjectFactory::instance()->wrappedObject( d->material->property( "texture0" ) ) );
if( texture )
texture->load();
d->item->setMaterialInstance( d->material );
}
}
示例2:
void BeamRendererComponent::Private::loadMaterial( GluonGraphics::MaterialInstance* material )
{
Asset* materialAsset = qobject_cast<Asset*>( material->parent() );
if( materialAsset )
materialAsset->load();
Asset* texture = Game::instance()->gameProject()->findChild<Asset*>( material->property( "texture0" ).toString() );
if( texture )
texture->load();
}
示例3: initialize
void CameraControllerComponent::initialize()
{
if( !d->camera )
d->camera = new GluonGraphics::Camera();
if( d->active )
{
GluonGraphics::Engine::instance()->setActiveCamera( d->camera );
}
if( !d->material )
{
d->material = GluonGraphics::Engine::instance()->mainRenderTarget()->materialInstance();
}
else
{
Asset* materialAsset = qobject_cast<Asset*>( d->material->parent() );
if( materialAsset )
materialAsset->load();
if( GluonGraphics::Engine::instance()->mainRenderTarget() )
GluonGraphics::Engine::instance()->mainRenderTarget()->setMaterialInstance( d->material );
else
debug( QString( "Warning: there is no main RenderTarget set!" ) );
}
d->camera->frustrum()->setOrthoAdjusted( d->visibleArea, GluonGraphics::Engine::instance()->currentViewport()->aspectRatio(), d->nearPlane, d->farPlane );
}
示例4: get
Asset* AssetSystem::get(const char* pFileName)
{
Asset* pAsset = addPending(pFileName);
if (pAsset && !pAsset->getLoaded())
{
pAsset->load();
}
return pAsset;
}
示例5: loadPending
void AssetSystem::loadPending()
{
// Can't cache the element count here because loading may cause
// new assets to be added to the table.
for (int x = 0; x < mLoadedAssetTable.getElementCount(); x++)
{
Asset* asset = mLoadedAssetTable.get(x);
if (!asset->getLoaded())
{
asset->load();
}
}
}