Ogre: Use explicit qualification for boost stuff to avoid potential tr1 conflicts with vc10. Thanks to Krishty to point it out. Use TinyFormatter instead of boost::format.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@721 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2010-05-10 21:06:44 +00:00
parent 255082c39b
commit 55bdc6db63
2 changed files with 17 additions and 12 deletions

View File

@ -50,7 +50,9 @@ using namespace std;
//#include "boost/format.hpp" //#include "boost/format.hpp"
//#include "boost/foreach.hpp" //#include "boost/foreach.hpp"
using namespace boost; //using namespace boost;
#include "TinyFormatter.h"
#include "OgreImporter.h" #include "OgreImporter.h"
#include "irrXMLWrapper.h" #include "irrXMLWrapper.h"
@ -113,7 +115,7 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass
//-------------------Read the submeshs and materials:----------------------- //-------------------Read the submeshs and materials:-----------------------
std::list<shared_ptr<SubMesh> > SubMeshes; std::list<boost::shared_ptr<SubMesh> > SubMeshes;
vector<aiMaterial*> Materials; vector<aiMaterial*> Materials;
XmlRead(MeshFile); XmlRead(MeshFile);
while(MeshFile->getNodeName()==string("submesh")) while(MeshFile->getNodeName()==string("submesh"))
@ -127,7 +129,7 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass
//so it is important to do this before pushing the mesh in the vector! //so it is important to do this before pushing the mesh in the vector!
theSubMesh->MaterialIndex=SubMeshes.size(); theSubMesh->MaterialIndex=SubMeshes.size();
SubMeshes.push_back(shared_ptr<SubMesh>(theSubMesh)); SubMeshes.push_back(boost::shared_ptr<SubMesh>(theSubMesh));
//Load the Material: //Load the Material:
aiMaterial* MeshMat=LoadMaterial(theSubMesh->MaterialName); aiMaterial* MeshMat=LoadMaterial(theSubMesh->MaterialName);
@ -170,7 +172,7 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass
//create the aiMehs... //create the aiMehs...
vector<aiMesh*> aiMeshes; vector<aiMesh*> aiMeshes;
BOOST_FOREACH(shared_ptr<SubMesh> theSubMesh, SubMeshes) BOOST_FOREACH(boost::shared_ptr<SubMesh> theSubMesh, SubMeshes)
{ {
aiMeshes.push_back(CreateAssimpSubMesh(*theSubMesh, Bones)); aiMeshes.push_back(CreateAssimpSubMesh(*theSubMesh, Bones));
} }
@ -318,8 +320,11 @@ void OgreImporter::ReadSubMesh(SubMesh &theSubMesh, XmlReader *Reader)
}//end of boneassignments }//end of boneassignments
} }
DefaultLogger::get()->debug(str(format("Positionen: %1% Normale: %2% TexCoords: %3%") DefaultLogger::get()->debug((Formatter::format(),
% theSubMesh.Positions.size() % theSubMesh.Normals.size() % theSubMesh.Uvs.size())); "Positionen: ",theSubMesh.Positions.size(),
" Normale: ",theSubMesh.Normals.size(),
" TexCoords: ",theSubMesh.Uvs.size()
));
DefaultLogger::get()->warn(Reader->getNodeName()); DefaultLogger::get()->warn(Reader->getNodeName());
@ -578,7 +583,7 @@ void OgreImporter::LoadSkeleton(std::string FileName, vector<Bone> &Bones, vecto
if(!IdsOk) if(!IdsOk)
throw DeadlyImportError("Bone Ids are not valid!"+FileName); throw DeadlyImportError("Bone Ids are not valid!"+FileName);
} }
DefaultLogger::get()->debug(str(format("Number of bones: %1%") % Bones.size())); DefaultLogger::get()->debug((Formatter::format(),"Number of bones: ",Bones.size()));
//________________________________________________________________________________ //________________________________________________________________________________

View File

@ -53,11 +53,11 @@ using namespace std;
//#include "boost/format.hpp" //#include "boost/format.hpp"
//#include "boost/foreach.hpp" //#include "boost/foreach.hpp"
using namespace boost; //using namespace boost;
#include "OgreImporter.h" #include "OgreImporter.h"
#include "irrXMLWrapper.h" #include "irrXMLWrapper.h"
#include "TinyFormatter.h"
namespace Assimp namespace Assimp
{ {
@ -100,8 +100,8 @@ aiMaterial* OgreImporter::LoadMaterial(const std::string MaterialName) const
*/ */
string MaterialFileName=m_CurrentFilename.substr(0, m_CurrentFilename.find('.'))+".material"; const string MaterialFileName=m_CurrentFilename.substr(0, m_CurrentFilename.find('.'))+".material";
DefaultLogger::get()->info(str(format("Trying to load %1%") % MaterialFileName)); DefaultLogger::get()->info("Trying to load " +MaterialFileName);
//Read the file into memory and put it in a stringstream //Read the file into memory and put it in a stringstream
stringstream ss; stringstream ss;
@ -116,7 +116,7 @@ aiMaterial* OgreImporter::LoadMaterial(const std::string MaterialName) const
return NewMaterial; return NewMaterial;
} }
} }
scoped_ptr<IOStream> MaterialFile(MatFilePtr); boost::scoped_ptr<IOStream> MaterialFile(MatFilePtr);
vector<char> FileData(MaterialFile->FileSize()); vector<char> FileData(MaterialFile->FileSize());
MaterialFile->Read(&FileData[0], MaterialFile->FileSize(), 1); MaterialFile->Read(&FileData[0], MaterialFile->FileSize(), 1);
BaseImporter::ConvertToUTF8(FileData); BaseImporter::ConvertToUTF8(FileData);