Polyphase Game Engine
Loading...
Searching...
No Matches
Asset Class Reference

#include <Asset.h>

Inheritance diagram for Asset:
Object DataAsset Font InputActionsAsset Material NodeGraphAsset ParticleSystem Scene SkeletalMesh SoundWave SpriteAnimation StaticMesh Texture TileMap TileSet Timeline TinyLLMAsset TinyLLMTokenizerAsset UIDocument

Public Member Functions

 DECLARE_FACTORY_MANAGER (Asset)
 
 DECLARE_FACTORY (Asset, Asset)
 
 DECLARE_OBJECT (Asset, Object)
 
 Asset ()
 
virtual ~Asset ()
 
virtual void Create ()
 
virtual void Destroy ()
 
virtual void Copy (Asset *srcAsset)
 
const std::string & GetName () const
 
bool IsLoaded () const
 
bool IsRefCounted () const
 
int32_t GetRefCount () const
 
bool IsEmbedded () const
 
void SetEmbedded (bool embed)
 
bool IsEngineAsset () const
 
void SetEngineAsset (bool engineAsset)
 
void SetName (const std::string &name)
 
void IncrementRefCount ()
 
void DecrementRefCount ()
 
void LoadFile (const char *path, AsyncLoadRequest *request=nullptr)
 
void LoadEmbedded (const EmbeddedFile *embeddedAsset, AsyncLoadRequest *request=nullptr)
 
void SaveFile (const char *path, Platform platform)
 
virtual void LoadStream (Stream &stream, Platform platform)
 
virtual void SaveStream (Stream &stream, Platform platform)
 
virtual bool Import (const std::string &path, ImportOptions *options=nullptr)
 
virtual void GatherProperties (std::vector< Property > &outProps) override
 
virtual glm::vec4 GetTypeColor ()
 
virtual const char * GetTypeName ()
 
virtual const char * GetTypeImportExt ()
 
virtual bool ShouldSnapshotForPie () const
 
bool IsTransient () const
 
void SetTransient (bool transient)
 
uint64_t GetUuid () const
 
void SetUuid (uint64_t uuid)
 
void EnsureUuid ()
 
void WriteHeader (Stream &stream)
 
- Public Member Functions inherited from Object
virtual ~Object ()=default
 
virtual const char * RuntimeName () const =0
 
virtual const char * RuntimeParentName () const =0
 
virtual RuntimeId InstanceRuntimeId () const =0
 
virtual ObjectQueryInterface (RuntimeId id) const
 
virtual bool Is (RuntimeId id) const
 
virtual bool Is (const char *name) const
 
virtual bool DrawCustomProperty (Property &prop)
 
template<typename T >
T * As () const
 
virtual bool Equals (const Object *rhs) const
 

Static Public Member Functions

static AssetHeader ReadHeader (Stream &stream)
 
static std::string GetNameFromPath (const std::string &path)
 
static std::string GetDirectoryFromPath (const std::string &path)
 
static const char * GetNameFromTypeId (TypeId id)
 
static TypeId GetTypeIdFromName (const char *name)
 
- Static Public Member Functions inherited from Object
static const char * ClassRuntimeName ()
 

Protected Attributes

uint32_t mVersion = 0
 
TypeId mType = INVALID_TYPE_ID
 
uint64_t mUuid = 0
 
bool mEmbedded = false
 
bool mLoaded = false
 
bool mEnableRefCount = true
 
bool mEngineAsset = false
 
bool mTransient = false
 
std::string mName = "Asset"
 
int32_t mRefCount = 0
 

Constructor & Destructor Documentation

◆ Asset()

Asset::Asset ( )

◆ ~Asset()

Asset::~Asset ( )
virtual

Member Function Documentation

◆ Copy()

void Asset::Copy ( Asset srcAsset)
virtual

◆ Create()

◆ DECLARE_FACTORY()

Asset::DECLARE_FACTORY ( Asset  ,
Asset   
)

◆ DECLARE_FACTORY_MANAGER()

Asset::DECLARE_FACTORY_MANAGER ( Asset  )

◆ DECLARE_OBJECT()

Asset::DECLARE_OBJECT ( Asset  ,
Object   
)

◆ DecrementRefCount()

void Asset::DecrementRefCount ( )

◆ Destroy()

◆ EnsureUuid()

void Asset::EnsureUuid ( )

◆ GatherProperties()

void Asset::GatherProperties ( std::vector< Property > &  outProps)
overridevirtual

◆ GetDirectoryFromPath()

std::string Asset::GetDirectoryFromPath ( const std::string &  path)
static

◆ GetName()

const std::string & Asset::GetName ( ) const

◆ GetNameFromPath()

std::string Asset::GetNameFromPath ( const std::string &  path)
static

◆ GetNameFromTypeId()

const char * Asset::GetNameFromTypeId ( TypeId  id)
static

◆ GetRefCount()

int32_t Asset::GetRefCount ( ) const

◆ GetTypeColor()

◆ GetTypeIdFromName()

TypeId Asset::GetTypeIdFromName ( const char *  name)
static

◆ GetTypeImportExt()

const char * Asset::GetTypeImportExt ( )
virtual

◆ GetTypeName()

◆ GetUuid()

uint64_t Asset::GetUuid ( ) const

◆ Import()

bool Asset::Import ( const std::string &  path,
ImportOptions options = nullptr 
)
virtual

◆ IncrementRefCount()

void Asset::IncrementRefCount ( )

◆ IsEmbedded()

bool Asset::IsEmbedded ( ) const

◆ IsEngineAsset()

bool Asset::IsEngineAsset ( ) const

◆ IsLoaded()

bool Asset::IsLoaded ( ) const

◆ IsRefCounted()

bool Asset::IsRefCounted ( ) const

◆ IsTransient()

bool Asset::IsTransient ( ) const

◆ LoadEmbedded()

void Asset::LoadEmbedded ( const EmbeddedFile embeddedAsset,
AsyncLoadRequest request = nullptr 
)

◆ LoadFile()

void Asset::LoadFile ( const char *  path,
AsyncLoadRequest request = nullptr 
)

◆ LoadStream()

◆ ReadHeader()

AssetHeader Asset::ReadHeader ( Stream stream)
static

◆ SaveFile()

void Asset::SaveFile ( const char *  path,
Platform  platform 
)

◆ SaveStream()

◆ SetEmbedded()

void Asset::SetEmbedded ( bool  embed)

◆ SetEngineAsset()

void Asset::SetEngineAsset ( bool  engineAsset)

◆ SetName()

void Asset::SetName ( const std::string &  name)

◆ SetTransient()

void Asset::SetTransient ( bool  transient)

◆ SetUuid()

void Asset::SetUuid ( uint64_t  uuid)

◆ ShouldSnapshotForPie()

virtual bool Asset::ShouldSnapshotForPie ( ) const
inlinevirtual

◆ WriteHeader()

void Asset::WriteHeader ( Stream stream)

Member Data Documentation

◆ mEmbedded

bool Asset::mEmbedded = false
protected

◆ mEnableRefCount

bool Asset::mEnableRefCount = true
protected

◆ mEngineAsset

bool Asset::mEngineAsset = false
protected

◆ mLoaded

bool Asset::mLoaded = false
protected

◆ mName

std::string Asset::mName = "Asset"
protected

◆ mRefCount

int32_t Asset::mRefCount = 0
protected

◆ mTransient

bool Asset::mTransient = false
protected

◆ mType

TypeId Asset::mType = INVALID_TYPE_ID
protected

◆ mUuid

uint64_t Asset::mUuid = 0
protected

◆ mVersion

uint32_t Asset::mVersion = 0
protected

The documentation for this class was generated from the following files: