mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Fix BitMap calculating incorrect true bit count
(cherry picked from commit b16946dea6)
This commit is contained in:
committed by
Rémi Verschelde
parent
67dc8cf252
commit
948562261d
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user