Permalink
Browse files

Fix bugs related to API change in COLLADAFW::InstanceGeometry::Materi…

…alBindingArray
  • Loading branch information...
1 parent ab6b738 commit cd00d900c48f440b433bdbcf0e220d708d66614c @opencollada-sebastian opencollada-sebastian committed Aug 4, 2011
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -119,10 +119,10 @@ namespace DAE23ds
size_t calculateTrianglesCount();
/** Calculates the length including null termination of all materials names.*/
-// ChunkLength calculateMaterialNamesLength( const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings);
+// ChunkLength calculateMaterialNamesLength( const COLLADAFW::MaterialBindingArray& materialBindings);
/** Calculates the length of all material faces.*/
- ChunkLength calculateFacesMaterialsLength(CountType trianglesCount, const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings);
+ ChunkLength calculateFacesMaterialsLength(CountType trianglesCount, const COLLADAFW::MaterialBindingArray& materialBindings);
/** Calculates the length of the faces description, given the number of triangles.*/
ChunkLength calculateFacesDescriptionLength(CountType trianglesCount, ChunkLength facesMaterialsLength);
@@ -78,10 +78,10 @@ namespace DAE23ds
bool writeTrianglesForMultipleObjects(CountType trianglesCount);
/** writes the faces materials.*/
- bool writeFaceMaterials(const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings);
+ bool writeFaceMaterials(const COLLADAFW::MaterialBindingArray& materialBindings);
/** */
- bool writeFaceMaterialsForMultipleObjects(const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings, const ObjectBlockData& blockData);
+ bool writeFaceMaterialsForMultipleObjects(const COLLADAFW::MaterialBindingArray& materialBindings, const ObjectBlockData& blockData);
/** Writes the mesh matrix of the tri object.*/
bool writeMeshMatrix(const COLLADABU::Math::Matrix4& worldMatrix);
@@ -43,14 +43,14 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include;..\..\COLLADABaseUtils\include;..\..\COLLADABaseUtils\include\Math;..\..\COLLADAFramework\include;..\..\COLLADASaxFrameworkLoader\include;..\..\common\libBuffer\include;..\..\common\libftoa\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;IWILLNOTUSEASSERTSOUTSIDETHISSCOPE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="DAE23dsStableHeaders.h"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
+ Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
@@ -123,12 +123,12 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\include;..\..\COLLADABaseUtils\include;..\..\COLLADABaseUtils\include\Math;..\..\COLLADAFramework\include;..\..\COLLADASaxFrameworkLoader\include;..\..\common\libBuffer\include;..\..\common\libftoa\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;IWILLNOTUSEASSERTSOUTSIDETHISSCOPE"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="DAE23dsStableHeaders.h"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
+ Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
/>
<Tool
@@ -103,7 +103,7 @@ namespace DAE23ds
bool MeshBase::handleMeshIntoMultipleObjects( const Writer::InstanceGeometryInfo& instanceGeometryInfo, const COLLADAFW::InstanceGeometry* alreadyUsingInstance)
{
const COLLADAFW::InstanceGeometry* instanceGeometry = instanceGeometryInfo.fwInstanceGeometry;
- const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
+ const COLLADAFW::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
size_t trianglesCount = calculateTrianglesCount();
@@ -154,7 +154,7 @@ namespace DAE23ds
bool MeshBase::handleMeshIntoOneObject( const Writer::InstanceGeometryInfo& instanceGeometryInfo, const COLLADAFW::InstanceGeometry* alreadyUsingInstance)
{
const COLLADAFW::InstanceGeometry* instanceGeometry = instanceGeometryInfo.fwInstanceGeometry;
- const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
+ const COLLADAFW::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
CountType trianglesCount = (CountType)calculateTrianglesCount();
@@ -232,7 +232,7 @@ namespace DAE23ds
}
//------------------------------
-// ChunkLength MeshBase::calculateMaterialNamesLength( const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings)
+// ChunkLength MeshBase::calculateMaterialNamesLength( const COLLADAFW::MaterialBindingArray& materialBindings)
// {
// ChunkLength length = 0;
//
@@ -246,7 +246,7 @@ namespace DAE23ds
// }
//------------------------------
- ChunkLength MeshBase::calculateFacesMaterialsLength(CountType trianglesCount, const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings)
+ ChunkLength MeshBase::calculateFacesMaterialsLength(CountType trianglesCount, const COLLADAFW::MaterialBindingArray& materialBindings)
{
// the size is determined by:
// 1) the number of materials and their name length
@@ -66,7 +66,7 @@ namespace DAE23ds
else
{
// we need to export the mesh
- const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
+ const COLLADAFW::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
// writeMaterialBlocks(materialBindings);
@@ -96,7 +96,7 @@ namespace DAE23ds
bool MeshWriter::writeMeshIntoObject( const Writer::InstanceGeometryInfo& instanceGeometryInfo, const ObjectBlockData& blockData)
{
const COLLADAFW::InstanceGeometry* instanceGeometry = instanceGeometryInfo.fwInstanceGeometry;
- const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
+ const COLLADAFW::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
ChunkLength verticesLength = calculateVerticesLength(blockData.trianglesCount*3*3);
ChunkLength facesMaterialsLength = calculateFacesMaterialsLength(blockData.trianglesCount, materialBindings);
@@ -157,7 +157,7 @@ namespace DAE23ds
}
else
{
- const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
+ const COLLADAFW::MaterialBindingArray& materialBindings = instanceGeometry->getMaterialBindings();
// writeMaterialBlocks(materialBindings);
@@ -409,11 +409,11 @@ namespace DAE23ds
//------------------------------
- bool MeshWriter::writeFaceMaterials(const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings)
+ bool MeshWriter::writeFaceMaterials(const COLLADAFW::MaterialBindingArray& materialBindings)
{
for ( size_t i = 0, count = materialBindings.getCount(); i < count; ++i)
{
- const COLLADAFW::InstanceGeometry::MaterialBinding& materialBinding = materialBindings[i];
+ const COLLADAFW::MaterialBinding& materialBinding = materialBindings[i];
COLLADAFW::MaterialId materialId = materialBinding.getMaterialId();
const COLLADAFW::UniqueId& materialUniqueId = materialBinding.getReferencedMaterial();
@@ -488,11 +488,11 @@ namespace DAE23ds
}
//------------------------------
- bool MeshWriter::writeFaceMaterialsForMultipleObjects(const COLLADAFW::InstanceGeometry::MaterialBindingArray& materialBindings, const ObjectBlockData& blockData)
+ bool MeshWriter::writeFaceMaterialsForMultipleObjects(const COLLADAFW::MaterialBindingArray& materialBindings, const ObjectBlockData& blockData)
{
for ( size_t i = 0, count = materialBindings.getCount(); i < count; ++i)
{
- const COLLADAFW::InstanceGeometry::MaterialBinding& materialBinding = materialBindings[i];
+ const COLLADAFW::MaterialBinding& materialBinding = materialBindings[i];
COLLADAFW::MaterialId materialId = materialBinding.getMaterialId();
const COLLADAFW::UniqueId& materialUniqueId = materialBinding.getReferencedMaterial();
@@ -333,7 +333,7 @@ namespace DAE23ds
//--------------------------------------------------------------------
void Writer::fillMaterialBindingMap(const GeometryMaterialBinding& materialBinding)
{
- const COLLADAFW::InstanceGeometry::MaterialBindingArray& fwBindings = materialBinding.fwInstanceGeometry->getMaterialBindings();
+ const COLLADAFW::MaterialBindingArray& fwBindings = materialBinding.fwInstanceGeometry->getMaterialBindings();
size_t fwBindingCount = fwBindings.getCount();
if ( fwBindingCount == materialBinding.bindingMap.size() )
@@ -344,7 +344,7 @@ namespace DAE23ds
for ( size_t i = 0; i< fwBindingCount; ++i)
{
- const COLLADAFW::InstanceGeometry::MaterialBinding& fwBinding = fwBindings[i];
+ const COLLADAFW::MaterialBinding& fwBinding = fwBindings[i];
materialBinding.bindingMap.insert(std::make_pair(fwBinding.getMaterialId(), fwBinding.getReferencedMaterial()));
}
}
@@ -361,8 +361,8 @@ namespace DAE23ds
if ( lhsGeometryUniqueId > rhsGeometryUniqueId )
return false;
- const COLLADAFW::InstanceGeometry::MaterialBindingArray& lhsFwBinding = lhs.fwInstanceGeometry->getMaterialBindings();
- const COLLADAFW::InstanceGeometry::MaterialBindingArray& rhsFwBinding = rhs.fwInstanceGeometry->getMaterialBindings();
+ const COLLADAFW::MaterialBindingArray& lhsFwBinding = lhs.fwInstanceGeometry->getMaterialBindings();
+ const COLLADAFW::MaterialBindingArray& rhsFwBinding = rhs.fwInstanceGeometry->getMaterialBindings();
if ( lhsFwBinding.getCount() < rhsFwBinding.getCount() )
return true;

0 comments on commit cd00d90

Please sign in to comment.