From f6cb467275a0b57cd8b9460c39ae20645e78d3a1 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Mon, 8 Apr 2013 20:05:19 +0200 Subject: [PATCH 1/4] - FBX::ImportSettings: fix initialization list order. --- code/FBXImportSettings.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/FBXImportSettings.h b/code/FBXImportSettings.h index 209b90b5b..47fc1d6a6 100644 --- a/code/FBXImportSettings.h +++ b/code/FBXImportSettings.h @@ -51,13 +51,13 @@ namespace FBX { struct ImportSettings { ImportSettings() - : readAllLayers(true) + : strictMode(true) + , readAllLayers(true) , readAllMaterials() , readMaterials(true) , readCameras(true) , readLights(true) , readAnimations(true) - , strictMode(true) , readWeights(true) , preservePivots(true) , optimizeEmptyAnimationCurves(true) From 052a8634d28f86da10c5b48d1caff3cdf80db8ad Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Mon, 8 Apr 2013 20:05:56 +0200 Subject: [PATCH 2/4] OgreMaterial: remove unneeded variable. --- code/OgreMaterial.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/OgreMaterial.cpp b/code/OgreMaterial.cpp index 213fa2128..b9913648e 100644 --- a/code/OgreMaterial.cpp +++ b/code/OgreMaterial.cpp @@ -64,8 +64,6 @@ namespace Ogre aiMaterial* OgreImporter::LoadMaterial(const std::string MaterialName) const { - const aiScene* const m_CurrentScene=this->m_CurrentScene;//make sure, that we can access but not change the scene - /*For better understanding of the material parser, here is a material example file: material Sarg From 232e69dc2ae935692947bda16ead6d9e887c1deb Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Mon, 8 Apr 2013 20:10:25 +0200 Subject: [PATCH 3/4] - Ifc: code cleanup, remove various non-needed variables as pointed out by gcc. --- code/IFCGeometry.cpp | 9 +++------ code/IFCOpenings.cpp | 10 +++------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 1d9c11dca..693db0f11 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -137,8 +137,6 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m const size_t outer_polygon_size = *outer_polygon_it; const IfcVector3& master_normal = normals[std::distance(begin, outer_polygon_it)]; - const IfcVector3& master_normal_norm = IfcVector3(master_normal).Normalize(); - // Generate fake openings to meet the interface for the quadrulate // algorithm. It boils down to generating small boxes given the @@ -329,8 +327,7 @@ void ProcessSweptDiskSolid(const IfcSweptDiskSolid solid, TempMesh& result, Conv } const std::vector& in = result.verts; - const size_t size=in.size(); - + const unsigned int cnt_segments = 16; const IfcFloat deltaAngle = AI_MATH_TWO_PI/cnt_segments; @@ -476,12 +473,12 @@ IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcVect IfcVector3 nor; // The input polygon is arbitrarily shaped, therefore we might need some tries - // until we find a suitable normal. Note that Newells algorithm would give + // until we find a suitable normal. Note that Newell's algorithm would give // a more robust result, but this variant also gives us a suitable first // axis for the 2D coordinate space on the polygon plane, exploiting the // fact that the input polygon is nearly always a quad. bool done = false; - size_t base = 0, i, j; + size_t i, j; for (i = 0; !done && i < s-2; done || ++i) { for (j = i+1; j < s-1; ++j) { nor = -((out[i]-any_point)^(out[j]-any_point)); diff --git a/code/IFCOpenings.cpp b/code/IFCOpenings.cpp index 2ba42d1e4..7f18e1440 100644 --- a/code/IFCOpenings.cpp +++ b/code/IFCOpenings.cpp @@ -603,7 +603,6 @@ bool IntersectingLineSegments(const IfcVector2& n0, const IfcVector2& n1, const IfcVector2& m0, const IfcVector2& m1, IfcVector2& out0, IfcVector2& out1) { - const IfcVector2& m0_to_m1 = m1 - m0; const IfcVector2& n0_to_n1 = n1 - n0; const IfcVector2& n0_to_m0 = m0 - n0; @@ -898,14 +897,13 @@ size_t CloseWindows(ContourVector& contours, ai_assert((*it).skiplist.size() == (*it).contour.size()); - SkipList::const_iterator skipbegin = (*it).skiplist.begin(), skipend = (*it).skiplist.end(); + SkipList::const_iterator skipbegin = (*it).skiplist.begin(); curmesh.verts.reserve(curmesh.verts.size() + (*it).contour.size() * 4); curmesh.vertcnt.reserve(curmesh.vertcnt.size() + (*it).contour.size()); // XXX this algorithm is really a bit inefficient - both in terms // of constant factor and of asymptotic runtime. - size_t vstart = curmesh.verts.size(); std::vector::const_iterator skipit = skipbegin; IfcVector3 start0; @@ -991,10 +989,10 @@ size_t CloseWindows(ContourVector& contours, } } } - + /* BOOST_FOREACH(TempOpening* opening, refs) { //opening->wallPoints.clear(); - } + }*/ } else { @@ -1146,7 +1144,6 @@ bool GenerateOpenings(std::vector& openings, bool generate_connection_geometry, const IfcVector3& wall_extrusion_axis) { - std::vector& out = curmesh.verts; OpeningRefVector contours_to_openings; // Try to derive a solid base plane within the current surface for use as @@ -1175,7 +1172,6 @@ bool GenerateOpenings(std::vector& openings, IfcVector3 wall_extrusion_axis_norm = wall_extrusion_axis; wall_extrusion_axis_norm.Normalize(); - size_t c = 0; BOOST_FOREACH(TempOpening& opening,openings) { // extrusionDir may be 0,0,0 on case where the opening mesh is not an From a288a631e2e3785abd1717f35d8fe04da1500a3a Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Mon, 8 Apr 2013 20:13:29 +0200 Subject: [PATCH 4/4] - FBX: avoid more gcc warnings. --- code/FBXBinaryTokenizer.cpp | 2 +- code/FBXConverter.cpp | 7 +++---- code/FBXDocument.cpp | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/code/FBXBinaryTokenizer.cpp b/code/FBXBinaryTokenizer.cpp index fc3a3a7b5..c7fdb8374 100644 --- a/code/FBXBinaryTokenizer.cpp +++ b/code/FBXBinaryTokenizer.cpp @@ -380,7 +380,7 @@ void TokenizeBinary(TokenList& output_tokens, const char* input, unsigned int le } - uint32_t offset = 0x1b; + //uint32_t offset = 0x1b; const char* cursor = input + 0x1b; diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index b04d8881c..3a21a89ee 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -97,9 +97,9 @@ public: public: Converter(aiScene* out, const Document& doc) - : out(out) + : defaultMaterialIndex() + , out(out) , doc(doc) - , defaultMaterialIndex() { // animations need to be converted first since this will // populate the node_anim_chain_bits map, which is needed @@ -1171,7 +1171,6 @@ private: ai_assert(cluster); const WeightIndexArray& indices = cluster->GetIndices(); - const WeightArray& weights = cluster->GetWeights(); if(indices.empty()) { continue; @@ -1198,7 +1197,7 @@ private: count_out_indices.push_back(0); for(unsigned int i = 0; i < count; ++i) { - if (no_mat_check || mats[geo.FaceForVertexIndex(out_idx[i])] == materialIndex) { + if (no_mat_check || static_cast(mats[geo.FaceForVertexIndex(out_idx[i])]) == materialIndex) { if (index_out_indices.back() == no_index_sentinel) { index_out_indices.back() = out_indices.size(); diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index b0c2de289..49f4afe14 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -231,8 +231,8 @@ Object::~Object() // ------------------------------------------------------------------------------------------------ FileGlobalSettings::FileGlobalSettings(const Document& doc, boost::shared_ptr props) -: doc(doc) -, props(props) +: props(props) +, doc(doc) { } @@ -579,7 +579,7 @@ std::vector Document::GetConnectionsSequenced(uint64_t id, bo for (size_t i = 0; i < c; ++i) { ai_assert(classnames[i]); - if(std::distance(key.begin(),key.end()) == lenghts[i] && !strncmp(classnames[i],obtype,lenghts[i])) { + if(static_cast(std::distance(key.begin(),key.end())) == lenghts[i] && !strncmp(classnames[i],obtype,lenghts[i])) { obtype = NULL; break; }