From 3205a92ad872f918c8322cdcd1434c231a1fd251 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 17 Feb 2020 18:06:54 -0300 Subject: PoolVector is gone, replaced by Vector Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector`. --- modules/jpg/image_loader_jpegd.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'modules/jpg') diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp index a1f0f0ef6a..9e87d11ac1 100644 --- a/modules/jpg/image_loader_jpegd.cpp +++ b/modules/jpg/image_loader_jpegd.cpp @@ -57,13 +57,13 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p const int dst_bpl = image_width * comps; - PoolVector data; + Vector data; data.resize(dst_bpl * image_height); - PoolVector::Write dw = data.write(); + uint8_t *dw = data.ptrw(); - jpgd::uint8 *pImage_data = (jpgd::uint8 *)dw.ptr(); + jpgd::uint8 *pImage_data = (jpgd::uint8 *)dw; for (int y = 0; y < image_height; y++) { const jpgd::uint8 *pScan_line; @@ -96,7 +96,6 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p else fmt = Image::FORMAT_RGB8; - dw.release(); p_image->create(image_width, image_height, 0, fmt, data); return OK; @@ -104,18 +103,18 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p Error ImageLoaderJPG::load_image(Ref p_image, FileAccess *f, bool p_force_linear, float p_scale) { - PoolVector src_image; + Vector src_image; int src_image_len = f->get_len(); ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); src_image.resize(src_image_len); - PoolVector::Write w = src_image.write(); + uint8_t *w = src_image.ptrw(); f->get_buffer(&w[0], src_image_len); f->close(); - Error err = jpeg_load_image_from_buffer(p_image.ptr(), w.ptr(), src_image_len); + Error err = jpeg_load_image_from_buffer(p_image.ptr(), w, src_image_len); return err; } -- cgit v1.2.3