From dc123461c730bdc452a8f33593e9c6b37d02f05d Mon Sep 17 00:00:00 2001 From: Michael PLATINGS Date: Tue, 21 Jun 2011 09:29:32 +0000 Subject: [PATCH] Fixed redundant "enumeration not handled in switch" warnings. Fixed a warning about a comparison between different enums - EUnifiedMappingType was being compared with EMappingType. In general the FBX SDK is moving away from Get & Set functions to giving direct access to properties, so I have changed GetMappingType() to CurrentMappingType.Get() --- src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp | 2 +- src/osgPlugins/fbx/fbxRLight.cpp | 2 ++ src/osgPlugins/fbx/fbxRMesh.cpp | 6 ++++++ src/osgPlugins/fbx/fbxRNode.cpp | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp b/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp index d250e8323..bfb80da17 100644 --- a/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp +++ b/src/osgPlugins/fbx/fbxMaterialToOsgStateSet.cpp @@ -84,7 +84,7 @@ FbxMaterialToOsgStateSet::convert(const KFbxSurfaceMaterial* pFbxMat) if (lTexture) { // support only spherical reflection maps... - if (KFbxFileTexture::eUMT_ENVIRONMENT == lTexture->GetMappingType()) + if (KFbxFileTexture::eUMT_ENVIRONMENT == lTexture->CurrentMappingType.Get()) { result.reflectionTexture = fbxTextureToOsgTexture(lTexture); result.reflectionChannel = lTexture->UVSet.Get(); diff --git a/src/osgPlugins/fbx/fbxRLight.cpp b/src/osgPlugins/fbx/fbxRLight.cpp index 063becb91..d7699bbfb 100644 --- a/src/osgPlugins/fbx/fbxRLight.cpp +++ b/src/osgPlugins/fbx/fbxRLight.cpp @@ -56,6 +56,8 @@ osgDB::ReaderWriter::ReadResult OsgFbxReader::readFbxLight(KFbxNode* pNode, int& switch (fbxLight->DecayType.Get()) { + case KFbxLight::eNONE: + break; case KFbxLight::eLINEAR: osgLight->setLinearAttenuation(fbxDecayStart); break; diff --git a/src/osgPlugins/fbx/fbxRMesh.cpp b/src/osgPlugins/fbx/fbxRMesh.cpp index 6ad6c2f30..36e012a78 100644 --- a/src/osgPlugins/fbx/fbxRMesh.cpp +++ b/src/osgPlugins/fbx/fbxRMesh.cpp @@ -62,6 +62,8 @@ bool layerElementValid(const KFbxLayerElementTemplate* pLayerElement) case KFbxLayerElement::eDIRECT: case KFbxLayerElement::eINDEX_TO_DIRECT: return true; + default: + break; } return false; @@ -85,6 +87,8 @@ int getVertexIndex(const KFbxLayerElementTemplate* pLayerElement, case KFbxLayerElement::eBY_POLYGON: index = nPolygon; break; + default: + OSG_WARN << "getVertexIndex: unsupported FBX mapping mode" << std::endl; } if (pLayerElement->GetReferenceMode() == KFbxLayerElement::eDIRECT) @@ -107,6 +111,8 @@ int getPolygonIndex(const KFbxLayerElementTemplate* pLayerElement, int nPolyg return nPolygon; case KFbxLayerElement::eINDEX_TO_DIRECT: return pLayerElement->GetIndexArray().GetAt(nPolygon); + default: + break; } } diff --git a/src/osgPlugins/fbx/fbxRNode.cpp b/src/osgPlugins/fbx/fbxRNode.cpp index 9640ce8dd..2808b1296 100644 --- a/src/osgPlugins/fbx/fbxRNode.cpp +++ b/src/osgPlugins/fbx/fbxRNode.cpp @@ -568,6 +568,8 @@ osgDB::ReaderWriter::ReadResult OsgFbxReader::readFbxNode( } } break; + default: + break; } if (bEmpty)