From 35fafe3a6f5476ae0c552c5ddc985169959720db Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 9 Dec 2015 23:49:03 +0100 Subject: [PATCH] ColladaParser: use initializer lists again. --- code/ColladaParser.cpp | 31 ++++++++++++++----------------- code/ColladaParser.h | 1 + 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 4c47da550..f65d244c2 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -66,18 +66,18 @@ using namespace Assimp::Collada; ColladaParser::ColladaParser( IOSystem* pIOHandler, const std::string& pFile) : mFileName( pFile ) , mReader( NULL ) - //, mDataLibrary() - //, mAccessorLibrary() - //, mMeshLibrary() - //, mNodeLibrary() - //, mImageLibrary() - //, mEffectLibrary() - //, mMaterialLibrary() - //, mLightLibrary() - //, mCameraLibrary() - //, mControllerLibrary() + , mDataLibrary() + , mAccessorLibrary() + , mMeshLibrary() + , mNodeLibrary() + , mImageLibrary() + , mEffectLibrary() + , mMaterialLibrary() + , mLightLibrary() + , mCameraLibrary() + , mControllerLibrary() , mRootNode( NULL ) - //, mAnims() + , mAnims() , mUnitSize( 1.0f ) , mUpDirection( UP_Y ) , mFormat(FV_1_5_n ) // We assume the newest file format by default @@ -88,13 +88,13 @@ ColladaParser::ColladaParser( IOSystem* pIOHandler, const std::string& pFile) } // open the file - boost::scoped_ptr file( pIOHandler->Open( pFile ) ); - if ( file.get() == NULL ) { + boost::scoped_ptr file( pIOHandler->Open(pFile ) ); + if (file.get() == NULL) { throw DeadlyImportError( "Failed to open file " + pFile + "." ); } // generate a XML reader for it - boost::scoped_ptr mIOWrapper( new CIrrXML_IOStreamReader( file.get())); + boost::scoped_ptr mIOWrapper(new CIrrXML_IOStreamReader(file.get())); mReader = irr::io::createIrrXMLReader( mIOWrapper.get()); if (!mReader) { ThrowException("Collada: Unable to open file."); @@ -102,9 +102,6 @@ ColladaParser::ColladaParser( IOSystem* pIOHandler, const std::string& pFile) // start reading ReadContents(); - - // release file after import - //pIOHandler->Close( file.get() ); } // ------------------------------------------------------------------------------------------------ diff --git a/code/ColladaParser.h b/code/ColladaParser.h index a945b70a7..3a8678ff1 100644 --- a/code/ColladaParser.h +++ b/code/ColladaParser.h @@ -49,6 +49,7 @@ #include "ColladaHelper.h" #include "../include/assimp/ai_assert.h" #include +#include namespace Assimp {