From 2875de132f3a402100785f12582a9337c3a66cd6 Mon Sep 17 00:00:00 2001 From: Marco Feuerstein Date: Thu, 29 Jun 2023 08:17:08 +0200 Subject: [PATCH] Fix compilation on windows. --- code/AssetLib/glTF/glTFImporter.cpp | 10 ++++++++-- code/AssetLib/glTF2/glTF2Importer.cpp | 12 +++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/code/AssetLib/glTF/glTFImporter.cpp b/code/AssetLib/glTF/glTFImporter.cpp index 27dd1f0e9..110a2a52f 100644 --- a/code/AssetLib/glTF/glTFImporter.cpp +++ b/code/AssetLib/glTF/glTFImporter.cpp @@ -93,7 +93,10 @@ const aiImporterDesc *glTFImporter::GetInfo() const { bool glTFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /* checkSig */) const { glTF::Asset asset(pIOHandler); try { - asset.Load(pFile, CheckMagicToken(pIOHandler, pFile, AI_GLB_MAGIC_NUMBER, 1, 0, strlen(AI_GLB_MAGIC_NUMBER))); + asset.Load(pFile, + CheckMagicToken( + pIOHandler, pFile, AI_GLB_MAGIC_NUMBER, 1, 0, + static_cast(strlen(AI_GLB_MAGIC_NUMBER)))); return asset.asset; } catch (...) { return false; @@ -697,7 +700,10 @@ void glTFImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOS // read the asset file glTF::Asset asset(pIOHandler); - asset.Load(pFile, CheckMagicToken(pIOHandler, pFile, AI_GLB_MAGIC_NUMBER, 1, 0, strlen(AI_GLB_MAGIC_NUMBER))); + asset.Load(pFile, + CheckMagicToken( + pIOHandler, pFile, AI_GLB_MAGIC_NUMBER, 1, 0, + static_cast(strlen(AI_GLB_MAGIC_NUMBER)))); // // Copy the data out diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index e5058bd4b..86fd0ab7e 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -112,8 +112,11 @@ bool glTF2Importer::CanRead(const std::string &filename, IOSystem *pIOHandler, b if (pIOHandler) { glTF2::Asset asset(pIOHandler); - return asset.CanRead(filename, CheckMagicToken(pIOHandler, filename, AI_GLB_MAGIC_NUMBER, - 1, 0, strlen(AI_GLB_MAGIC_NUMBER))); + return asset.CanRead( + filename, + CheckMagicToken( + pIOHandler, filename, AI_GLB_MAGIC_NUMBER, 1, 0, + static_cast(strlen(AI_GLB_MAGIC_NUMBER)))); } return false; @@ -1679,7 +1682,10 @@ void glTF2Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IO // read the asset file glTF2::Asset asset(pIOHandler, static_cast(mSchemaDocumentProvider)); - asset.Load(pFile, CheckMagicToken(pIOHandler, pFile, AI_GLB_MAGIC_NUMBER, 1, 0, strlen(AI_GLB_MAGIC_NUMBER))); + asset.Load(pFile, + CheckMagicToken( + pIOHandler, pFile, AI_GLB_MAGIC_NUMBER, 1, 0, + static_cast(strlen(AI_GLB_MAGIC_NUMBER)))); if (asset.scene) { pScene->mName = asset.scene->name; }