summaryrefslogtreecommitdiff
path: root/scene/resources/bit_map.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-07-22 20:06:19 +0200
committerkobewi <kobewi4e@gmail.com>2022-10-14 14:34:15 +0200
commit072f6feabac70a6c4ed1a16f4e983bf31ad62d50 (patch)
tree6df3f7297a4af9799c1f6bc88e5c633235246362 /scene/resources/bit_map.cpp
parent39534a7aecc4ca4215af67244b23dda09ea339f8 (diff)
Make some Image methods static
Diffstat (limited to 'scene/resources/bit_map.cpp')
-rw-r--r--scene/resources/bit_map.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp
index 0505f6b559..1b06e09bb8 100644
--- a/scene/resources/bit_map.cpp
+++ b/scene/resources/bit_map.cpp
@@ -639,9 +639,7 @@ void BitMap::resize(const Size2i &p_new_size) {
}
Ref<Image> BitMap::convert_to_image() const {
- Ref<Image> image;
- image.instantiate();
- image->create(width, height, false, Image::FORMAT_L8);
+ Ref<Image> image = Image::create_empty(width, height, false, Image::FORMAT_L8);
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {