Adding support for Unicode input files to most text file loaders (BVH and MD5 missing for now).
IrrXML receives memmapped UTF-8 input data now, it's own (faulty) conversion is not used anymore. aiString's are explicitly UTF-8 now. Slight refactorings and improvements. Adding UTF-8/UTF-16 text files for ASE,obj,collada,ac3d. These contain various japanese/chinese character sequences. Changing assimp_view's node view to display UTF-8 multibyte sequences correctly. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@469 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -117,8 +117,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
|
||||
boost::scoped_ptr<IOStream> file( pIOHandler->Open( path, "rb"));
|
||||
|
||||
// Check whether we can read from the file
|
||||
if( !file.get())
|
||||
{
|
||||
if( !file.get()) {
|
||||
DefaultLogger::get()->error("NFF2: Unable to open material library " + path + ".");
|
||||
return;
|
||||
}
|
||||
@@ -129,16 +128,14 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
|
||||
// allocate storage and copy the contents of the file to a memory buffer
|
||||
// (terminate it with zero)
|
||||
std::vector<char> mBuffer2(m+1);
|
||||
file->Read(&mBuffer2[0],m,1);
|
||||
TextFileToBuffer(file.get(),mBuffer2);
|
||||
const char* buffer = &mBuffer2[0];
|
||||
mBuffer2[m] = '\0';
|
||||
|
||||
// First of all: remove all comments from the file
|
||||
CommentRemover::RemoveLineComments("//",&mBuffer2[0]);
|
||||
|
||||
// The file should start with the magic sequence "mat"
|
||||
if (!TokenMatch(buffer,"mat",3))
|
||||
{
|
||||
if (!TokenMatch(buffer,"mat",3)) {
|
||||
DefaultLogger::get()->error("NFF2: Not a valid material library " + path + ".");
|
||||
return;
|
||||
}
|
||||
@@ -229,13 +226,11 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
||||
|
||||
// allocate storage and copy the contents of the file to a memory buffer
|
||||
// (terminate it with zero)
|
||||
std::vector<char> mBuffer2(m+1);
|
||||
file->Read(&mBuffer2[0],m,1);
|
||||
std::vector<char> mBuffer2;
|
||||
TextFileToBuffer(file.get(),mBuffer2);
|
||||
const char* buffer = &mBuffer2[0];
|
||||
mBuffer2[m] = '\0';
|
||||
|
||||
// mesh arrays - separate here to make the handling of
|
||||
// the pointers below easier.
|
||||
// mesh arrays - separate here to make the handling of the pointers below easier.
|
||||
std::vector<MeshInfo> meshes;
|
||||
std::vector<MeshInfo> meshesWithNormals;
|
||||
std::vector<MeshInfo> meshesWithUVCoords;
|
||||
|
||||
Reference in New Issue
Block a user