summaryrefslogtreecommitdiff
path: root/core/image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/image.cpp')
-rw-r--r--core/image.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/image.cpp b/core/image.cpp
index 50dc9c109d..a4864458b5 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -676,8 +676,8 @@ void Image::resize_to_po2(bool p_square) {
ERR_FAIL();
}
- int w = nearest_power_of_2(width);
- int h = nearest_power_of_2(height);
+ int w = next_power_of_2(width);
+ int h = next_power_of_2(height);
if (w == width && h == height) {
@@ -1060,7 +1060,7 @@ Error Image::generate_mipmaps() {
PoolVector<uint8_t>::Write wp = data.write();
- if (nearest_power_of_2(width) == uint32_t(width) && nearest_power_of_2(height) == uint32_t(height)) {
+ if (next_power_of_2(width) == uint32_t(width) && next_power_of_2(height) == uint32_t(height)) {
//use fast code for powers of 2
int prev_ofs = 0;
int prev_h = height;
@@ -2254,16 +2254,16 @@ void Image::_bind_methods() {
ClassDB::bind_method(D_METHOD("srgb_to_linear"), &Image::srgb_to_linear);
ClassDB::bind_method(D_METHOD("normalmap_to_xy"), &Image::normalmap_to_xy);
- ClassDB::bind_method(D_METHOD("blit_rect", "src:Image", "src_rect", "dst"), &Image::blit_rect);
- ClassDB::bind_method(D_METHOD("blit_rect_mask", "src:Image", "mask:Image", "src_rect", "dst"), &Image::blit_rect_mask);
- ClassDB::bind_method(D_METHOD("blend_rect", "src:Image", "src_rect", "dst"), &Image::blend_rect);
- ClassDB::bind_method(D_METHOD("blend_rect_mask", "src:Image", "mask:Image", "src_rect", "dst"), &Image::blend_rect_mask);
+ ClassDB::bind_method(D_METHOD("blit_rect", "src", "src_rect", "dst"), &Image::blit_rect);
+ ClassDB::bind_method(D_METHOD("blit_rect_mask", "src", "mask", "src_rect", "dst"), &Image::blit_rect_mask);
+ ClassDB::bind_method(D_METHOD("blend_rect", "src", "src_rect", "dst"), &Image::blend_rect);
+ ClassDB::bind_method(D_METHOD("blend_rect_mask", "src", "mask", "src_rect", "dst"), &Image::blend_rect_mask);
ClassDB::bind_method(D_METHOD("fill", "color"), &Image::fill);
ClassDB::bind_method(D_METHOD("get_used_rect"), &Image::get_used_rect);
- ClassDB::bind_method(D_METHOD("get_rect:Image", "rect"), &Image::get_rect);
+ ClassDB::bind_method(D_METHOD("get_rect", "rect"), &Image::get_rect);
- ClassDB::bind_method(D_METHOD("copy_from", "src:Image"), &Image::copy_internals_from);
+ ClassDB::bind_method(D_METHOD("copy_from", "src"), &Image::copy_internals_from);
ClassDB::bind_method(D_METHOD("_set_data", "data"), &Image::_set_data);
ClassDB::bind_method(D_METHOD("_get_data"), &Image::_get_data);