aboutsummaryrefslogtreecommitdiff
path: root/core/image.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2016-03-12 10:44:12 -0300
committerJuan Linietsky2016-03-12 10:46:38 -0300
commit8b1dcbfe4d92f9d7273bbd2f1eb805e5c508961a (patch)
tree77bd972e494e7deeef49bfa271c94d03ef2af749 /core/image.cpp
parentd85f06c42d54971af5da826581c75d1ed001475e (diff)
downloadgodot-8b1dcbfe4d92f9d7273bbd2f1eb805e5c508961a.tar.gz
godot-8b1dcbfe4d92f9d7273bbd2f1eb805e5c508961a.tar.zst
godot-8b1dcbfe4d92f9d7273bbd2f1eb805e5c508961a.zip
Diffstat (limited to 'core/image.cpp')
-rw-r--r--core/image.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/image.cpp b/core/image.cpp
index 184ab70dc..52946bbb8 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -2214,6 +2214,8 @@ void Image::blit_rect(const Image& p_src, const Rect2& p_src_rect,const Point2&
Image (*Image::_png_mem_loader_func)(const uint8_t*,int)=NULL;
+Image (*Image::_jpg_mem_loader_func)(const uint8_t*,int)=NULL;
+
void (*Image::_image_compress_bc_func)(Image *)=NULL;
void (*Image::_image_compress_pvrtc2_func)(Image *)=NULL;
void (*Image::_image_compress_pvrtc4_func)(Image *)=NULL;
@@ -2388,7 +2390,7 @@ String Image::get_format_name(Format p_format) {
return format_names[p_format];
}
-Image::Image(const uint8_t* p_png,int p_len) {
+Image::Image(const uint8_t* p_mem_png_jpg, int p_len) {
width=0;
height=0;
@@ -2396,8 +2398,13 @@ Image::Image(const uint8_t* p_png,int p_len) {
format=FORMAT_GRAYSCALE;
if (_png_mem_loader_func) {
- *this = _png_mem_loader_func(p_png,p_len);
+ *this = _png_mem_loader_func(p_mem_png_jpg,p_len);
+ }
+
+ if (empty() && _jpg_mem_loader_func) {
+ *this = _jpg_mem_loader_func(p_mem_png_jpg,p_len);
}
+
}
Image::Image() {