ezEngine  Milestone 7
Declarations.h
1 #pragma once
2 
3 #include <Core/Basics.h>
4 #include <Foundation/Strings/String.h>
5 #include <Foundation/Strings/HashedString.h>
7 
9 
10 // resource base classes
11 class ezResourceBase;
12 
13 template<typename SELF, typename SELF_DESCRIPTOR>
14 class ezResource;
15 
16 // resource handle type
17 template<typename ResourceType>
19 
21 struct EZ_CORE_DLL ezResourceFlags
22 {
23  typedef ezUInt16 StorageType;
24 
26  enum Enum
27  {
28  UpdateOnMainThread = EZ_BIT(0),
29  NoFileAccessRequired = EZ_BIT(1),
30 
31  ResourceHasFallback = EZ_BIT(2),
32  IsReloadable = EZ_BIT(3),
33  IsPreloading = EZ_BIT(4),
34  Default = 0,
35  };
36 
37  struct Bits
38  {
39  StorageType UpdateOnMainThread : 1;
40  StorageType NoFileAccessRequired : 1;
41  StorageType ResourceHasFallback : 1;
42  StorageType IsReloadable : 1;
43  StorageType IsPreloading : 1;
44  };
45 };
46 
48 
50 enum class ezResourceState
51 {
52  Invalid,
53  Unloaded,
54  LoadedResourceMissing,
55  UnloadedMetaInfoAvailable,
56  Loaded,
57  // no other state can follow, Loaded must be the highest value
58 };
59 
62 {
64  {
65  m_State = ezResourceState::Invalid;
66  m_uiQualityLevelsDiscardable = 0xFF; // invalid
67  m_uiQualityLevelsLoadable = 0xFF; // invalid
68  }
69 
70  ezResourceState m_State;
71  ezUInt8 m_uiQualityLevelsDiscardable;
72  ezUInt8 m_uiQualityLevelsLoadable;
73 };
74 
76 enum class ezResourcePriority
77 {
78  Highest,
79  High,
80  Normal,
81  Low,
82  Lowest,
83  Unchanged
84 };
85 
87 enum class ezResourceAcquireMode
88 {
89  PointerOnly,
90  AllowFallback,
91  MetaInfo,
92  NoFallback,
93 };
94