diff options
author | Juan Linietsky <juan@godotengine.org> | 2020-02-17 18:06:54 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-18 10:10:36 +0100 |
commit | 3205a92ad872f918c8322cdcd1434c231a1fd251 (patch) | |
tree | db44242ca27432eb8ea849679752d0835d2ae41a /modules/squish | |
parent | fb8c93c10b4b73d5f18f1ed287497728800e22b5 (diff) |
PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
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); } } |