summaryrefslogtreecommitdiff
path: root/modules/jpg
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2020-02-17 18:06:54 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-18 10:10:36 +0100
commit3205a92ad872f918c8322cdcd1434c231a1fd251 (patch)
treedb44242ca27432eb8ea849679752d0835d2ae41a /modules/jpg
parentfb8c93c10b4b73d5f18f1ed287497728800e22b5 (diff)
PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
Diffstat (limited to 'modules/jpg')
-rw-r--r--modules/jpg/image_loader_jpegd.cpp13
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;
}