diff --git a/code/AssimpPCH.h b/code/AssimpPCH.h index 7ad7a0ca1..dfb18ef2a 100644 --- a/code/AssimpPCH.h +++ b/code/AssimpPCH.h @@ -128,6 +128,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include // Public ASSIMP headers #include "../include/DefaultLogger.h" diff --git a/code/BoostWorkaround/boost/lexical_cast.hpp b/code/BoostWorkaround/boost/lexical_cast.hpp new file mode 100644 index 000000000..e6e36d025 --- /dev/null +++ b/code/BoostWorkaround/boost/lexical_cast.hpp @@ -0,0 +1,23 @@ +/// A quick replacement for boost::lexical_cast for all the Boost haters out there + +#ifndef __AI_BOOST_WORKAROUND_LEXICAL_CAST +#define __AI_BOOST_WORKAROUND_LEXICAL_CAST + +namespace boost +{ + + /// A quick replacement for boost::lexical_cast - should work for all types a stringstream can handle + template + TargetType lexical_cast( const SourceType& source) + { + std::stringstream stream; + TargetType result; + + stream << source; + stream >> result; + return result; + } + +} // namespace boost + +#endif // __AI_BOOST_WORKAROUND_LEXICAL_CAST \ No newline at end of file diff --git a/code/XFileParser.cpp b/code/XFileParser.cpp index 3bad8c963..0a9e23e0a 100644 --- a/code/XFileParser.cpp +++ b/code/XFileParser.cpp @@ -710,6 +710,8 @@ void XFileParser::ParseDataObjectMaterial( Material* pMaterial) { std::string matName; readHeadOfDataObject( &matName); + if( matName.empty()) + matName = std::string( "material") + boost::lexical_cast( mLineNumber); pMaterial->mName = matName; pMaterial->mIsReference = false; diff --git a/workspaces/vc9/assimp.vcproj b/workspaces/vc9/assimp.vcproj index 0c76d5a63..cd1525e9d 100644 --- a/workspaces/vc9/assimp.vcproj +++ b/workspaces/vc9/assimp.vcproj @@ -1,7 +1,7 @@ + +