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
+26 -7
View File
@@ -63,14 +63,14 @@ CBaseEntity *CEntitySystem::CreateByClassname( const char *szName, int *pOutputI
int i;
int iSelectedSlot;
pFactory = GetFactoryByClassname(szName);
if ( !pFactory )
return NULL;
// We do not want to have more than MAX_EDICT entities
if ( m_nEntityCount >= MAX_EDICTS-1 )
return NULL;
pFactory = GetFactoryByClassname(szName);
if ( !pFactory )
return NULL;
// Search for space
// Could be more efficient but nobody cares
for ( i = 0; i < MAX_EDICTS; i++ )
@@ -112,7 +112,6 @@ IEntityFactory *CEntitySystem::GetFactoryByClassname( const char *szName )
}
return NULL;
}
void CEntitySystem::Think( float fDelta )
{
CBaseEntity *pEntity;
@@ -120,7 +119,6 @@ void CEntitySystem::Think( float fDelta )
for ( i = 0; i < MAX_EDICTS; i++ )
{
pEntity = m_pEntities[i];
if ( pEntity == NULL )
continue;
@@ -150,6 +148,23 @@ searchIndex:
return NULL;
}
static netfield_t *UTIL_GetNetMapField( CBaseEntity *pEntity, netmap_t *pMap, uint32_t uIndex )
{
netmap_t *pCurrentMap = pMap;
uint32_t uCurrentIndex = uIndex;
searchIndex:
if ( pCurrentMap )
{
if (uCurrentIndex >= pCurrentMap->m_uFieldCount)
{
uCurrentIndex -= pCurrentMap->m_uFieldCount;
pCurrentMap = pCurrentMap->m_pBase;
goto searchIndex;
}
return &pCurrentMap->m_pFields[uCurrentIndex];
}
return NULL;
}
void CEntitySystem::NetRecvPacket( NetPacket_t *pPacket )
{
@@ -182,9 +197,13 @@ void CEntitySystem::NetRecvPacket( NetPacket_t *pPacket )
// this shall be reworked
for ( uint32_t u = 0; u < pPlayerPacket->m_entityData.m_uCount; u++ )
{
netfield_t *pnf = UTIL_GetNetMapField(
pEntity,
pEntity->GetRecvMap(),
pcSyncValue->m_uVariableIndex);
uint32_t uVariableSize = pcSyncValue->m_uVariableSize;
void *pValueData = (float*)UTIL_GetNetMapData(
void *pValueData = UTIL_GetNetMapData(
pEntity,
pEntity->GetRecvMap(),
pcSyncValue->m_uVariableIndex);