From a53fff833ff9953f98551398443bacd886183029 Mon Sep 17 00:00:00 2001 From: nillerusr Date: Wed, 27 Jul 2022 04:00:21 +0300 Subject: [PATCH] vphysics: increased g_MeshSize value( fixes some crashes in ep2 ), update ivp submodule --- ivp | 2 +- vphysics/physics_virtualmesh.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ivp b/ivp index 878a5449..fb8f2ac9 160000 --- a/ivp +++ b/ivp @@ -1 +1 @@ -Subproject commit 878a544907704eee58555736615e11f7e0ff4109 +Subproject commit fb8f2ac922a7f8f758a552ddbe47f1933ffe42b0 diff --git a/vphysics/physics_virtualmesh.cpp b/vphysics/physics_virtualmesh.cpp index 0242478e..a8f5bc51 100644 --- a/vphysics/physics_virtualmesh.cpp +++ b/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); +const int g_MeshSize = (2048 * 1024 * 4); // nillerusr: 2 MiB should be enough, old value causes problems in ep2 static CDataManager g_MeshManager( g_MeshSize ); static int numIndices = 0, numTriangles = 0, numBaseTriangles = 0, numSplits = 0; //----------------------------------------------------------------------------- @@ -449,6 +448,9 @@ CMeshInstance *CPhysCollideVirtualMesh::BuildLedges() m_hMemory = g_MeshManager.CreateResource( list ); m_ledgeCount = list.triangleCount; CMeshInstance *pMesh = g_MeshManager.LockResource( m_hMemory ); + + Assert( g_MeshManager.AvailableSize() != 0 ); + return pMesh; } return NULL;