diff options
Diffstat (limited to 'src/3rdparty/assimp/code/3DSConverter.cpp')
-rw-r--r-- | src/3rdparty/assimp/code/3DSConverter.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/3rdparty/assimp/code/3DSConverter.cpp b/src/3rdparty/assimp/code/3DSConverter.cpp index cb6fd9077..820c28f90 100644 --- a/src/3rdparty/assimp/code/3DSConverter.cpp +++ b/src/3rdparty/assimp/code/3DSConverter.cpp @@ -3,7 +3,8 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2017, assimp team + All rights reserved. @@ -55,18 +56,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; +static const unsigned int NotSet = 0xcdcdcdcd; + // ------------------------------------------------------------------------------------------------ // Setup final material indices, generae a default material if necessary void Discreet3DSImporter::ReplaceDefaultMaterial() { - // Try to find an existing material that matches the // typical default material setting: // - no textures // - diffuse color (in grey!) // NOTE: This is here to workaround the fact that some // exporters are writing a default material, too. - unsigned int idx = 0xcdcdcdcd; + unsigned int idx( NotSet ); for (unsigned int i = 0; i < mScene->mMaterials.size();++i) { std::string s = mScene->mMaterials[i].mName; @@ -92,7 +94,9 @@ void Discreet3DSImporter::ReplaceDefaultMaterial() } idx = i; } - if (0xcdcdcdcd == idx)idx = (unsigned int)mScene->mMaterials.size(); + if ( NotSet == idx ) { + idx = ( unsigned int )mScene->mMaterials.size(); + } // now iterate through all meshes and through all faces and // find all faces that are using the default material @@ -197,7 +201,7 @@ void CopyTexture(aiMaterial& mat, D3DS::Texture& texture, aiTextureType type) // Setup the texture blend factor if (is_not_qnan(texture.mTextureBlend)) - mat.AddProperty<float>( &texture.mTextureBlend, 1, AI_MATKEY_TEXBLEND(type,0)); + mat.AddProperty<ai_real>( &texture.mTextureBlend, 1, AI_MATKEY_TEXBLEND(type,0)); // Setup the texture mapping mode mat.AddProperty<int>((int*)&texture.mMapMode,1,AI_MATKEY_MAPPINGMODE_U(type,0)); @@ -207,14 +211,14 @@ void CopyTexture(aiMaterial& mat, D3DS::Texture& texture, aiTextureType type) // FIXME: this is not really correct ... if (texture.mMapMode == aiTextureMapMode_Mirror) { - texture.mScaleU *= 2.f; - texture.mScaleV *= 2.f; - texture.mOffsetU /= 2.f; - texture.mOffsetV /= 2.f; + texture.mScaleU *= 2.0; + texture.mScaleV *= 2.0; + texture.mOffsetU /= 2.0; + texture.mOffsetV /= 2.0; } // Setup texture UV transformations - mat.AddProperty<float>(&texture.mOffsetU,5,AI_MATKEY_UVTRANSFORM(type,0)); + mat.AddProperty<ai_real>(&texture.mOffsetU,5,AI_MATKEY_UVTRANSFORM(type,0)); } // ------------------------------------------------------------------------------------------------ @@ -265,10 +269,10 @@ void Discreet3DSImporter::ConvertMaterial(D3DS::Material& oldMat, } // Opacity - mat.AddProperty<float>( &oldMat.mTransparency,1,AI_MATKEY_OPACITY); + mat.AddProperty<ai_real>( &oldMat.mTransparency,1,AI_MATKEY_OPACITY); // Bump height scaling - mat.AddProperty<float>( &oldMat.mBumpHeight,1,AI_MATKEY_BUMPSCALING); + mat.AddProperty<ai_real>( &oldMat.mBumpHeight,1,AI_MATKEY_BUMPSCALING); // Two sided rendering? if (oldMat.mTwoSided) @@ -690,7 +694,7 @@ void Discreet3DSImporter::AddNodeToGraph(aiScene* pcSOut,aiNode* pcOut, pcOut->mChildren = new aiNode*[pcIn->mChildren.size()]; // Recursively process all children - const unsigned int size = pcIn->mChildren.size(); + const unsigned int size = static_cast<unsigned int>(pcIn->mChildren.size()); for (unsigned int i = 0; i < size;++i) { pcOut->mChildren[i] = new aiNode(); @@ -742,7 +746,7 @@ void Discreet3DSImporter::GenerateNodeGraph(aiScene* pcOut) DefaultLogger::get()->warn("No hierarchy information has been found in the file. "); pcOut->mRootNode->mNumChildren = pcOut->mNumMeshes + - mScene->mCameras.size() + mScene->mLights.size(); + static_cast<unsigned int>(mScene->mCameras.size() + mScene->mLights.size()); pcOut->mRootNode->mChildren = new aiNode* [ pcOut->mRootNode->mNumChildren ]; pcOut->mRootNode->mName.Set("<3DSDummyRoot>"); |