Merge branch 'new-file-detection' of https://github.com/krishty/assimp into krishty-new-file-detection

This commit is contained in:
Kim Kulling
2022-01-16 20:41:24 +01:00
51 changed files with 273 additions and 669 deletions

View File

@@ -111,19 +111,9 @@ MDCImporter::~MDCImporter() {
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
bool MDCImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const {
const std::string extension = GetExtension(pFile);
if (extension == "mdc") {
return true;
}
// if check for extension is not enough, check for the magic tokens
if (!extension.length() || checkSig) {
uint32_t tokens[1];
tokens[0] = AI_MDC_MAGIC_NUMBER_LE;
return CheckMagicToken(pIOHandler, pFile, tokens, 1);
}
return false;
bool MDCImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
static const uint32_t tokens[] = { AI_MDC_MAGIC_NUMBER_LE };
return CheckMagicToken(pIOHandler, pFile, tokens, AI_COUNT_OF(tokens));
}
// ------------------------------------------------------------------------------------------------