From ffe96e7e9c7e1c80bc9e2778a11efd1e25a241bf Mon Sep 17 00:00:00 2001 From: proxin Date: Sun, 1 Dec 2024 09:15:51 +0300 Subject: [PATCH] G1 support errors --- SpacerNET_Union/CreateVobs.cpp | 2 ++ SpacerNET_Union/Load3DS_Fast.cpp | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/SpacerNET_Union/CreateVobs.cpp b/SpacerNET_Union/CreateVobs.cpp index 99f3618..cc5d8b6 100644 --- a/SpacerNET_Union/CreateVobs.cpp +++ b/SpacerNET_Union/CreateVobs.cpp @@ -364,7 +364,9 @@ namespace GOTHIC_ENGINE { vobSound->SetSound(vobName); vobSound->soundRadius = 1500; vobSound->soundVolume = 100; +#if ENGINE == Engine_G2A vobSound->m_zBias = 0; +#endif vobSound->soundVolType = zCVobSound::zTSoundVolType::SV_SPHERE; vobSound->showVisual = true; vobSound->soundMode = zCVobSound::zTSoundMode::SM_RANDOM; diff --git a/SpacerNET_Union/Load3DS_Fast.cpp b/SpacerNET_Union/Load3DS_Fast.cpp index 388ecfa..3669a47 100644 --- a/SpacerNET_Union/Load3DS_Fast.cpp +++ b/SpacerNET_Union/Load3DS_Fast.cpp @@ -5,7 +5,7 @@ namespace GOTHIC_ENGINE { // Add your code here . . . -#if ENGINE == Engine_G2A + // This code allows to skip creating OBBOX tree for 3ds LOCATION file, it saves about ~30% of 3ds load time // don't use for vobs! 3DS mesh location only! bool dontCreateOBBOXOnLocationLoad = false; @@ -41,6 +41,7 @@ namespace GOTHIC_ENGINE { dontCreateOBBOXOnLocationLoad = false; } +#if ENGINE == Engine_G2A HOOK ivk_zCMesh_CalcBBox3D AS(&zCMesh::CalcBBox3D, &zCMesh::CalcBBox3D_Union); void zCMesh::CalcBBox3D_Union(const zBOOL fastApprox) @@ -81,21 +82,21 @@ namespace GOTHIC_ENGINE { UnshareFeatures(); if (bGreat || dontCreateOBBOXOnLocationLoad) { - m_bbAxisAligned.Init(); - for (int i = 0; i < m_nSizeVertex; i++) - m_bbAxisAligned.AddPoint(m_ppVertex[i]->m_vPosition); + bbox3D.Init(); + for (int i = 0; i < numVert; i++) + bbox3D.AddPoint(vertList[i]->position); } else { - m_bbOriented.BuildOBBTree(this, 3); - m_bbAxisAligned = m_bbOriented.GetBBox3D(); + obbox3D.BuildOBBTree(this, 3); + bbox3D = obbox3D.GetBBox3D(); } - if (m_nSizeVertex && m_nSizePolygon) + if (numVert && numPoly) return; - m_bbAxisAligned.vMin = -0.1f; - m_bbAxisAligned.vMax = 0.1f; - }; + zREAL D = 0.1F; + bbox3D.mins = -zVEC3(D, D, D); + bbox3D.maxs = zVEC3(D, D, D); }; #endif