From 1fc71a28e85fcc6e4f8670b3bcfc1f68be47fe5b Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 19 Dec 2009 07:09:45 +0000 Subject: [PATCH] operator bool --- panda/src/text/textFont.I | 11 +++++++++++ panda/src/text/textFont.h | 1 + 2 files changed, 12 insertions(+) diff --git a/panda/src/text/textFont.I b/panda/src/text/textFont.I index d90b195ba0..452e132a0f 100644 --- a/panda/src/text/textFont.I +++ b/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 diff --git a/panda/src/text/textFont.h b/panda/src/text/textFont.h index ae0d560025..4b7acbe4ec 100644 --- a/panda/src/text/textFont.h +++ b/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);