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/jpg/image_loader_jpegd.cpp | |
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/jpg/image_loader_jpegd.cpp')
-rw-r--r-- | modules/jpg/image_loader_jpegd.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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<uint8_t> data; + Vector<uint8_t> data; data.resize(dst_bpl * image_height); - PoolVector<uint8_t>::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<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) { - PoolVector<uint8_t> src_image; + Vector<uint8_t> 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<uint8_t>::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; } |