From 79f9e04e26ce71cd4620c649088b510336f7bd7c Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 13 Nov 2006 22:13:13 +0000 Subject: [PATCH] print warning when file not found --- panda/src/pnmimage/pnmImage.I | 13 ------------- panda/src/pnmimage/pnmImage.cxx | 17 +++++++++++++++++ panda/src/pnmimage/pnmImage.h | 2 +- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/panda/src/pnmimage/pnmImage.I b/panda/src/pnmimage/pnmImage.I index 6002a743d3..bc7e210843 100644 --- a/panda/src/pnmimage/pnmImage.I +++ b/panda/src/pnmimage/pnmImage.I @@ -27,19 +27,6 @@ PNMImage() { _alpha = NULL; } -//////////////////////////////////////////////////////////////////// -// Function: PNMImage::Constructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE PNMImage:: -PNMImage(const Filename &filename, PNMFileType *type) { - _array = NULL; - _alpha = NULL; - - read(filename, type); -} - //////////////////////////////////////////////////////////////////// // Function: PNMImage::Constructor // Access: Published diff --git a/panda/src/pnmimage/pnmImage.cxx b/panda/src/pnmimage/pnmImage.cxx index 64a0ddd31d..176346d924 100644 --- a/panda/src/pnmimage/pnmImage.cxx +++ b/panda/src/pnmimage/pnmImage.cxx @@ -21,6 +21,23 @@ #include "pnmWriter.h" #include "config_pnmimage.h" +//////////////////////////////////////////////////////////////////// +// Function: PNMImage::Constructor +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +PNMImage:: +PNMImage(const Filename &filename, PNMFileType *type) { + _array = NULL; + _alpha = NULL; + + bool result = read(filename, type); + if (!result) { + pnmimage_cat.error() + << "Could not read image " << filename << "\n"; + } +} + //////////////////////////////////////////////////////////////////// // Function: PNMImage::clear // Access: Published diff --git a/panda/src/pnmimage/pnmImage.h b/panda/src/pnmimage/pnmImage.h index 3ace68c0e0..707412df3a 100644 --- a/panda/src/pnmimage/pnmImage.h +++ b/panda/src/pnmimage/pnmImage.h @@ -59,7 +59,7 @@ class PNMFileType; class EXPCL_PANDA PNMImage : public PNMImageHeader { PUBLISHED: INLINE PNMImage(); - INLINE PNMImage(const Filename &filename, PNMFileType *type = NULL); + PNMImage(const Filename &filename, PNMFileType *type = NULL); INLINE PNMImage(int x_size, int y_size, int num_channels = 3, xelval maxval = 255, PNMFileType *type = NULL); INLINE PNMImage(const PNMImage ©);