From 9f1a70d50cbbdaa2058750c210ed58f7405082f3 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 17 Jun 2024 13:05:09 +0200 Subject: [PATCH] Add missing renames --- code/Common/SceneCombiner.cpp | 2 +- tools/assimp_view/Display.cpp | 19 +++++++++---------- tools/assimp_view/Material.cpp | 6 +++--- tools/assimp_view/MessageProc.cpp | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/code/Common/SceneCombiner.cpp b/code/Common/SceneCombiner.cpp index a7b2e372f..7954d4d01 100644 --- a/code/Common/SceneCombiner.cpp +++ b/code/Common/SceneCombiner.cpp @@ -408,7 +408,7 @@ void SceneCombiner::MergeScenes(aiScene **_dest, aiScene *master, std::vectormData. The size of mData is not guaranteed to be - // MAXLEN in size. + // AI_MAXLEN in size. aiString s(*(aiString *)prop->mData); if ('*' == s.data[0]) { // Offset the index and write it back .. diff --git a/tools/assimp_view/Display.cpp b/tools/assimp_view/Display.cpp index 7e740549c..a542cddac 100644 --- a/tools/assimp_view/Display.cpp +++ b/tools/assimp_view/Display.cpp @@ -174,7 +174,7 @@ int CDisplay::AddNodeToDisplayList( ai_assert(nullptr != pcNode); ai_assert(nullptr != hRoot); - char chTemp[MAXLEN]; + char chTemp[AI_MAXLEN]; if(0 == pcNode->mName.length) { if (iIndex >= 100) { @@ -186,12 +186,12 @@ int CDisplay::AddNodeToDisplayList( } else iIndex += iDepth * 10; - ai_snprintf(chTemp, MAXLEN,"Node %u",iIndex); + ai_snprintf(chTemp,AI_MAXLEN,"Node %u",iIndex); } else { - ai_snprintf(chTemp, MAXLEN,"%s",pcNode->mName.data); + ai_snprintf(chTemp, AI_MAXLEN, "%s", pcNode->mName.data); } - ai_snprintf(chTemp+strlen(chTemp), MAXLEN- strlen(chTemp), iIndex ? " (%i)" : " (%i meshes)",pcNode->mNumMeshes); + ai_snprintf(chTemp + strlen(chTemp), AI_MAXLEN - strlen(chTemp), iIndex ? " (%i)" : " (%i meshes)", pcNode->mNumMeshes); TVITEMEXW tvi; TVINSERTSTRUCTW sNew; @@ -236,15 +236,15 @@ int CDisplay::AddMeshToDisplayList(unsigned int iIndex, HTREEITEM hRoot) { aiMesh* pcMesh = g_pcAsset->pcScene->mMeshes[iIndex]; - char chTemp[MAXLEN]; + char chTemp[AI_MAXLEN]; if(0 == pcMesh->mName.length) { - ai_snprintf(chTemp,MAXLEN,"Mesh %u",iIndex); + ai_snprintf(chTemp, AI_MAXLEN, "Mesh %u", iIndex); } else { - ai_snprintf(chTemp,MAXLEN,"%s",pcMesh->mName.data); + ai_snprintf(chTemp, AI_MAXLEN, "%s", pcMesh->mName.data); } - ai_snprintf(chTemp+strlen(chTemp),MAXLEN-strlen(chTemp), iIndex ? " (%i)" : " (%i faces)",pcMesh->mNumFaces); + ai_snprintf(chTemp + strlen(chTemp), AI_MAXLEN - strlen(chTemp), iIndex ? " (%i)" : " (%i faces)", pcMesh->mNumFaces); TVITEMEXW tvi; TVINSERTSTRUCTW sNew; @@ -280,8 +280,7 @@ int CDisplay::AddMeshToDisplayList(unsigned int iIndex, HTREEITEM hRoot) //------------------------------------------------------------------------------- // Replace the currently selected texture by another one -int CDisplay::ReplaceCurrentTexture(const char* szPath) -{ +int CDisplay::ReplaceCurrentTexture(const char* szPath) { ai_assert(nullptr != szPath); // well ... try to load it diff --git a/tools/assimp_view/Material.cpp b/tools/assimp_view/Material.cpp index 2337f13fa..f5cfce8c6 100644 --- a/tools/assimp_view/Material.cpp +++ b/tools/assimp_view/Material.cpp @@ -281,7 +281,7 @@ bool CMaterialManager::TryLongerPath(char* szTemp,aiString* p_szString) // copy the result string back to the aiString const size_t iLen = strlen(szTempB); size_t iLen2 = iLen+1; - iLen2 = iLen2 > MAXLEN ? MAXLEN : iLen2; + iLen2 = iLen2 > AI_MAXLEN ? AI_MAXLEN : iLen2; memcpy(p_szString->data,szTempB,iLen2); p_szString->length = static_cast(iLen); return true; @@ -295,7 +295,7 @@ bool CMaterialManager::TryLongerPath(char* szTemp,aiString* p_szString) // copy the result string back to the aiString const size_t iLen = strlen(szTempB); size_t iLen2 = iLen+1; - iLen2 = iLen2 > MAXLEN ? MAXLEN : iLen2; + iLen2 = iLen2 > AI_MAXLEN ? AI_MAXLEN : iLen2; memcpy(p_szString->data,szTempB,iLen2); p_szString->length = static_cast(iLen); return true; @@ -402,7 +402,7 @@ int CMaterialManager::FindValidPath(aiString* p_szString) // copy the result string back to the aiStr const size_t len = strlen(szTemp); size_t len2 = len+1; - len2 = len2 > MAXLEN ? MAXLEN : len2; + len2 = len2 > AI_MAXLEN ? AI_MAXLEN : len2; memcpy(p_szString->data, szTemp, len2); p_szString->length = static_cast(len); } diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index 230d295fc..a21b559dd 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -842,7 +842,7 @@ void OpenAsset() { aiString sz; aiGetExtensionList(&sz); - char szList[MAXLEN + 100]; + char szList[AI_MAXLEN + 100]; strcpy(szList,"ASSIMP assets"); char* szCur = szList + 14; strcpy(szCur,sz.data);