summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-26 21:59:07 +0200
committerGitHub <noreply@github.com>2019-08-26 21:59:07 +0200
commit6185976372af1dbab561853f2d91386d62c55e2c (patch)
tree809d21e69ffc84811090512538a6f6cc921d5bb2
parent1cea44de19215578e1fc54eb3d78d789032eb462 (diff)
parentc362527cb5eea651d1332d3891166526df69ec51 (diff)
Merge pull request #31681 from Xrayez/image-indexed-outdated
Modify outdated comments and error messages regarding indexed images
-rw-r--r--core/image.cpp12
-rw-r--r--core/image.h2
2 files changed, 6 insertions, 8 deletions
diff --git a/core/image.cpp b/core/image.cpp
index d8d667dbd5..900efb0eb0 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -863,7 +863,7 @@ bool Image::is_size_po2() const {
void Image::resize_to_po2(bool p_square) {
- ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot resize in indexed, compressed or custom image formats.");
+ ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot resize in compressed or custom image formats.");
int w = next_power_of_2(width);
int h = next_power_of_2(height);
@@ -881,7 +881,7 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) {
ERR_FAIL_COND_MSG(data.size() == 0, "Cannot resize image before creating it, use create() or create_from_data() first.");
- ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot resize in indexed, compressed or custom image formats.");
+ ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot resize in compressed or custom image formats.");
bool mipmap_aware = p_interpolation == INTERPOLATE_TRILINEAR /* || p_interpolation == INTERPOLATE_TRICUBIC */;
@@ -1094,7 +1094,7 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) {
void Image::crop_from_point(int p_x, int p_y, int p_width, int p_height) {
- ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot crop in indexed, compressed or custom image formats.");
+ ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot crop in compressed or custom image formats.");
ERR_FAIL_COND(p_x < 0);
ERR_FAIL_COND(p_y < 0);
@@ -1149,7 +1149,7 @@ void Image::crop(int p_width, int p_height) {
void Image::flip_y() {
- ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot flip_y in indexed, compressed or custom image formats.");
+ ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot flip_y in compressed or custom image formats.");
bool used_mipmaps = has_mipmaps();
if (used_mipmaps) {
@@ -1182,7 +1182,7 @@ void Image::flip_y() {
void Image::flip_x() {
- ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot flip_x in indexed, compressed or custom image formats.");
+ ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot flip_x in compressed or custom image formats.");
bool used_mipmaps = has_mipmaps();
if (used_mipmaps) {
@@ -1441,7 +1441,7 @@ void Image::normalize() {
Error Image::generate_mipmaps(bool p_renormalize) {
- ERR_FAIL_COND_V_MSG(!_can_modify(format), ERR_UNAVAILABLE, "Cannot generate mipmaps in indexed, compressed or custom image formats.");
+ ERR_FAIL_COND_V_MSG(!_can_modify(format), ERR_UNAVAILABLE, "Cannot generate mipmaps in compressed or custom image formats.");
ERR_FAIL_COND_V_MSG(width == 0 || height == 0, ERR_UNCONFIGURED, "Cannot generate mipmaps with width or height equal to 0.");
diff --git a/core/image.h b/core/image.h
index d17571399d..f29a30cda0 100644
--- a/core/image.h
+++ b/core/image.h
@@ -220,9 +220,7 @@ public:
/**
* Resize the image, using the preferred interpolation method.
- * Indexed-Color images always use INTERPOLATE_NEAREST.
*/
-
void resize_to_po2(bool p_square = false);
void resize(int p_width, int p_height, Interpolation p_interpolation = INTERPOLATE_BILINEAR);
void shrink_x2();