diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/image.cpp | 12 | ||||
-rw-r--r-- | core/image.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/core/image.cpp b/core/image.cpp index 17ee569b6b..ea09787f01 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -134,6 +134,18 @@ void Image::get_mipmap_offset_and_size(int p_mipmap,int &r_ofs, int &r_size) con } +void Image::get_mipmap_offset_size_and_dimensions(int p_mipmap,int &r_ofs, int &r_size,int &w, int& h) const { + + + int ofs; + _get_mipmap_offset_and_size(p_mipmap,ofs,w,h); + int ofs2,w2,h2; + _get_mipmap_offset_and_size(p_mipmap+1,ofs2,w2,h2); + r_ofs=ofs; + r_size=ofs2-ofs; + +} + void Image::put_pixel(int p_x,int p_y, const Color& p_color,int p_mipmap){ ERR_FAIL_INDEX(p_mipmap,mipmaps+1); diff --git a/core/image.h b/core/image.h index f4c96703b9..8ef7a54c78 100644 --- a/core/image.h +++ b/core/image.h @@ -236,6 +236,7 @@ public: int get_mipmap_offset(int p_mipmap) const; //get where the mipmap begins in data void get_mipmap_offset_and_size(int p_mipmap,int &r_ofs, int &r_size) const; //get where the mipmap begins in data + void get_mipmap_offset_size_and_dimensions(int p_mipmap,int &r_ofs, int &r_size,int &w, int& h) const; //get where the mipmap begins in data /** * Resize the image, using the prefered interpolation method. |