summaryrefslogtreecommitdiff
path: root/scene/resources/bit_mask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/bit_mask.cpp')
-rw-r--r--scene/resources/bit_mask.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp
index b9b31ba32a..5763be2e08 100644
--- a/scene/resources/bit_mask.cpp
+++ b/scene/resources/bit_mask.cpp
@@ -45,8 +45,8 @@ void BitMap::create_from_image_alpha(const Image& p_image){
ERR_FAIL_COND(p_image.empty());
Image img=p_image;
- img.convert(Image::FORMAT_INTENSITY);
- ERR_FAIL_COND(img.get_format()!=Image::FORMAT_INTENSITY);
+ img.convert(Image::FORMAT_LA8);
+ ERR_FAIL_COND(img.get_format()!=Image::FORMAT_LA8);
create(Size2(img.get_width(),img.get_height()));
@@ -58,7 +58,7 @@ void BitMap::create_from_image_alpha(const Image& p_image){
int bbyte = i/8;
int bbit = i % 8;
- if (r[i])
+ if (r[i*2])
w[bbyte]|=(1<<bbit);
}
@@ -193,7 +193,6 @@ void BitMap::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_data"),_SCS("_get_data"));
-
}
BitMap::BitMap() {