Browse Source

vphysics: increased g_MeshSize value( fixes some crashes in ep2 ), update ivp submodule

pull/84/head
nillerusr 2 years ago
parent
commit
a53fff833f
  1. 2
      ivp
  2. 6
      vphysics/physics_virtualmesh.cpp

2
ivp

@ -1 +1 @@
Subproject commit 878a544907704eee58555736615e11f7e0ff4109 Subproject commit fb8f2ac922a7f8f758a552ddbe47f1933ffe42b0

6
vphysics/physics_virtualmesh.cpp

@ -185,8 +185,7 @@ void CMeshInstance::Init( const virtualmeshlist_t &list )
} }
} }
// UNDONE: Tune / expose this constant 512K budget for terrain collision const int g_MeshSize = (2048 * 1024 * 4); // nillerusr: 2 MiB should be enough, old value causes problems in ep2
const int g_MeshSize = (2048 * 1024);
static CDataManager<CMeshInstance, virtualmeshlist_t, CMeshInstance *, CThreadFastMutex> g_MeshManager( g_MeshSize ); static CDataManager<CMeshInstance, virtualmeshlist_t, CMeshInstance *, CThreadFastMutex> g_MeshManager( g_MeshSize );
static int numIndices = 0, numTriangles = 0, numBaseTriangles = 0, numSplits = 0; static int numIndices = 0, numTriangles = 0, numBaseTriangles = 0, numSplits = 0;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -449,6 +448,9 @@ CMeshInstance *CPhysCollideVirtualMesh::BuildLedges()
m_hMemory = g_MeshManager.CreateResource( list ); m_hMemory = g_MeshManager.CreateResource( list );
m_ledgeCount = list.triangleCount; m_ledgeCount = list.triangleCount;
CMeshInstance *pMesh = g_MeshManager.LockResource( m_hMemory ); CMeshInstance *pMesh = g_MeshManager.LockResource( m_hMemory );
Assert( g_MeshManager.AvailableSize() != 0 );
return pMesh; return pMesh;
} }
return NULL; return NULL;

Loading…
Cancel
Save