android port

This commit is contained in:
2026-08-28 21:23:08 +03:00
parent aaf298d8cc
commit eef7d2b046
41 changed files with 1428 additions and 142 deletions
+28 -28
View File
@@ -13,7 +13,7 @@
#define MAX_FONT_COUNT 128
template<typename T, uint32_t nCount>
class CAssetArc
class C_AssetArc
{
struct ObjectHandle_t
{
@@ -76,7 +76,7 @@ public:
}
};
class CAssetManager: public IAssetManager
class C_AssetManager: public IAssetManager
{
public:
virtual HFunnyModel LoadModel( const char *szName ) override;
@@ -105,37 +105,37 @@ public:
void LoadMaterialData( CBaseMaterial *pMaterial, IJSONObject *pObj );
CAssetArc<FunnyModel_t, MAX_MODEL_COUNT> m_models = {};
CAssetArc<FunnyMesh_t, MAX_MESH_COUNT> m_meshes = {};
CAssetArc<FunnyMaterial_t, MAX_MATERIAL_COUNT> m_materials = {};
CAssetArc<FunnyTexture_t, MAX_TEXTURE_COUNT> m_textures = {};
CAssetArc<IShader*, MAX_SHADER_COUNT> m_shaders = {};
CAssetArc<FunnyPhysics_t, MAX_PHYSICS_COUNT> m_physics = {};
C_AssetArc<FunnyModel_t, MAX_MODEL_COUNT> m_models = {};
C_AssetArc<FunnyMesh_t, MAX_MESH_COUNT> m_meshes = {};
C_AssetArc<FunnyMaterial_t, MAX_MATERIAL_COUNT> m_materials = {};
C_AssetArc<FunnyTexture_t, MAX_TEXTURE_COUNT> m_textures = {};
C_AssetArc<IShader*, MAX_SHADER_COUNT> m_shaders = {};
C_AssetArc<FunnyPhysics_t, MAX_PHYSICS_COUNT> m_physics = {};
};
FunnyModel_t *CAssetManager::GetModelByIndex( uint32_t uIndex )
FunnyModel_t *C_AssetManager::GetModelByIndex( uint32_t uIndex )
{
return m_models.GetObjectPtr(uIndex);
}
FunnyMaterial_t *CAssetManager::GetMaterialByIndex( uint32_t uIndex )
FunnyMaterial_t *C_AssetManager::GetMaterialByIndex( uint32_t uIndex )
{
return m_materials.GetObjectPtr(uIndex);
}
IShader **CAssetManager::GetShaderByIndex( uint32_t uIndex )
IShader **C_AssetManager::GetShaderByIndex( uint32_t uIndex )
{
return m_shaders.GetObjectPtr(uIndex);
}
FunnyMesh_t *CAssetManager::GetMeshByIndex( uint32_t uIndex )
FunnyMesh_t *C_AssetManager::GetMeshByIndex( uint32_t uIndex )
{
return m_meshes.GetObjectPtr(uIndex);
}
uint32_t CAssetManager::LoadModel( const char *szName )
uint32_t C_AssetManager::LoadModel( const char *szName )
{
bool bHasBeenCreated = false;
HFunnyModel hModel = m_models.GetOrCreateObject(szName, &bHasBeenCreated);
@@ -189,12 +189,12 @@ uint32_t CAssetManager::LoadModel( const char *szName )
}
}
void CAssetManager::UnrefModel( uint32_t uIndex )
void C_AssetManager::UnrefModel( uint32_t uIndex )
{
}
void CAssetManager::LoadMaterialData( CBaseMaterial *pMaterial, IJSONObject *pObj )
void C_AssetManager::LoadMaterialData( CBaseMaterial *pMaterial, IJSONObject *pObj )
{
for ( int i = 0; i < pMaterial->GetDataMap()->m_iNumFields; i++ )
{
@@ -236,7 +236,7 @@ void CAssetManager::LoadMaterialData( CBaseMaterial *pMaterial, IJSONObject *pOb
}
uint32_t CAssetManager::LoadMaterial( const char *szName )
uint32_t C_AssetManager::LoadMaterial( const char *szName )
{
bool bHasBeenCreated = false;
HFunnyMaterial hMaterial = m_materials.GetOrCreateObject(szName, &bHasBeenCreated);
@@ -288,12 +288,12 @@ uint32_t CAssetManager::LoadMaterial( const char *szName )
return hMaterial;
}
void CAssetManager::UnrefMaterial( uint32_t uIndex )
void C_AssetManager::UnrefMaterial( uint32_t uIndex )
{
}
HFunnyMesh CAssetManager::LoadMesh( const char *szName )
HFunnyMesh C_AssetManager::LoadMesh( const char *szName )
{
bool bHasBeenCreated = false;
HFunnyMesh hAsset = m_meshes.GetOrCreateObject(szName, &bHasBeenCreated);
@@ -322,12 +322,12 @@ HFunnyMesh CAssetManager::LoadMesh( const char *szName )
return hAsset;
}
void CAssetManager::UnrefMesh( uint32_t uIndex )
void C_AssetManager::UnrefMesh( uint32_t uIndex )
{
m_meshes.UnrefObject(uIndex);
}
uint32_t CAssetManager::LoadShader( const char *szName )
uint32_t C_AssetManager::LoadShader( const char *szName )
{
bool bHasBeenCreated = false;
uint32_t hShader = m_shaders.GetOrCreateObject(szName, &bHasBeenCreated);
@@ -347,12 +347,12 @@ uint32_t CAssetManager::LoadShader( const char *szName )
return hShader;
}
void CAssetManager::UnrefShader( uint32_t uIndex )
void C_AssetManager::UnrefShader( uint32_t uIndex )
{
m_shaders.UnrefObject(uIndex);
}
HFunnyTexture CAssetManager::LoadTexture( const char *szName )
HFunnyTexture C_AssetManager::LoadTexture( const char *szName )
{
bool bHasBeenCreated = false;
uint32_t hTexture = m_textures.GetOrCreateObject(szName, &bHasBeenCreated);
@@ -372,18 +372,18 @@ HFunnyTexture CAssetManager::LoadTexture( const char *szName )
return hTexture;
}
FunnyTexture_t *CAssetManager::GetTextureByIndex( HFunnyTexture hTexture )
FunnyTexture_t *C_AssetManager::GetTextureByIndex( HFunnyTexture hTexture )
{
return m_textures.GetObjectPtr(hTexture);
}
void CAssetManager::UnrefTexture( uint32_t hTexture )
void C_AssetManager::UnrefTexture( uint32_t hTexture )
{
}
HFunnyPhysics CAssetManager::LoadPhysics( const char *szName )
HFunnyPhysics C_AssetManager::LoadPhysics( const char *szName )
{
bool bHasBeenCreated = false;
HFunnyPhysics hPhysics = m_physics.GetOrCreateObject(szName, &bHasBeenCreated);
@@ -436,12 +436,12 @@ HFunnyPhysics CAssetManager::LoadPhysics( const char *szName )
}
FunnyPhysics_t *CAssetManager::GetPhysicsByIndex( HFunnyPhysics hPhysics )
FunnyPhysics_t *C_AssetManager::GetPhysicsByIndex( HFunnyPhysics hPhysics )
{
return m_physics.GetObjectPtr(hPhysics);
}
void CAssetManager::UnrefPhysics( HFunnyPhysics hPhysics )
void C_AssetManager::UnrefPhysics( HFunnyPhysics hPhysics )
{
m_physics.UnrefObject(hPhysics);
}
@@ -449,5 +449,5 @@ void CAssetManager::UnrefPhysics( HFunnyPhysics hPhysics )
static CAssetManager s_assetmgr;
static C_AssetManager s_assetmgr;
IAssetManager *g_pAssetManager = &s_assetmgr;