texturePoolFilter.cxx 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Filename: texturePoolFilter.cxx
  2. // Created by: drose (27Jul06)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. #include "texturePoolFilter.h"
  15. TypeHandle TexturePoolFilter::_type_handle;
  16. ////////////////////////////////////////////////////////////////////
  17. // Function: TexturePoolFilter::Destructor
  18. // Access: Public, Virtual
  19. // Description:
  20. ////////////////////////////////////////////////////////////////////
  21. TexturePoolFilter::
  22. ~TexturePoolFilter() {
  23. }
  24. ////////////////////////////////////////////////////////////////////
  25. // Function: TexturePoolFilter::pre_load
  26. // Access: Public, Virtual
  27. // Description: This method is called before each texture is loaded
  28. // from disk, via the TexturePool, for the first time.
  29. // If this method returns NULL, then a new Texture will
  30. // be allocated and loaded from disk normally by the
  31. // TexturePool; otherwise, if it returns non-NULL, then
  32. // that returned pointer will be used as the Texture for
  33. // this filename.
  34. ////////////////////////////////////////////////////////////////////
  35. PT(Texture) TexturePoolFilter::
  36. pre_load(const Filename &, const Filename &, int, int, bool,
  37. const LoaderOptions &) {
  38. return NULL;
  39. }
  40. ////////////////////////////////////////////////////////////////////
  41. // Function: TexturePoolFilter::post_load
  42. // Access: Public, Virtual
  43. // Description: This method is called after each texture has been
  44. // loaded from disk, via the TexturePool, for the first
  45. // time. By the time this method is called, the Texture
  46. // has already been fully read from disk. This method
  47. // should return the Texture pointer that the
  48. // TexturePool should actually return (usually it is the
  49. // same as the pointer supplied).
  50. ////////////////////////////////////////////////////////////////////
  51. PT(Texture) TexturePoolFilter::
  52. post_load(Texture *tex) {
  53. return tex;
  54. }
  55. ////////////////////////////////////////////////////////////////////
  56. // Function: TexturePoolFilter::output
  57. // Access: Public, Virtual
  58. // Description:
  59. ////////////////////////////////////////////////////////////////////
  60. void TexturePoolFilter::
  61. output(ostream &out) const {
  62. out << get_type();
  63. }