some work on assetmgr
This commit is contained in:
@@ -1,40 +1,75 @@
|
||||
#ifndef ASSET_MANAGER_H
|
||||
#define ASSET_MANAGER_H
|
||||
|
||||
#include "materialsystem/imaterialsystem.h"
|
||||
#include "worldrender.h"
|
||||
#include "datamap.h"
|
||||
#include "materials.h"
|
||||
#include "iphysics.h"
|
||||
#include "tier1/utlstring.h"
|
||||
|
||||
typedef uint32_t HFunnyMaterial;
|
||||
typedef uint32_t HFunnyMesh;
|
||||
typedef uint32_t HFunnyPhysicalMesh;
|
||||
typedef uint32_t HFunnyPhysicalMaterial;
|
||||
typedef uint32_t HFunnyModel;
|
||||
|
||||
struct FunnyMaterial_t
|
||||
{
|
||||
CUtlString m_szName;
|
||||
IShader *m_pShaders;
|
||||
IMaterial *m_pMaterial;
|
||||
CBaseMaterial *m_pLayout;
|
||||
};
|
||||
|
||||
struct FunnyMesh_t
|
||||
{
|
||||
IMesh *m_pMesh;
|
||||
};
|
||||
|
||||
struct FunnyPhysicalMaterial_t
|
||||
{
|
||||
};
|
||||
|
||||
struct FunnyPhysicalMesh_t
|
||||
{
|
||||
HShape m_hShape;
|
||||
};
|
||||
|
||||
struct FunnyModel_t
|
||||
{
|
||||
CUtlString m_szName;
|
||||
IMesh *m_pMesh;
|
||||
FunnyMaterial_t *m_pFunnyMaterial;
|
||||
CUtlString m_szParentName;
|
||||
HFunnyMesh m_hMesh;
|
||||
HFunnyMaterial m_hMaterial;
|
||||
HFunnyPhysicalMesh m_hPhysicalMesh;
|
||||
HFunnyPhysicalMaterial m_hPhysicalMaterial;
|
||||
};
|
||||
|
||||
|
||||
class IAssetManager
|
||||
{
|
||||
public:
|
||||
virtual uint32_t LoadModel( const char *szName ) = 0;
|
||||
virtual uint32_t LoadMaterial( const char *szName ) = 0;
|
||||
virtual FunnyModel_t *GetModelByIndex( uint32_t uIndex ) = 0;
|
||||
virtual FunnyMaterial_t *GetMaterialByIndex( uint32_t uIndex ) = 0;
|
||||
virtual void UnrefModel( uint32_t uIndex ) = 0;
|
||||
virtual void UnrefMaterial( uint32_t uIndex ) = 0;
|
||||
virtual HFunnyModel LoadModel( const char *szName ) = 0;
|
||||
virtual FunnyModel_t *GetModelByIndex( HFunnyModel hModel ) = 0;
|
||||
virtual void UnrefModel( HFunnyModel uIndex ) = 0;
|
||||
|
||||
virtual HFunnyMesh LoadMesh( const char *szName ) = 0;
|
||||
virtual FunnyMesh_t *GetMeshByIndex( HFunnyMesh hMesh ) = 0;
|
||||
virtual void UnrefMesh( HFunnyMesh hMesh ) = 0;
|
||||
|
||||
virtual HFunnyMaterial LoadMaterial( const char *szName ) = 0;
|
||||
virtual FunnyMaterial_t *GetMaterialByIndex( HFunnyMaterial hMat ) = 0;
|
||||
virtual void UnrefMaterial( HFunnyMaterial hMat ) = 0;
|
||||
|
||||
virtual HFunnyPhysicalMesh LoadPhysicalMesh( const char *szName ) = 0;
|
||||
virtual FunnyPhysicalMesh_t *GetPhysicalMeshByIndex( HFunnyPhysicalMesh hPhysicalMesh ) = 0;
|
||||
virtual void UnrefPhysicalMesh( HFunnyPhysicalMesh hPhysicalMesh ) = 0;
|
||||
|
||||
virtual HFunnyPhysicalMaterial LoadPhysicalMaterial( const char *szName ) = 0;
|
||||
virtual FunnyPhysicalMaterial_t *GetPhysicalMaterialByIndex( HFunnyPhysicalMaterial hPhysicalMaterial ) = 0;
|
||||
virtual void UnrefPhysicalMaterial( HFunnyPhysicalMaterial hPhysicalMaterial ) = 0;
|
||||
};
|
||||
|
||||
extern IAssetManager *g_pAssetManager;
|
||||
|
||||
#define ASSET_MANAGER_INTERFACE_VERSION "AssetMgr001"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user