12#include <unordered_map>
18#define ASSET_MAGIC_NUMBER 0x4f435421
23#define ASSET_VERSION_BASE 1
24#define ASSET_VERSION_SCENE_EXTRA_DATA 2
25#define ASSET_VERSION_PARTICLE_RADIAL_SPAWN 3
26#define ASSET_VERSION_PROPERTY_EXTRA 4
27#define ASSET_VERSION_SCENE_SUB_SCENE_OVERRIDE 5
28#define ASSET_VERSION_FONT_TTF_FLAG 6
29#define ASSET_VERSION_TEXTURE_COOKED_PROPERTIES 7
30#define ASSET_VERSION_TEXTURE_LOW_QUALITY 8
31#define ASSET_VERSION_MATERIAL_LITE_TEXTURE_COUNT 9
32#define ASSET_VERSION_STATIC_MESH_3D_HAS_BAKED_LIGHTING 10
33#define ASSET_VERSION_SCENE_SUBSCENE_INSTANCE_COLORS 11
34#define ASSET_VERSION_UUID_SUPPORT 12
35#define ASSET_VERSION_UUID_WITH_NAME_FALLBACK 13
36#define ASSET_VERSION_NODE_PERSISTENT_UUID 14
37#define ASSET_VERSION_MATERIAL_LITE_NODE_GRAPH 15
38#define ASSET_VERSION_NODE_GRAPH_FUNCTIONS 16
39#define ASSET_VERSION_NODE_GRAPH_VARIABLES 17
40#define ASSET_VERSION_SCENE_ICON_OVERRIDE 18
41#define ASSET_VERSION_SCENE_MENU_OVERRIDE 19
42#define ASSET_VERSION_VOXEL3D 20
43#define ASSET_VERSION_VOXEL3D_ATLAS 21
44#define ASSET_VERSION_VOXEL3D_ATLAS_INT32 22
45#define ASSET_VERSION_TERRAIN3D 23
46#define ASSET_VERSION_TERRAIN3D_MATSLOTS 24
47#define ASSET_VERSION_TERRAIN3D_ATLAS 25
48#define ASSET_VERSION_TERRAIN3D_BAKE 26
49#define ASSET_VERSION_TERRAIN3D_BAKEDMAP 27
50#define ASSET_VERSION_TILESET_BASE 28
51#define ASSET_VERSION_TILEMAP_BASE 29
52#define ASSET_VERSION_TILESET_METADATA 30
53#define ASSET_VERSION_TILESET_AUTOTILE 31
54#define ASSET_VERSION_TRANSFORM_KEYFRAME_SIGNAL 32
55#define ASSET_VERSION_INPUT_PROMPT_MAP 33
56#define ASSET_VERSION_INPUT_PROMPT_STYLE 34
57#define ASSET_VERSION_MATERIAL_LITE_UV_SOURCE 35
58#define ASSET_VERSION_SKELETAL_MESH_SECTIONS 36
59#define ASSET_VERSION_BONE_MASK 37
60#define ASSET_VERSION_SOUNDWAVE_STREAMING 38
61#define ASSET_VERSION_CURRENT 38
64#define DECLARE_ASSET(Base, Parent) DECLARE_FACTORY(Base, Asset); DECLARE_OBJECT(Base, Parent);
65#define DEFINE_ASSET(Base) DEFINE_FACTORY(Base, Asset); DEFINE_OBJECT(Base);
130 virtual void Create();
133 virtual void Copy(
Asset* srcAsset);
141 void ResetLoadedFlag();
143 const std::string& GetName()
const;
144 bool IsLoaded()
const;
145 bool IsRefCounted()
const;
146 int32_t GetRefCount()
const;
148 bool IsEmbedded()
const;
149 void SetEmbedded(
bool embed);
151 bool IsEngineAsset()
const;
152 void SetEngineAsset(
bool engineAsset);
154 void SetName(
const std::string& name);
155 void IncrementRefCount();
156 void DecrementRefCount();
160 void SaveFile(
const char* path,
Platform platform);
164 virtual bool Import(
const std::string& path,
ImportOptions* options =
nullptr);
167 virtual glm::vec4 GetTypeColor();
168 virtual const char* GetTypeName();
169 virtual const char* GetTypeImportExt();
178 bool IsTransient()
const;
179 void SetTransient(
bool transient);
181 uint64_t GetUuid()
const;
182 void SetUuid(uint64_t uuid);
186 void WriteHeader(
Stream& stream);
188 static std::string GetNameFromPath(
const std::string& path);
189 static std::string GetDirectoryFromPath(
const std::string& path);
191 static const char* GetNameFromTypeId(
TypeId id);
192 static TypeId GetTypeIdFromName(
const char* name);
196 uint32_t mVersion = 0;
199 bool mEmbedded =
false;
200 bool mLoaded =
false;
201 bool mEnableRefCount =
true;
202 bool mEngineAsset =
false;
203 bool mTransient =
false;
205 std::string mName =
"Asset";
206 int32_t mRefCount = 0;
210 void ClearDirtyFlag();
#define ASSET_MAGIC_NUMBER
Definition Asset.h:18
POLYPHASE_API bool HandleAssetPropChange(Datum *datum, uint32_t index, const void *newValue)
Definition Asset.cpp:34
AssetLoadState
Definition Asset.h:70
#define ASSET_VERSION_CURRENT
Definition Asset.h:61
#define INVALID_TYPE_ID
Definition Constants.h:40
Platform
Definition EngineTypes.h:32
uint32_t TypeId
Definition EngineTypes.h:72
@ PlatformBit_All
Definition EngineTypes.h:61
Export macros for Polyphase Engine symbols.
#define POLYPHASE_API
Definition PolyphaseAPI.h:31
virtual bool ShouldSnapshotForPie() const
Definition Asset.h:176
DECLARE_OBJECT(Asset, Object)
DECLARE_FACTORY(Asset, Asset)
DECLARE_FACTORY_MANAGER(Asset)
void SetOptionValue(const std::string &key, const Datum &value)
Definition Asset.cpp:63
Datum GetOptionValue(const std::string &key)
Definition Asset.cpp:52
bool HasOption(const std::string &key)
Definition Asset.cpp:45
std::unordered_map< std::string, Datum > mOptions
Definition Asset.h:116
virtual void GatherProperties(std::vector< Property > &props)
Definition Object.h:41
TypeId mType
Definition Asset.h:93
uint64_t mUuid
Definition Asset.h:95
bool mEmbed
Definition Asset.h:100
Asset * mAsset
Definition Asset.h:90
const EmbeddedFile * mEmbeddedData
Definition Asset.h:91
uint32_t mPlatformMask
Definition Asset.h:99
std::string mPath
Definition Asset.h:92
bool mEngineAsset
Definition Asset.h:94
Definition AssetManager.h:19
Definition EmbeddedFile.h:6