summaryrefslogtreecommitdiff
path: root/core/image.cpp
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-07-01 12:59:42 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-07-01 12:59:42 +0200
commit3c154eb93b3a098354bf6d18a9428826ec193f90 (patch)
treed9c8c44f13883ceadaefc95953f9cb077137b7c8 /core/image.cpp
parenteaaff9da3178fa515a0f051fda932c1dd04d53db (diff)
Remove unnecessary code and add some error explanations
Diffstat (limited to 'core/image.cpp')
-rw-r--r--core/image.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/image.cpp b/core/image.cpp
index dd8f2b9bac..4da8f27e5f 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -1464,7 +1464,10 @@ Error Image::generate_mipmaps(bool p_renormalize) {
ERR_FAIL_V(ERR_UNAVAILABLE);
}
- ERR_FAIL_COND_V(width == 0 || height == 0, ERR_UNCONFIGURED);
+ if (width == 0 || height == 0) {
+ ERR_EXPLAIN("Cannot generate mipmaps with width or height equal to 0.");
+ ERR_FAIL_V(ERR_UNCONFIGURED);
+ }
int mmcount;
@@ -2532,7 +2535,7 @@ Color Image::get_pixel(int p_x, int p_y) const {
}
void Image::set_pixelv(const Point2 &p_dst, const Color &p_color) {
- return set_pixel(p_dst.x, p_dst.y, p_color);
+ set_pixel(p_dst.x, p_dst.y, p_color);
}
void Image::set_pixel(int p_x, int p_y, const Color &p_color) {