diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/image.cpp | 6 | ||||
-rw-r--r-- | core/image.h | 4 | ||||
-rw-r--r-- | core/math/vector2.cpp | 2 | ||||
-rw-r--r-- | core/math/vector3.h | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/core/image.cpp b/core/image.cpp index 0995940ae2..7778169995 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -1783,7 +1783,7 @@ Error Image::compress(CompressMode p_mode, CompressSource p_source, float p_loss case COMPRESS_S3TC: { ERR_FAIL_COND_V(!_image_compress_bc_func, ERR_UNAVAILABLE); - _image_compress_bc_func(this, p_source); + _image_compress_bc_func(this, p_lossy_quality, p_source); } break; case COMPRESS_PVRTC2: { @@ -2146,7 +2146,7 @@ ImageMemLoadFunc Image::_png_mem_loader_func = NULL; ImageMemLoadFunc Image::_jpg_mem_loader_func = NULL; ImageMemLoadFunc Image::_webp_mem_loader_func = NULL; -void (*Image::_image_compress_bc_func)(Image *, Image::CompressSource) = NULL; +void (*Image::_image_compress_bc_func)(Image *, float, Image::CompressSource) = NULL; void (*Image::_image_compress_bptc_func)(Image *, float, Image::CompressSource) = NULL; void (*Image::_image_compress_pvrtc2_func)(Image *) = NULL; void (*Image::_image_compress_pvrtc4_func)(Image *) = NULL; @@ -2667,7 +2667,7 @@ void Image::_bind_methods() { BIND_ENUM_CONSTANT(COMPRESS_SOURCE_NORMAL); } -void Image::set_compress_bc_func(void (*p_compress_func)(Image *, CompressSource)) { +void Image::set_compress_bc_func(void (*p_compress_func)(Image *, float, CompressSource)) { _image_compress_bc_func = p_compress_func; } diff --git a/core/image.h b/core/image.h index 854096b773..6af55ca8d9 100644 --- a/core/image.h +++ b/core/image.h @@ -126,7 +126,7 @@ public: static ImageMemLoadFunc _jpg_mem_loader_func; static ImageMemLoadFunc _webp_mem_loader_func; - static void (*_image_compress_bc_func)(Image *, CompressSource p_source); + static void (*_image_compress_bc_func)(Image *, float, CompressSource p_source); static void (*_image_compress_bptc_func)(Image *, float p_lossy_quality, CompressSource p_source); static void (*_image_compress_pvrtc2_func)(Image *); static void (*_image_compress_pvrtc4_func)(Image *); @@ -316,7 +316,7 @@ public: Rect2 get_used_rect() const; Ref<Image> get_rect(const Rect2 &p_area) const; - static void set_compress_bc_func(void (*p_compress_func)(Image *, CompressSource)); + static void set_compress_bc_func(void (*p_compress_func)(Image *, float, CompressSource)); static void set_compress_bptc_func(void (*p_compress_func)(Image *, float, CompressSource)); static String get_format_name(Format p_format); diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index 75d9b8b311..84c9f0fca6 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -122,7 +122,7 @@ Vector2 Vector2::rotated(real_t p_by) const { } Vector2 Vector2::project(const Vector2 &p_b) const { - return p_b * (dot(p_b) / p_b.dot(p_b)); + return p_b * (dot(p_b) / p_b.length_squared()); } Vector2 Vector2::snapped(const Vector2 &p_by) const { diff --git a/core/math/vector3.h b/core/math/vector3.h index a719e3965d..5f0e8919ff 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -241,7 +241,7 @@ real_t Vector3::distance_squared_to(const Vector3 &p_b) const { } Vector3 Vector3::project(const Vector3 &p_b) const { - return p_b * (dot(p_b) / p_b.dot(p_b)); + return p_b * (dot(p_b) / p_b.length_squared()); } real_t Vector3::angle_to(const Vector3 &p_b) const { |