print warning when file not found

This commit is contained in:
David Rose 2006-11-13 22:13:13 +00:00
parent 9ef8e468e5
commit 79f9e04e26
3 changed files with 18 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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 &copy);