Merge branch 'master' into fix_gltf_accessor_overflow

This commit is contained in:
Cory Fabre
2019-11-22 00:14:11 -06:00
committed by GitHub
181 changed files with 13459 additions and 2708 deletions
+3 -1
View File
@@ -350,7 +350,9 @@ void glTF2Exporter::GetMatTex(const aiMaterial* mat, Ref<Texture>& texture, aiTe
if (path[0] == '*') { // embedded
aiTexture* tex = mScene->mTextures[atoi(&path[1])];
uint8_t* data = reinterpret_cast<uint8_t*>(tex->pcData);
// copy data since lifetime control is handed over to the asset
uint8_t* data = new uint8_t[tex->mWidth];
memcpy(data, tex->pcData, tex->mWidth);
texture->source->SetData(data, tex->mWidth, *mAsset);
if (tex->achFormatHint[0]) {