Browse Source

operator bool

David Rose 16 years ago
parent
commit
1fc71a28e8
2 changed files with 12 additions and 0 deletions
  1. 11 0
      panda/src/text/textFont.I
  2. 1 0
      panda/src/text/textFont.h

+ 11 - 0
panda/src/text/textFont.I

@@ -24,6 +24,17 @@ is_valid() const {
   return _is_valid;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: TextFont::operator bool
+//       Access: Published
+//  Description: Returns true if the font is valid and ready to use,
+//               false otherwise.
+////////////////////////////////////////////////////////////////////
+INLINE TextFont::
+operator bool () const {
+  return is_valid();
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: TextFont::get_line_height
 //       Access: Published

+ 1 - 0
panda/src/text/textFont.h

@@ -70,6 +70,7 @@ PUBLISHED:
 
 
   INLINE bool is_valid() const;
+  INLINE operator bool () const;
   INLINE float get_line_height() const;
   INLINE void set_line_height(float line_height);