Removed aiProcess_FindDegenerates from the viewer. The step seems to cause some problems that have not yet been solved.

Added irrmesh (Irrlicht Mesh Format) loader to Assimp. Works quite stable, but no lightmapping support yet.
Removed tinyxml, replaced it with irrxml instead. Added an IOStreamToIrrXML wrapper.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@194 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2008-10-24 20:37:54 +00:00
parent 44ea300651
commit ce6ce098e9
46 changed files with 4126 additions and 9756 deletions

View File

@@ -97,5 +97,46 @@ void BaseImporter::SetupProperties(const Importer* pImp)
// the default implementation does nothing
}
// ------------------------------------------------------------------------------------------------
bool BaseImporter::SearchFileHeaderForToken(IOSystem* pIOHandler,
const std::string& pFile,
const char** tokens,
unsigned int numTokens,
unsigned int searchBytes /* = 200 */)
{
ai_assert(NULL != tokens && 0 != numTokens && NULL != pIOHandler && 0 != searchBytes);
boost::scoped_ptr<IOStream> pStream (pIOHandler->Open(pFile));
if (pStream.get() )
{
// read 200 characters from the file
boost::scoped_ptr<char> _buffer (new char[searchBytes]);
char* buffer = _buffer.get();
unsigned int read = (unsigned int)pStream->Read(buffer,1,searchBytes);
if (!read)return false;
for (unsigned int i = 0; i < read;++i)
buffer[i] = ::tolower(buffer[i]);
// It is not a proper handling of unicode files here ...
// ehm ... but it works in most cases.
char* cur = buffer,*cur2 = buffer,*end = &buffer[read];
while (cur != end)
{
if (*cur)*cur2++ = *cur;
++cur;
}
*cur2 = '\0';
for (unsigned int i = 0; i < numTokens;++i)
{
ai_assert(NULL != tokens[i]);
if (::strstr(buffer,tokens[i]))return true;
}
}
return false;
}