Fixed inverted embedded image dumping

This commit is contained in:
antopilo
2025-02-08 18:37:48 -05:00
parent cede05a309
commit 151d0be0f1

View File

@@ -332,6 +332,7 @@ std::string GLTFBaker::ProcessTextures(const aiScene* scene, const std::string&
if (data)
{
stbi_flip_vertically_on_write(true);
stbi_write_png(pngPath.c_str(), width, height, 4, data, width * 4);
stbi_image_free(data);
}
@@ -343,6 +344,7 @@ std::string GLTFBaker::ProcessTextures(const aiScene* scene, const std::string&
}
else
{
stbi_flip_vertically_on_write(true);
stbi_write_png(pngPath.c_str(), aitexture->mWidth, aitexture->mHeight, 4, aitexture->pcData, aitexture->mWidth * 4);
}