mirror of
https://github.com/Relintai/texture_packer.git
synced 2024-11-12 10:15:16 +01:00
The bins vector is not a class member anymore, it's really unsafe to store it like that without proper updates. Also unnecessary.
This commit is contained in:
parent
37043e7b2d
commit
87a80781a0
@ -181,8 +181,6 @@ int TexturePacker::get_texture_count() {
|
||||
}
|
||||
|
||||
void TexturePacker::clear() {
|
||||
_bins.clear();
|
||||
|
||||
for (int i = 0; i < _rects.size(); ++i) {
|
||||
rect_xywhf *r = _rects.get(i);
|
||||
|
||||
@ -211,15 +209,15 @@ int TexturePacker::get_generated_texture_count() {
|
||||
}
|
||||
|
||||
void TexturePacker::merge() {
|
||||
_bins.clear();
|
||||
std::vector<bin> bins;
|
||||
|
||||
if (pack(_rects.ptr(), _rects.size(), _max_atlas_size, false, _bins)) {
|
||||
if (pack(_rects.ptr(), _rects.size(), _max_atlas_size, false, bins)) {
|
||||
_generated_textures.clear();
|
||||
|
||||
_generated_textures.resize(_bins.size());
|
||||
_generated_textures.resize(bins.size());
|
||||
|
||||
for (int i = 0; i < _bins.size(); ++i) {
|
||||
bin b = _bins[i];
|
||||
for (int i = 0; i < bins.size(); ++i) {
|
||||
bin b = bins[i];
|
||||
|
||||
PoolByteArray data;
|
||||
data.resize(b.size.w * b.size.h * 4);
|
||||
|
@ -51,8 +51,6 @@ private:
|
||||
int _max_atlas_size;
|
||||
bool _keep_original_atlases;
|
||||
|
||||
std::vector<bin> _bins;
|
||||
|
||||
Vector<rect_xywhf *> _rects;
|
||||
Vector<Ref<ImageTexture> > _generated_textures;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user