Skip to content

Commit e6dc3f8

Browse files
authored
Update IEntityResourceManifestBuilder interface (alliedmodders#173)
1 parent 492b8f9 commit e6dc3f8

File tree

1 file changed

+49
-6
lines changed

1 file changed

+49
-6
lines changed

public/entity2/entitysystem.h

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "tier0/platform.h"
55
#include "tier1/utlmemory.h"
6+
#include "tier1/utlsymbollarge.h"
67
#include "tier1/utlvector.h"
78
#include "tier1/utldict.h"
89
#include "eiface.h"
@@ -11,11 +12,14 @@
1112
#include "concreteentitylist.h"
1213
#include "entitydatainstantiator.h"
1314

15+
class CUtlScratchMemoryPool;
16+
1417
class CEntityKeyValues;
1518
class IEntityResourceManifest;
1619
class IEntityPrecacheConfiguration;
1720
class IEntityResourceManifestBuilder;
1821
class ISpawnGroupEntityFilter;
22+
class IHandleEntity;
1923

2024
typedef void (*EntityResourceManifestCreationCallback_t)(IEntityResourceManifest *, void *);
2125

@@ -51,6 +55,8 @@ enum EntityDormancyType_t
5155
ENTITY_SUSPENDED = 0x2,
5256
};
5357

58+
// Entity notifications //
59+
5460
struct EntityNotification_t
5561
{
5662
CEntityIdentity* m_pEntity;
@@ -88,6 +94,41 @@ struct CEntityPrecacheContext
8894
IEntityResourceManifest* m_pManifest;
8995
};
9096

97+
// Resource data //
98+
99+
struct ResourceNameInfo_t
100+
{
101+
CUtlSymbolLarge m_ResourceNameSymbol;
102+
};
103+
104+
typedef const ResourceNameInfo_t *ResourceNameHandle_t;
105+
106+
typedef uint16 LoadingResourceIndex_t;
107+
108+
typedef char ResourceTypeIndex_t;
109+
110+
typedef uint32 ExtRefIndex_t;
111+
112+
struct ResourceBindingBase_t
113+
{
114+
void* m_pData;
115+
ResourceNameHandle_t m_Name;
116+
uint16 m_nFlags;
117+
uint16 m_nReloadCounter;
118+
ResourceTypeIndex_t m_nTypeIndex;
119+
uint8 m_nPadding;
120+
LoadingResourceIndex_t m_nLoadingResource;
121+
CInterlockedInt m_nRefCount;
122+
ExtRefIndex_t m_nExtRefHandle;
123+
};
124+
125+
typedef const ResourceBindingBase_t* ResourceHandle_t;
126+
127+
struct SecondaryPrecacheMemberCallback_t
128+
{
129+
void (CEntityInstance::*pfnPrecache)(ResourceHandle_t hResource, const CEntityPrecacheContext* pContext);
130+
};
131+
91132
class IEntityListener
92133
{
93134
public:
@@ -108,16 +149,18 @@ struct CEntityResourceManifestLock
108149
bool m_bPrecacheEnable;
109150
};
110151

152+
// Manifest executor //
153+
111154
abstract_class IEntityResourceManifestBuilder
112155
{
113156
public:
114-
virtual void BuildResourceManifest(EntityResourceManifestCreationCallback_t callback, void* pContext, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest) = 0;
157+
virtual void BuildResourceManifest(SpawnGroupHandle_t hSpawnGroup, int nCount, const EntitySpawnInfo_t *pEntities, const matrix3x4a_t *vWorldOffset, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest) = 0;
158+
virtual void BuildResourceManifest(SpawnGroupHandle_t hSpawnGroup, int iCount, const CEntityKeyValues *pKeyValues, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest) = 0;
159+
virtual void BuildResourceManifest(SpawnGroupHandle_t hSpawnGroup, const CUtlVector<const CEntityKeyValues*>* pEntityKeyValues, const char* pFilterName, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest) = 0;
115160
virtual void BuildResourceManifest(const char* pManifestNameOrGroupName, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest) = 0;
116-
virtual void BuildResourceManifest(SpawnGroupHandle_t hSpawnGroup, const CUtlVector<const CEntityKeyValues*, CUtlMemory<const CEntityKeyValues*, int> >* pEntityKeyValues, const char* pFilterName, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest) = 0;
117-
virtual void BuildResourceManifest(SpawnGroupHandle_t hSpawnGroup, int nEntityKeyValueCount, const CEntityKeyValues** ppEntityKeyValues, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest) = 0;
118-
virtual void UnknownFunc004() = 0; // Another BuildResourceManifest function in 2018, but it is quite different now
119-
virtual void BuildResourceManifestForEntity(uint64 unknown1, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest, uint64 unknown2) = 0;
120-
virtual void InvokePrecacheCallback(void* hResource /* ResourceHandle_t */, const EntitySpawnInfo_t* const info, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest, char* unk, void* callback /* SecondaryPrecacheMemberCallback_t */) = 0;
161+
virtual void BuildResourceManifest(EntityResourceManifestCreationCallback_t callback, void* pContext, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest) = 0;
162+
virtual void BuildResourceManifestForEntity(const char* pEntityDesignerName, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest, CUtlScratchMemoryPool* pKeyValuesMemoryPool) = 0;
163+
virtual void InvokePrecacheCallback(ResourceHandle_t hResource, const EntitySpawnInfo_t* info, IEntityPrecacheConfiguration* pConfig, IEntityResourceManifest* pResourceManifest, SecondaryPrecacheMemberCallback_t callback) = 0;
121164
virtual void AddRefKeyValues(const CEntityKeyValues* pKeyValues) = 0;
122165
virtual void ReleaseKeyValues(const CEntityKeyValues* pKeyValues) = 0;
123166
virtual void LockResourceManifest(bool bLock, CEntityResourceManifestLock* const context) = 0;

0 commit comments

Comments
 (0)