本文整理汇总了C++中Asset::GetAssetType方法的典型用法代码示例。如果您正苦于以下问题:C++ Asset::GetAssetType方法的具体用法?C++ Asset::GetAssetType怎么用?C++ Asset::GetAssetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset
的用法示例。
在下文中一共展示了Asset::GetAssetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Asset *Helium::Asset::GetSourceAsset()
{
HELIUM_ASSERT( !m_path.IsEmpty() );
Asset *pAssetWithSourceFile = this;
while ( pAssetWithSourceFile && pAssetWithSourceFile->GetAssetType()->GetFlags() & AssetType::FLAG_GENERATED_FROM_OWNER )
{
pAssetWithSourceFile = pAssetWithSourceFile->GetOwner();
}
return pAssetWithSourceFile;
}
示例2: GetValue
//.........这里部分代码省略.........
}
switch( m_ColumnLookupTable.at( column ) )
{
default:
break;
case ProjectModelColumns::Name:
{
uint32_t docStatus = DocumentStatus::Default; // node->GetDocumentStatus();
String assetString( *node->GetName() );
wxString name = *assetString;
if ( HasFlags<uint32_t>( docStatus, DocumentStatus::Changed ) )
{
name = wxString( TXT( '*' ) ) + name;
}
wxBitmap bitmap = wxArtProvider::GetBitmap( GetArtIDFromPath( node->GetPath() ), wxART_OTHER, wxSize(16, 16) );
if ( docStatus > 0 )
{
wxImage image = bitmap.ConvertToImage();
HELIUM_ASSERT( image.Ok() );
int overlayWidth = image.GetWidth() / 2;
int overlayHeight = image.GetHeight() / 2;
wxImage overlayImage;
if ( HasFlags<uint32_t>( docStatus, DocumentStatus::Saving ) )
{
overlayImage = wxArtProvider::GetBitmap( ArtIDs::Status::Busy, wxART_OTHER, wxSize( overlayWidth, overlayHeight ) ).ConvertToImage();
HELIUM_ASSERT( overlayImage.Ok() );
}
else if ( HasFlags<uint32_t>( docStatus, DocumentStatus::Loading ) )
{
overlayImage = wxArtProvider::GetBitmap( ArtIDs::Status::Busy, wxART_OTHER, wxSize( overlayWidth, overlayHeight ) ).ConvertToImage();
HELIUM_ASSERT( overlayImage.Ok() );
}
else if ( HasFlags<uint32_t>( docStatus, DocumentStatus::Changed ) )
{
overlayImage = wxArtProvider::GetBitmap( ArtIDs::Actions::Edit, wxART_OTHER, wxSize( overlayWidth, overlayHeight ) ).ConvertToImage();
HELIUM_ASSERT( overlayImage.Ok() );
}
if ( overlayImage.Ok() )
{
if ( overlayImage.GetWidth() != overlayWidth || overlayImage.GetHeight() != overlayHeight )
{
overlayImage.Rescale( overlayWidth, overlayHeight );
}
int x = 0;
int y = 0;
IconArtFile::CalculatePlacement( image, overlayImage, OverlayQuadrants::BottomRight, x, y );
image.Paste( overlayImage, x, y );
}
bitmap = wxBitmap( image );
}
wxIcon icon;
icon.CopyFromBitmap( bitmap );
variant << wxDataViewIconText( name, icon );
}
break;
//case ProjectModelColumns::Icon:
// {
// int32_t imageID = GlobalFileIconsTable().GetIconIDFromPath( node->GetPath() );
// wxVariant bitmapVariant;
// bitmapVariant.
// variant = GlobalFileIconsTable().GetSmallImageList()->GetBitmap( imageID );
// }
// break;
case ProjectModelColumns::Details:
{
variant = std::string( TXT( "" ) );
}
break;
case ProjectModelColumns::FileSize:
{
variant = std::string( TXT( "" ) );
}
break;
case ProjectModelColumns::Type:
{
const AssetType *pType = node->GetAssetType();
HELIUM_ASSERT( pType );
variant = std::string( *pType->GetName() );
}
break;
}
}
示例3: TickDeserialize
//.........这里部分代码省略.........
HELIUM_ASSERT( pRequest->pAsyncFileLoadBuffer );
pRequest->asyncFileLoadBufferSize = object_file_size;
pRequest->asyncFileLoadId = rAsyncLoader.QueueRequest(
pRequest->pAsyncFileLoadBuffer,
String(object_file_path.c_str()),
0,
pRequest->asyncFileLoadBufferSize);
}
}
size_t bytesRead = 0;
if (load_properties_from_file)
{
HELIUM_ASSERT( IsValid( pRequest->asyncFileLoadId ) );
if ( !rAsyncLoader.TrySyncRequest( pRequest->asyncFileLoadId, bytesRead ) )
{
return false;
}
}
/////// POINT OF NO RETURN: We *will* return true after this point, and the object *will* be finished preloading,
/////// for good or for bad.
SetInvalid(pRequest->asyncFileLoadId);
bool object_creation_failure = false;
// If we already had an existing object, make sure the type and template match.
if( pObject )
{
const AssetType* pExistingType = pObject->GetAssetType();
HELIUM_ASSERT( pExistingType );
if( pExistingType != pType )
{
HELIUM_TRACE(
TraceLevels::Error,
( TXT( "LoosePackageLoader: Cannot load \"%s\" using the existing object as the types do not match " )
TXT( "(existing type: \"%s\"; serialized type: \"%s\".\n" ) ),
*rObjectData.objectPath.ToString(),
*pExistingType->GetName(),
*pType->GetName() );
pObject->SetFlags( Asset::FLAG_PRELOADED | Asset::FLAG_LINKED );
pObject->ConditionalFinalizeLoad();
object_creation_failure = true;
}
}
else
{
bool bCreateResult = false;
if (pRequest->forceReload)
{
// Create the object.
bCreateResult = Asset::CreateObject(
pRequest->spObject,
pType,
Name( NULL_NAME ),
NULL,
pTemplate );
}
else
{