diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 54f8f62399..60d7a90433 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -333,6 +333,32 @@ write(const Filename &name) const { return true; } +//////////////////////////////////////////////////////////////////// +// Function: Texture::load +// Access: Published +// Description: Creates the texture from the already-read PNMImage. +//////////////////////////////////////////////////////////////////// +bool Texture:: +load(const PNMImage &pnmimage) { + if (!_pbuffer->load(pnmimage)) + return false; + + mark_dirty(DF_image); + + return true; +} + +//////////////////////////////////////////////////////////////////// +// Function: Texture::store +// Access: Published +// Description: Saves the texture to the indicated PNMImage, but does +// not write it to disk. +//////////////////////////////////////////////////////////////////// +bool Texture:: +store(PNMImage &pnmimage) const { + return _pbuffer->store( pnmimage ); +} + //////////////////////////////////////////////////////////////////// // Function: Texture::set_wrapu // Access: Published @@ -455,32 +481,6 @@ prepare(PreparedGraphicsObjects *prepared_objects) { prepared_objects->enqueue_texture(this); } -//////////////////////////////////////////////////////////////////// -// Function: Texture::load -// Access: Public -// Description: Creates the texture from the already-read PNMImage. -//////////////////////////////////////////////////////////////////// -bool Texture:: -load(const PNMImage &pnmimage) { - if (!_pbuffer->load(pnmimage)) - return false; - - mark_dirty(DF_image); - - return true; -} - -//////////////////////////////////////////////////////////////////// -// Function: Texture::store -// Access: Public -// Description: Saves the texture to the indicated PNMImage, but does -// not write it to disk. -//////////////////////////////////////////////////////////////////// -bool Texture:: -store(PNMImage &pnmimage) const { - return _pbuffer->store( pnmimage ); -} - //////////////////////////////////////////////////////////////////// // Function: Texture::is_mipmap // Access: Public, Static diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index e14364dee5..124ee2cb56 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -85,6 +85,9 @@ PUBLISHED: int primary_file_num_channels = 0, int alpha_file_channel = 0); bool write(const Filename &fullpath = "") const; + bool load(const PNMImage &pnmimage); + bool store(PNMImage &pnmimage) const; + void set_wrapu(WrapMode wrap); void set_wrapv(WrapMode wrap); void set_minfilter(FilterType filter); @@ -105,9 +108,6 @@ PUBLISHED: void prepare(PreparedGraphicsObjects *prepared_objects); public: - bool load(const PNMImage &pnmimage); - bool store(PNMImage &pnmimage) const; - static bool is_mipmap(FilterType type); TextureContext *prepare_now(PreparedGraphicsObjects *prepared_objects, diff --git a/panda/src/pnmimage/Sources.pp b/panda/src/pnmimage/Sources.pp index a75b0e9990..cbdb91cacb 100644 --- a/panda/src/pnmimage/Sources.pp +++ b/panda/src/pnmimage/Sources.pp @@ -29,5 +29,7 @@ pnmImage.h pnmImageHeader.I pnmImageHeader.h pnmReader.I \ pnmReader.h pnmWriter.I pnmWriter.h pnmimage_base.h + #define IGATESCAN all + #end lib_target diff --git a/panda/src/pnmimage/pnmImage.h b/panda/src/pnmimage/pnmImage.h index 460eee86b9..211b1b20cb 100644 --- a/panda/src/pnmimage/pnmImage.h +++ b/panda/src/pnmimage/pnmImage.h @@ -57,7 +57,7 @@ class PNMFileType; // pointer. The filename "-" refers to stdin or stdout. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA PNMImage : public PNMImageHeader { -public: +PUBLISHED: INLINE PNMImage(); INLINE PNMImage(const Filename &filename, PNMFileType *type = NULL); INLINE PNMImage(int x_size, int y_size, int num_channels = 3, diff --git a/panda/src/pnmimage/pnmImageHeader.h b/panda/src/pnmimage/pnmImageHeader.h index 98807d65a1..008002bd09 100644 --- a/panda/src/pnmimage/pnmImageHeader.h +++ b/panda/src/pnmimage/pnmImageHeader.h @@ -41,7 +41,7 @@ class PNMWriter; // image file's header. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA PNMImageHeader { -public: +PUBLISHED: INLINE PNMImageHeader(); INLINE PNMImageHeader(const PNMImageHeader ©); INLINE void operator = (const PNMImageHeader ©);