------------------------------------------------------------------------------------------------
| 409 | |
| 410 | // ------------------------------------------------------------------------------------------------ |
| 411 | static void appendNewMeshesToScene(aiScene *pScene, std::vector<aiMesh*> &apcOutMeshes) { |
| 412 | ai_assert(pScene != nullptr); |
| 413 | |
| 414 | if (apcOutMeshes.empty()) { |
| 415 | return; |
| 416 | } |
| 417 | |
| 418 | aiMesh **npp = new aiMesh *[pScene->mNumMeshes + apcOutMeshes.size()]; |
| 419 | |
| 420 | ::memcpy(npp, pScene->mMeshes, sizeof(aiMesh *) * pScene->mNumMeshes); |
| 421 | ::memcpy(npp + pScene->mNumMeshes, &apcOutMeshes[0], sizeof(aiMesh *) * apcOutMeshes.size()); |
| 422 | |
| 423 | pScene->mNumMeshes += static_cast<unsigned int>(apcOutMeshes.size()); |
| 424 | delete[] pScene->mMeshes; |
| 425 | pScene->mMeshes = npp; |
| 426 | } |
| 427 | |
| 428 | // ------------------------------------------------------------------------------------------------ |
| 429 | // Executes the post processing step on the given imported data. |