diff --git a/panda/src/pnmimage/pnmWriter.I b/panda/src/pnmimage/pnmWriter.I index 6545eb8084..34c458f843 100644 --- a/panda/src/pnmimage/pnmWriter.I +++ b/panda/src/pnmimage/pnmWriter.I @@ -26,7 +26,8 @@ INLINE PNMWriter:: PNMWriter(PNMFileType *type, ostream *file, bool owns_file) : _type(type), _owns_file(owns_file), - _file(file) + _file(file), + _is_valid(true) { } @@ -106,3 +107,14 @@ INLINE void PNMWriter:: copy_header_from(const PNMImageHeader &header) { PNMImageHeader::operator = (header); } + +//////////////////////////////////////////////////////////////////// +// Function: PNMWriter::is_valid +// Access: Public +// Description: Returns true if the PNMWriter can be used to write +// data, false if something is wrong. +//////////////////////////////////////////////////////////////////// +INLINE bool PNMWriter:: +is_valid() const { + return _is_valid; +} diff --git a/panda/src/pnmimage/pnmWriter.h b/panda/src/pnmimage/pnmWriter.h index 714f2d32f5..a0115f586e 100644 --- a/panda/src/pnmimage/pnmWriter.h +++ b/panda/src/pnmimage/pnmWriter.h @@ -59,10 +59,13 @@ public: virtual bool supports_stream_write() const; + INLINE bool is_valid() const; + protected: PNMFileType *_type; bool _owns_file; ostream *_file; + bool _is_valid; }; #include "pnmWriter.I"