mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
pnmimagetypes: Remove vestigial init_pnm() call
This commit is contained in:
parent
492cce8a49
commit
3052bcf289
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
bool PNMFileType::_did_init_pnm = false;
|
|
||||||
TypeHandle PNMFileType::_type_handle;
|
TypeHandle PNMFileType::_type_handle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -107,21 +106,6 @@ make_writer(std::ostream *, bool) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the underlying PNM library, if it has not already been
|
|
||||||
* initialized. This should be called by every implementation of
|
|
||||||
* make_reader() and make_writer(), to ensure that the library is properly
|
|
||||||
* initialized before any I/O is attempted.
|
|
||||||
*/
|
|
||||||
void PNMFileType::
|
|
||||||
init_pnm() {
|
|
||||||
if (!_did_init_pnm) {
|
|
||||||
_did_init_pnm = true;
|
|
||||||
|
|
||||||
// No reason to do anything here nowadays.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fills the indicated datagram up with a binary representation of the current
|
* Fills the indicated datagram up with a binary representation of the current
|
||||||
* object, in preparation for writing to a Bam file.
|
* object, in preparation for writing to a Bam file.
|
||||||
|
@ -56,13 +56,6 @@ public:
|
|||||||
const std::string &magic_number = std::string());
|
const std::string &magic_number = std::string());
|
||||||
virtual PNMWriter *make_writer(std::ostream *file, bool owns_file = true);
|
virtual PNMWriter *make_writer(std::ostream *file, bool owns_file = true);
|
||||||
|
|
||||||
protected:
|
|
||||||
static void init_pnm();
|
|
||||||
|
|
||||||
private:
|
|
||||||
static bool _did_init_pnm;
|
|
||||||
|
|
||||||
|
|
||||||
// The TypedWritable interface follows.
|
// The TypedWritable interface follows.
|
||||||
public:
|
public:
|
||||||
static void register_with_read_factory();
|
static void register_with_read_factory();
|
||||||
|
@ -99,7 +99,6 @@ matches_magic_number(const string &magic_number) const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypeBMP::
|
PNMReader *PNMFileTypeBMP::
|
||||||
make_reader(std::istream *file, bool owns_file, const string &magic_number) {
|
make_reader(std::istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +109,6 @@ make_reader(std::istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypeBMP::
|
PNMWriter *PNMFileTypeBMP::
|
||||||
make_writer(std::ostream *file, bool owns_file) {
|
make_writer(std::ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +180,6 @@ matches_magic_number(const string &magic_number) const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypeEXR::
|
PNMReader *PNMFileTypeEXR::
|
||||||
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +190,6 @@ make_reader(istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypeEXR::
|
PNMWriter *PNMFileTypeEXR::
|
||||||
make_writer(ostream *file, bool owns_file) {
|
make_writer(ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ get_suggested_extension() const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypeIMG::
|
PNMReader *PNMFileTypeIMG::
|
||||||
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +96,6 @@ make_reader(istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypeIMG::
|
PNMWriter *PNMFileTypeIMG::
|
||||||
make_writer(ostream *file, bool owns_file) {
|
make_writer(ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,6 @@ matches_magic_number(const string &magic_number) const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypeJPG::
|
PNMReader *PNMFileTypeJPG::
|
||||||
make_reader(std::istream *file, bool owns_file, const string &magic_number) {
|
make_reader(std::istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +110,6 @@ make_reader(std::istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypeJPG::
|
PNMWriter *PNMFileTypeJPG::
|
||||||
make_writer(std::ostream *file, bool owns_file) {
|
make_writer(std::ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,6 @@ matches_magic_number(const string &magic_number) const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypePNG::
|
PNMReader *PNMFileTypePNG::
|
||||||
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +132,6 @@ make_reader(istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypePNG::
|
PNMWriter *PNMFileTypePNG::
|
||||||
make_writer(ostream *file, bool owns_file) {
|
make_writer(ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1027,7 +1027,6 @@ matches_magic_number(const string &magic_number) const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypePNM::
|
PNMReader *PNMFileTypePNM::
|
||||||
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1038,7 +1037,6 @@ make_reader(istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypePNM::
|
PNMWriter *PNMFileTypePNM::
|
||||||
make_writer(ostream *file, bool owns_file) {
|
make_writer(ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,6 @@ matches_magic_number(const string &magic_number) const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypeSGI::
|
PNMReader *PNMFileTypeSGI::
|
||||||
make_reader(std::istream *file, bool owns_file, const string &magic_number) {
|
make_reader(std::istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +113,6 @@ make_reader(std::istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypeSGI::
|
PNMWriter *PNMFileTypeSGI::
|
||||||
make_writer(std::ostream *file, bool owns_file) {
|
make_writer(std::ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +277,6 @@ matches_magic_number(const string &magic_number) const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypeSoftImage::
|
PNMReader *PNMFileTypeSoftImage::
|
||||||
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,7 +287,6 @@ make_reader(istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypeSoftImage::
|
PNMWriter *PNMFileTypeSoftImage::
|
||||||
make_writer(ostream *file, bool owns_file) {
|
make_writer(ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,6 @@ matches_magic_number(const string &magic_number) const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypeStbImage::
|
PNMReader *PNMFileTypeStbImage::
|
||||||
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new StbImageReader(this, file, owns_file, magic_number);
|
return new StbImageReader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,6 @@ get_suggested_extension() const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypeTGA::
|
PNMReader *PNMFileTypeTGA::
|
||||||
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +164,6 @@ make_reader(istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypeTGA::
|
PNMWriter *PNMFileTypeTGA::
|
||||||
make_writer(ostream *file, bool owns_file) {
|
make_writer(ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +292,6 @@ matches_magic_number(const string &magic_number) const {
|
|||||||
*/
|
*/
|
||||||
PNMReader *PNMFileTypeTIFF::
|
PNMReader *PNMFileTypeTIFF::
|
||||||
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
make_reader(istream *file, bool owns_file, const string &magic_number) {
|
||||||
init_pnm();
|
|
||||||
install_error_handlers();
|
install_error_handlers();
|
||||||
return new Reader(this, file, owns_file, magic_number);
|
return new Reader(this, file, owns_file, magic_number);
|
||||||
}
|
}
|
||||||
@ -304,7 +303,6 @@ make_reader(istream *file, bool owns_file, const string &magic_number) {
|
|||||||
*/
|
*/
|
||||||
PNMWriter *PNMFileTypeTIFF::
|
PNMWriter *PNMFileTypeTIFF::
|
||||||
make_writer(ostream *file, bool owns_file) {
|
make_writer(ostream *file, bool owns_file) {
|
||||||
init_pnm();
|
|
||||||
install_error_handlers();
|
install_error_handlers();
|
||||||
return new Writer(this, file, owns_file);
|
return new Writer(this, file, owns_file);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user