summaryrefslogtreecommitdiff
path: root/core/image.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-05-31 01:59:42 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-05-31 02:00:18 -0300
commitd5348eebdc7228f7836582cd9bd4ed4f5fd59348 (patch)
treef4ba57671543fcdb588026733321bab845c9f500 /core/image.cpp
parentf62961aba3d9e11d4741649a591217796151a46c (diff)
work in progress, resource previews
Diffstat (limited to 'core/image.cpp')
-rw-r--r--core/image.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/image.cpp b/core/image.cpp
index 04b3905489..b516790494 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -1746,6 +1746,10 @@ Error Image::_decompress_bc() {
return OK;
}
+bool Image::is_compressed() const {
+ return format>=FORMAT_BC1;
+}
+
Image Image::decompressed() const {
@@ -1998,7 +2002,7 @@ void Image::blit_rect(const Image& p_src, const Rect2& p_src_rect,const Point2&
}
-Image (*Image::_png_mem_loader_func)(const uint8_t*)=NULL;
+Image (*Image::_png_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;
@@ -2167,7 +2171,7 @@ void Image::fix_alpha_edges() {
}
-Image::Image(const uint8_t* p_png) {
+Image::Image(const uint8_t* p_png,int p_len) {
width=0;
height=0;
@@ -2175,7 +2179,7 @@ Image::Image(const uint8_t* p_png) {
format=FORMAT_GRAYSCALE;
if (_png_mem_loader_func) {
- *this = _png_mem_loader_func(p_png);
+ *this = _png_mem_loader_func(p_png,p_len);
}
}