diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-02-18 11:27:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-18 11:27:04 +0100 |
commit | ef5891091bceef2800b4fae4cd85af219e791467 (patch) | |
tree | 8d58cca8cae2c34d408450cfb5ceb198543147b7 /modules/squish | |
parent | c7faf2e16b684f3dd0246dbdb662b1826dd24571 (diff) | |
parent | 3205a92ad872f918c8322cdcd1434c231a1fd251 (diff) |
Merge pull request #36311 from reduz/poolvector-deprecation
Convert all references and instances of PoolVector to Vector
Diffstat (limited to 'modules/squish')
-rw-r--r-- | modules/squish/image_compress_squish.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index 2f680fd3d0..bb77f68590 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -37,13 +37,13 @@ void image_decompress_squish(Image *p_image) { int h = p_image->get_height(); Image::Format target_format = Image::FORMAT_RGBA8; - PoolVector<uint8_t> data; + Vector<uint8_t> data; int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps()); int mm_count = p_image->get_mipmap_count(); data.resize(target_size); - PoolVector<uint8_t>::Read rb = p_image->get_data().read(); - PoolVector<uint8_t>::Write wb = data.write(); + const uint8_t *rb = p_image->get_data().ptr(); + uint8_t *wb = data.ptrw(); int squish_flags = Image::FORMAT_MAX; if (p_image->get_format() == Image::FORMAT_DXT1) { @@ -137,14 +137,14 @@ void image_compress_squish(Image *p_image, float p_lossy_quality, Image::UsedCha } } - PoolVector<uint8_t> data; + Vector<uint8_t> data; int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps()); int mm_count = p_image->has_mipmaps() ? Image::get_image_required_mipmaps(w, h, target_format) : 0; data.resize(target_size); int shift = Image::get_format_pixel_rshift(target_format); - PoolVector<uint8_t>::Read rb = p_image->get_data().read(); - PoolVector<uint8_t>::Write wb = data.write(); + const uint8_t *rb = p_image->get_data().ptr(); + uint8_t *wb = data.ptrw(); int dst_ofs = 0; @@ -160,9 +160,6 @@ void image_compress_squish(Image *p_image, float p_lossy_quality, Image::UsedCha h = MAX(h / 2, 1); } - rb.release(); - wb.release(); - p_image->create(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data); } } |