Fixed: Export crashes caused by incorrect delete of objects created by max.

This commit is contained in:
kaetemi 2010-06-05 00:44:34 +02:00
parent f55e1a4cb0
commit 1541973376
11 changed files with 90 additions and 88 deletions

View file

@ -98,7 +98,7 @@ bool SLightBuild::canConvertFromMaxLight (INode *node, TimeValue tvTime)
return false;
if( deleteIt )
delete maxLight;
maxLight->DeleteMe();
return true;
}
@ -295,7 +295,7 @@ void SLightBuild::convertFromMaxLight (INode *node,TimeValue tvTime)
this->rSoftShadowConeLength = (float)atof(sTmp.c_str());
if( deleteIt )
delete maxLight;
maxLight->DeleteMe();
}
// ***********************************************************************************************

View file

@ -135,7 +135,7 @@ CCollisionMeshBuild* CExportNel::createCollisionMeshBuild(std::vector<INode *> &
// Delete the triObject if we should...
if (deleteIt)
delete tri;
tri->DeleteMe();
}
}
}

View file

@ -237,7 +237,7 @@ void CExportNel::getLights (std::vector<CLight>& vectLight, TimeValue time, INod
// Delete the triObject if we should...
if (deleteIt)
delete maxLight;
maxLight->DeleteMe();
}
}

View file

@ -177,7 +177,7 @@ bool CExportNel::buildLodCharacter (NL3D::CLodCharacterShapeBuild& lodBuild, IN
// Delete the triObject if we should...
if (deleteIt)
delete tri;
tri->DeleteMe();
}
}

View file

@ -107,7 +107,7 @@ CMesh::CMeshBuild* CExportNel::createMeshBuild(INode& node, TimeValue tvTime, CM
// Delete the triObject if we should...
if (deleteIt)
delete tri;
tri->DeleteMe();
}
}
@ -441,7 +441,7 @@ IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt
// Delete the triObject if we should...
if (deleteIt)
delete tri;
tri->DeleteMe();
}
}
@ -1388,7 +1388,7 @@ IMeshGeom *CExportNel::buildMeshGeom (INode& node, TimeValue time, const TInodeP
// Delete the triObject if we should...
if (deleteIt)
delete tri;
tri->DeleteMe();
}
}
@ -2033,7 +2033,7 @@ NL3D::IShape *CExportNel::buildWaterShape(INode& node, TimeValue time)
// Delete the triObject if we should...
if (deleteIt)
delete tri;
tri->DeleteMe();
nlinfo("WaterShape : build succesful");
return ws;
}
@ -2074,7 +2074,7 @@ bool CExportNel::buildMeshAABBox(INode &node, NLMISC::CAABBox &dest, TimeValue t
if (deleteIt)
{
#ifndef NL_DEBUG
delete tri;
tri->DeleteMe();
#endif // NL_DEBUG
}
return true;

View file

@ -178,7 +178,7 @@ bool CMeshInterface::buildFromMaxMesh(INode &node, TimeValue tvTime)
//
if (deleteIt)
{
delete tri;
tri->DeleteMe();
}
return true;
}
@ -358,7 +358,7 @@ static void AddNodeToQuadGrid(const NLMISC::CAABBox &delimiter, TNodeFaceQG &des
//
if (deleteIt)
{
delete tri;
tri->DeleteMe();
}
}
}
@ -487,7 +487,7 @@ static bool SelectVerticesInMeshFromInterfaces(const std::vector<CMeshInterface>
if (obj != tri)
{
// not a mesh object, so do nothing
delete tri;
tri->DeleteMe();
return false;
}

View file

@ -1257,7 +1257,7 @@ void CExportNel::buildCamera(NL3D::CCameraInfo &cameraInfo, INode& node, TimeVal
cameraInfo.Fov = genCamera->GetFOV(time);
if (deleteIt)
delete genCamera;
genCamera->DeleteMe();
}
}
}

View file

@ -597,6 +597,7 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector<INode*>& vectNode, v
else
{
// What???
nlerror("sLightBuild.Type == %i", (uint32)(sLightBuild.Type));
nlstop;
}

View file

@ -1423,7 +1423,7 @@ bool CExportNel::mirrorPhysiqueSelection(INode &node, TimeValue tvTime, const st
// Delete the triObject if we should...
if (deleteIt)
delete tri;
tri->DeleteMe();
// ok!
ok= true;

View file

@ -151,7 +151,7 @@ bool CExportNel::buildVegetableShape (NL3D::CVegetableShape& skeletonShape, INo
}
if (deleteIt)
delete tri;
tri->DeleteMe();
}
}

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="nel_mesh_lib"
ProjectGUID="{76F225A9-306F-4B99-9606-6B98B680F5FB}"
RootNamespace="nel_mesh_lib"
@ -87,75 +87,6 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="obj\$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory="obj\$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="4"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
PreprocessorDefinitions="LIBXML_STATIC;WIN32;NDEBUG;ASSERT_THROW_EXCEPTION;_LIB"
StringPooling="true"
ExceptionHandling="2"
RuntimeLibrary="2"
DisableLanguageExtensions="false"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(RootNamespace)_r.lib"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="libc;libcmt;libcmtd;msvcrtd"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
@ -226,6 +157,76 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="obj\$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory="obj\$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="4"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
PreprocessorDefinitions="LIBXML_STATIC;WIN32;NDEBUG;ASSERT_THROW_EXCEPTION;_LIB"
StringPooling="true"
ExceptionHandling="2"
RuntimeLibrary="2"
DisableLanguageExtensions="false"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(RootNamespace)_r.lib"
SuppressStartupBanner="true"
IgnoreDefaultLibraryNames="libc;libcmt;libcmtd;msvcrtd"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
@ -416,7 +417,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -424,7 +425,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"