diff options
author | kobewi <kobewi4e@gmail.com> | 2022-07-22 20:06:19 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-10-14 14:34:15 +0200 |
commit | 072f6feabac70a6c4ed1a16f4e983bf31ad62d50 (patch) | |
tree | 6df3f7297a4af9799c1f6bc88e5c633235246362 /tests | |
parent | 39534a7aecc4ca4215af67244b23dda09ea339f8 (diff) |
Make some Image methods static
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scene/test_bit_map.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/scene/test_bit_map.h b/tests/scene/test_bit_map.h index 635449181e..a102f40725 100644 --- a/tests/scene/test_bit_map.h +++ b/tests/scene/test_bit_map.h @@ -76,15 +76,11 @@ TEST_CASE("[BitMap] Create bit map from image alpha") { bit_map.create_from_image_alpha(empty_img); CHECK_MESSAGE(bit_map.get_size() == Size2i(256, 256), "Bitmap should have its old values because bitmap creation from an empty image should fail."); - Ref<Image> wrong_format_img; - wrong_format_img.instantiate(); - wrong_format_img->create(3, 3, false, Image::Format::FORMAT_DXT1); + Ref<Image> wrong_format_img = Image::create_empty(3, 3, false, Image::Format::FORMAT_DXT1); bit_map.create_from_image_alpha(wrong_format_img); CHECK_MESSAGE(bit_map.get_size() == Size2i(256, 256), "Bitmap should have its old values because converting from a compressed image should fail."); - Ref<Image> img; - img.instantiate(); - img->create(3, 3, false, Image::Format::FORMAT_RGBA8); + Ref<Image> img = Image::create_empty(3, 3, false, Image::Format::FORMAT_RGBA8); img->set_pixel(0, 0, Color(0, 0, 0, 0)); img->set_pixel(0, 1, Color(0, 0, 0, 0.09f)); img->set_pixel(0, 2, Color(0, 0, 0, 0.25f)); |