diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-05 14:40:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-05 14:40:49 +0200 |
commit | 4011429e574a4d7a31725c38d92dd34925487dc7 (patch) | |
tree | b4d6e46d4c6f6b2b95cc9c551e0664d3ae5da9a7 /scene/resources | |
parent | bfc3ba5af0bd83c4a4f82192dffc9a0f9e7ea883 (diff) | |
parent | b16946dea6382100940ffb4b5bbd4cf1a1ff16ec (diff) |
Merge pull request #27683 from Xrayez/fix-bitmap-true-bit-count
Fix BitMap calculating incorrect true bit count
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/bit_map.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp index d2e4d28b44..55264bcdf9 100644 --- a/scene/resources/bit_map.cpp +++ b/scene/resources/bit_map.cpp @@ -96,7 +96,7 @@ int BitMap::get_true_bit_count() const { const uint8_t *d = bitmask.ptr(); int c = 0; - //fast, almot branchless version + //fast, almost branchless version for (int i = 0; i < ds; i++) { @@ -106,6 +106,7 @@ int BitMap::get_true_bit_count() const { c += (d[i] & (1 << 4)) >> 4; c += (d[i] & (1 << 3)) >> 3; c += (d[i] & (1 << 2)) >> 2; + c += (d[i] & (1 << 1)) >> 1; c += d[i] & 1; } |