mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix more odd cases
This commit is contained in:
parent
9857a9a24e
commit
33722a16c1
@ -455,7 +455,7 @@ get_next_higher_different_bit(int low_bit) const {
|
||||
return low_bit;
|
||||
}
|
||||
int b2 = _array[w].get_next_higher_different_bit(b);
|
||||
if (b2 != b) {
|
||||
if (b2 != b && b2 < num_bits_per_word) {
|
||||
// The next higher bit is within the same word.
|
||||
return w * num_bits_per_word + b2;
|
||||
}
|
||||
@ -467,7 +467,9 @@ get_next_higher_different_bit(int low_bit) const {
|
||||
++w2;
|
||||
}
|
||||
if (w2 >= num_words) {
|
||||
return low_bit;
|
||||
// All bits higher are the same value.
|
||||
int is_on = _array[w].get_bit(b);
|
||||
return is_on ? (num_words * num_bits_per_word) : low_bit;
|
||||
}
|
||||
if (_array[w2].get_bit(0) != _array[w].get_bit(b)) {
|
||||
// The first bit of word w2 is different.
|
||||
|
Loading…
x
Reference in New Issue
Block a user