TextureMerger's set_textures will now clean up textures in the packer properly.

This commit is contained in:
Relintai 2019-10-23 16:03:59 +02:00
parent 7804575cf6
commit 4bdea3cc56

View File

@ -57,6 +57,10 @@ Vector<Variant> TextureMerger::get_textures() {
return r; return r;
} }
void TextureMerger::set_textures(const Vector<Variant> &textures) { void TextureMerger::set_textures(const Vector<Variant> &textures) {
for (int i = 0; i < _textures.size(); ++i) {
_packer->unref_texture(_textures[i]);
}
_textures.clear(); _textures.clear();
_textures.resize(textures.size()); _textures.resize(textures.size());