revert BitMask::operator bool--just a bad idea.

This commit is contained in:
David Rose 2009-02-11 00:31:34 +00:00
parent 4b96d9f8cf
commit d521ca04fa
9 changed files with 12 additions and 66 deletions

View File

@ -624,8 +624,8 @@ r_traverse_single(CollisionLevelStateSingle &level_state, size_t pass) {
if (level_state.has_collider(c)) { if (level_state.has_collider(c)) {
entry._from_node = level_state.get_collider_node(c); entry._from_node = level_state.get_collider_node(c);
if (entry._from_node->get_from_collide_mask() & if ((entry._from_node->get_from_collide_mask() &
cnode->get_into_collide_mask()) { cnode->get_into_collide_mask()) != 0) {
#ifdef DO_PSTATS #ifdef DO_PSTATS
//PStatTimer collide_timer(_solid_collide_collectors[pass]); //PStatTimer collide_timer(_solid_collide_collectors[pass]);
#endif #endif
@ -669,8 +669,8 @@ r_traverse_single(CollisionLevelStateSingle &level_state, size_t pass) {
if (level_state.has_collider(c)) { if (level_state.has_collider(c)) {
entry._from_node = level_state.get_collider_node(c); entry._from_node = level_state.get_collider_node(c);
if (entry._from_node->get_from_collide_mask() & if ((entry._from_node->get_from_collide_mask() &
gnode->get_into_collide_mask()) { gnode->get_into_collide_mask()) != 0) {
#ifdef DO_PSTATS #ifdef DO_PSTATS
//PStatTimer collide_timer(_solid_collide_collectors[pass]); //PStatTimer collide_timer(_solid_collide_collectors[pass]);
#endif #endif
@ -841,8 +841,8 @@ r_traverse_double(CollisionLevelStateDouble &level_state, size_t pass) {
if (level_state.has_collider(c)) { if (level_state.has_collider(c)) {
entry._from_node = level_state.get_collider_node(c); entry._from_node = level_state.get_collider_node(c);
if (entry._from_node->get_from_collide_mask() & if ((entry._from_node->get_from_collide_mask() &
cnode->get_into_collide_mask()) { cnode->get_into_collide_mask()) != 0) {
#ifdef DO_PSTATS #ifdef DO_PSTATS
//PStatTimer collide_timer(_solid_collide_collectors[pass]); //PStatTimer collide_timer(_solid_collide_collectors[pass]);
#endif #endif
@ -886,8 +886,8 @@ r_traverse_double(CollisionLevelStateDouble &level_state, size_t pass) {
if (level_state.has_collider(c)) { if (level_state.has_collider(c)) {
entry._from_node = level_state.get_collider_node(c); entry._from_node = level_state.get_collider_node(c);
if (entry._from_node->get_from_collide_mask() & if ((entry._from_node->get_from_collide_mask() &
gnode->get_into_collide_mask()) { gnode->get_into_collide_mask()) != 0) {
#ifdef DO_PSTATS #ifdef DO_PSTATS
//PStatTimer collide_timer(_solid_collide_collectors[pass]); //PStatTimer collide_timer(_solid_collide_collectors[pass]);
#endif #endif
@ -1058,8 +1058,8 @@ r_traverse_quad(CollisionLevelStateQuad &level_state, size_t pass) {
if (level_state.has_collider(c)) { if (level_state.has_collider(c)) {
entry._from_node = level_state.get_collider_node(c); entry._from_node = level_state.get_collider_node(c);
if (entry._from_node->get_from_collide_mask() & if ((entry._from_node->get_from_collide_mask() &
cnode->get_into_collide_mask()) { cnode->get_into_collide_mask()) != 0) {
#ifdef DO_PSTATS #ifdef DO_PSTATS
//PStatTimer collide_timer(_solid_collide_collectors[pass]); //PStatTimer collide_timer(_solid_collide_collectors[pass]);
#endif #endif
@ -1103,8 +1103,8 @@ r_traverse_quad(CollisionLevelStateQuad &level_state, size_t pass) {
if (level_state.has_collider(c)) { if (level_state.has_collider(c)) {
entry._from_node = level_state.get_collider_node(c); entry._from_node = level_state.get_collider_node(c);
if (entry._from_node->get_from_collide_mask() & if ((entry._from_node->get_from_collide_mask() &
gnode->get_into_collide_mask()) { gnode->get_into_collide_mask()) != 0) {
#ifdef DO_PSTATS #ifdef DO_PSTATS
//PStatTimer collide_timer(_solid_collide_collectors[pass]); //PStatTimer collide_timer(_solid_collide_collectors[pass]);
#endif #endif

View File

@ -411,18 +411,6 @@ clear() {
_highest_bits = 0; _highest_bits = 0;
} }
////////////////////////////////////////////////////////////////////
// Function: BitArray::operator bool
// Access: Published
// Description: The bool typecast operator returns true if any bits
// are set, false if none of them is set. That is, true
// if nonzero, false if zero.
////////////////////////////////////////////////////////////////////
INLINE BitArray::
operator bool () const {
return !is_zero();
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: BitArray::operator == // Function: BitArray::operator ==
// Access: Published // Access: Published

View File

@ -102,7 +102,6 @@ PUBLISHED:
void output_hex(ostream &out, int spaces_every = 4) const; void output_hex(ostream &out, int spaces_every = 4) const;
void write(ostream &out, int indent_level = 0) const; void write(ostream &out, int indent_level = 0) const;
INLINE operator bool () const;
INLINE bool operator == (const BitArray &other) const; INLINE bool operator == (const BitArray &other) const;
INLINE bool operator != (const BitArray &other) const; INLINE bool operator != (const BitArray &other) const;
INLINE bool operator < (const BitArray &other) const; INLINE bool operator < (const BitArray &other) const;

View File

@ -631,19 +631,6 @@ write(ostream &out, int indent_level) const {
indent(out, indent_level) << *this << "\n"; indent(out, indent_level) << *this << "\n";
} }
////////////////////////////////////////////////////////////////////
// Function: BitMask::operator bool
// Access: Published
// Description: The bool typecast operator returns true if any bits
// are set, false if none of them is set. That is, true
// if nonzero, false if zero.
////////////////////////////////////////////////////////////////////
template<class WType, int nbits>
INLINE BitMask<WType, nbits>::
operator bool () const {
return !is_zero();
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: BitMask::operator == // Function: BitMask::operator ==
// Access: Published // Access: Published

View File

@ -89,7 +89,6 @@ PUBLISHED:
void output_hex(ostream &out, int spaces_every = 4) const; void output_hex(ostream &out, int spaces_every = 4) const;
void write(ostream &out, int indent_level = 0) const; void write(ostream &out, int indent_level = 0) const;
INLINE operator bool () const;
INLINE bool operator == (const BitMask<WType, nbits> &other) const; INLINE bool operator == (const BitMask<WType, nbits> &other) const;
INLINE bool operator != (const BitMask<WType, nbits> &other) const; INLINE bool operator != (const BitMask<WType, nbits> &other) const;
INLINE bool operator < (const BitMask<WType, nbits> &other) const; INLINE bool operator < (const BitMask<WType, nbits> &other) const;

View File

@ -646,19 +646,6 @@ write(ostream &out, int indent_level) const {
indent(out, indent_level) << *this << "\n"; indent(out, indent_level) << *this << "\n";
} }
////////////////////////////////////////////////////////////////////
// Function: DoubleBitMask::operator bool
// Access: Published
// Description: The bool typecast operator returns true if any bits
// are set, false if none of them is set. That is, true
// if nonzero, false if zero.
////////////////////////////////////////////////////////////////////
template<class BMType>
INLINE DoubleBitMask<BMType>::
operator bool () const {
return !is_zero();
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: DoubleBitMask::operator == // Function: DoubleBitMask::operator ==
// Access: Published // Access: Published

View File

@ -89,7 +89,6 @@ PUBLISHED:
void output_hex(ostream &out, int spaces_every = 4) const; void output_hex(ostream &out, int spaces_every = 4) const;
void write(ostream &out, int indent_level = 0) const; void write(ostream &out, int indent_level = 0) const;
INLINE operator bool () const;
INLINE bool operator == (const DoubleBitMask<BMType> &other) const; INLINE bool operator == (const DoubleBitMask<BMType> &other) const;
INLINE bool operator != (const DoubleBitMask<BMType> &other) const; INLINE bool operator != (const DoubleBitMask<BMType> &other) const;
INLINE bool operator < (const DoubleBitMask<BMType> &other) const; INLINE bool operator < (const DoubleBitMask<BMType> &other) const;

View File

@ -360,18 +360,6 @@ clear() {
_inverse = false; _inverse = false;
} }
////////////////////////////////////////////////////////////////////
// Function: SparseArray::operator bool
// Access: Published
// Description: The bool typecast operator returns true if any bits
// are set, false if none of them is set. That is, true
// if nonzero, false if zero.
////////////////////////////////////////////////////////////////////
INLINE SparseArray::
operator bool () const {
return !is_zero();
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: SparseArray::operator == // Function: SparseArray::operator ==
// Access: Published // Access: Published

View File

@ -93,7 +93,6 @@ PUBLISHED:
void output(ostream &out) const; void output(ostream &out) const;
INLINE operator bool () const;
INLINE bool operator == (const SparseArray &other) const; INLINE bool operator == (const SparseArray &other) const;
INLINE bool operator != (const SparseArray &other) const; INLINE bool operator != (const SparseArray &other) const;
INLINE bool operator < (const SparseArray &other) const; INLINE bool operator < (const SparseArray &other) const;