浏览代码

fix PandaSystem.hasSystem() etc.

David Rose 21 年之前
父节点
当前提交
2a39759b85
共有 49 个文件被更改,包括 315 次插入197 次删除
  1. 1 0
      direct/src/showbase/ShowBase.py
  2. 33 1
      dtool/src/dtoolutil/pandaSystem.cxx
  3. 8 0
      dtool/src/dtoolutil/pandaSystem.h
  4. 7 12
      panda/metalibs/pandagl/pandagl.cxx
  5. 6 0
      panda/src/audiotraits/config_fmodAudio.cxx
  6. 6 0
      panda/src/audiotraits/config_milesAudio.cxx
  7. 4 0
      panda/src/downloader/config_downloader.cxx
  8. 4 0
      panda/src/dxgsg7/config_dxgsg7.cxx
  9. 3 0
      panda/src/dxgsg8/config_dxgsg8.cxx
  10. 3 0
      panda/src/dxgsg9/config_dxgsg9.cxx
  11. 4 0
      panda/src/effects/config_effects.cxx
  12. 1 1
      panda/src/egg2pg/config_egg2pg.cxx
  13. 2 2
      panda/src/framework/windowFramework.cxx
  14. 1 0
      panda/src/glgsg/glgsg.h
  15. 8 0
      panda/src/glstuff/glmisc_src.cxx
  16. 4 0
      panda/src/glxdisplay/config_glxdisplay.cxx
  17. 7 7
      panda/src/linmath/config_linmath.cxx
  18. 6 0
      panda/src/mathutil/config_mathutil.cxx
  19. 1 0
      panda/src/mesadisplay/mesagsg.h
  20. 5 0
      panda/src/net/config_net.cxx
  21. 1 1
      panda/src/pgraph/config_pgraph.cxx
  22. 5 5
      panda/src/pgraph/loader.cxx
  23. 1 1
      panda/src/pgraph/loaderFileType.cxx
  24. 2 0
      panda/src/pgraph/loaderFileType.h
  25. 80 80
      panda/src/pgraph/loaderFileTypeRegistry.cxx
  26. 5 5
      panda/src/pgraph/loaderFileTypeRegistry.h
  27. 3 3
      panda/src/pnmimage/pnmFileType.cxx
  28. 2 0
      panda/src/pnmimage/pnmFileType.h
  29. 53 53
      panda/src/pnmimage/pnmFileTypeRegistry.cxx
  30. 4 3
      panda/src/pnmimage/pnmFileTypeRegistry.h
  31. 5 5
      panda/src/pnmimage/pnmImageHeader.cxx
  32. 15 1
      panda/src/pnmimagetypes/config_pnmimagetypes.cxx
  33. 1 1
      panda/src/pnmimagetypes/pnmFileTypeAlias.cxx
  34. 1 1
      panda/src/pnmimagetypes/pnmFileTypeBMP.cxx
  35. 1 1
      panda/src/pnmimagetypes/pnmFileTypeIMG.cxx
  36. 1 1
      panda/src/pnmimagetypes/pnmFileTypeJPG.cxx
  37. 1 1
      panda/src/pnmimagetypes/pnmFileTypePNG.cxx
  38. 1 1
      panda/src/pnmimagetypes/pnmFileTypeSGI.cxx
  39. 1 1
      panda/src/pnmimagetypes/pnmFileTypeSoftImage.cxx
  40. 1 1
      panda/src/pnmimagetypes/pnmFileTypeTGA.cxx
  41. 1 1
      panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx
  42. 4 0
      panda/src/text/config_text.cxx
  43. 4 0
      panda/src/wgldisplay/config_wgldisplay.cxx
  44. 1 1
      pandatool/src/mayaprogs/config_mayaloader.cxx
  45. 1 1
      pandatool/src/palettizer/pal_string_utils.cxx
  46. 1 1
      pandatool/src/palettizer/palettizer.cxx
  47. 2 2
      pandatool/src/palettizer/txaFile.cxx
  48. 2 2
      pandatool/src/progbase/programBase.cxx
  49. 1 1
      pandatool/src/ptloader/config_ptloader.cxx

+ 1 - 0
direct/src/showbase/ShowBase.py

@@ -235,6 +235,7 @@ class ShowBase(DirectObject.DirectObject):
         __builtins__["vfs"] = vfs
         __builtins__["cpMgr"] = ConfigPageManager.getGlobalPtr()
         __builtins__["cvMgr"] = ConfigVariableManager.getGlobalPtr()
+        __builtins__["pandaSystem"] = PandaSystem.getGlobalPtr()
         __builtins__["__dev__"] = base.config.GetBool('want-dev', 0)
         __builtins__["wantOtpServer"] = base.config.GetBool('want-otp-server', 0)
         if __debug__:

+ 33 - 1
dtool/src/dtoolutil/pandaSystem.cxx

@@ -169,7 +169,7 @@ get_num_systems() const {
 ////////////////////////////////////////////////////////////////////
 string PandaSystem::
 get_system(int n) const {
-  if (n < 0 || n >= (int)_system_names.size()) {
+  if (n < 0 || n >= (int)_systems.size()) {
     return string();
   }
 
@@ -241,6 +241,38 @@ set_system_tag(const string &system, const string &tag,
   SystemTags &tags = (*result.first).second;
   tags[tag] = value;
 }
+
+////////////////////////////////////////////////////////////////////
+//     Function: PandaSystem::output
+//       Access: Published
+//  Description: 
+////////////////////////////////////////////////////////////////////
+void PandaSystem::
+output(ostream &out) const {
+  out << "Panda version " << get_version_string();
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PandaSystem::write
+//       Access: Published
+//  Description: 
+////////////////////////////////////////////////////////////////////
+void PandaSystem::
+write(ostream &out) const {
+  out << *this << ":\n";
+
+  for (Systems::const_iterator si = _systems.begin();
+       si != _systems.end();
+       ++si) {
+    out << "  " << (*si).first << "\n";
+    const SystemTags &tags = (*si).second;
+    SystemTags::const_iterator ti;
+    for (ti = tags.begin(); ti != tags.end(); ++ti) {
+      out << "    " << (*ti).first << " " << (*ti).second << "\n";
+    }
+  }
+}
+
   
 ////////////////////////////////////////////////////////////////////
 //     Function: PandaSystem::get_global_ptr

+ 8 - 0
dtool/src/dtoolutil/pandaSystem.h

@@ -54,6 +54,9 @@ PUBLISHED:
   void set_system_tag(const string &system, const string &tag,
                       const string &value);
 
+  void output(ostream &out) const;
+  void write(ostream &out) const;
+
   static PandaSystem *get_global_ptr();
 
 private:
@@ -70,6 +73,11 @@ private:
   static PandaSystem *_global_ptr;
 };
 
+inline ostream &operator << (ostream &out, const PandaSystem &ps) {
+  ps.output(out);
+  return out;
+}
+
 #endif
 
   

+ 7 - 12
panda/metalibs/pandagl/pandagl.cxx

@@ -6,14 +6,12 @@
 #include "pandagl.h"
 
 #ifndef LINK_IN_GL
-#include <config_glgsg.h>
-// Temporarily commented out for development on wgldisplay
-/*
+#include "config_glgsg.h"
 #ifdef HAVE_WGL
-#include <config_wgldisplay.h>
-#endif
-*/
-#endif
+#include "config_wgldisplay.h"
+#endif  // HAVE_WGL
+
+#endif  // LINK_IN_GL
 
 // By including checkPandaVersion.h, we guarantee that runtime
 // attempts to load libpandagl.so/.dll will fail if they inadvertently
@@ -33,11 +31,8 @@ void
 init_libpandagl() {
 #ifndef LINK_IN_GL
   init_libglgsg();
-// Temporarily commented out for development on wgldisplay
-  /*
 #ifdef HAVE_WGL
   init_libwgldisplay();
-#endif
-  */
-#endif
+#endif  // HAVE_GL
+#endif  // LINK_IN_GL
 }

+ 6 - 0
panda/src/audiotraits/config_fmodAudio.cxx

@@ -23,6 +23,7 @@
 #include "config_fmodAudio.h"
 #include "fmodAudioManager.h"
 #include "fmodAudioSound.h"
+#include "pandaSystem.h"
 #include "dconfig.h"
 
 ConfigureDef(config_fmodAudio);
@@ -50,6 +51,11 @@ init_libFmodAudio() {
   initialized = true;
 
   AudioManager::register_AudioManager_creator(Create_AudioManager);
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("FMOD");
+  ps->add_system("audio");
+  ps->set_system_tag("audio", "implementation", "FMOD");
 }
 
 #endif //]

+ 6 - 0
panda/src/audiotraits/config_milesAudio.cxx

@@ -22,6 +22,7 @@
 #include "config_milesAudio.h"
 #include "milesAudioManager.h"
 #include "milesAudioSound.h"
+#include "pandaSystem.h"
 #include "dconfig.h"
 
 ConfigureDef(config_milesAudio);
@@ -72,6 +73,11 @@ init_libMilesAudio() {
 
   MilesAudioManager::init_type();
   MilesAudioSound::init_type();
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("Miles");
+  ps->add_system("audio");
+  ps->set_system_tag("audio", "implementation", "Miles");
 }
 
 #endif //]

+ 4 - 0
panda/src/downloader/config_downloader.cxx

@@ -19,6 +19,7 @@
 #include "dconfig.h"
 #include "config_downloader.h"
 #include "httpChannel.h"
+#include "pandaSystem.h"
 
 
 ConfigureDef(config_downloader);
@@ -157,5 +158,8 @@ ConfigVariableList http_username
 ConfigureFn(config_downloader) {
 #ifdef HAVE_SSL
   HTTPChannel::init_type();
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("OpenSSL");
 #endif
 }

+ 4 - 0
panda/src/dxgsg7/config_dxgsg7.cxx

@@ -23,6 +23,7 @@
 #include "wdxGraphicsPipe7.h"
 #include "wdxGraphicsWindow7.h"
 #include "graphicsPipeSelection.h"
+#include "pandaSystem.h"
 
 #include "dconfig.h"
 
@@ -126,4 +127,7 @@ init_libdxgsg7() {
   GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
   selection->add_pipe_type(wdxGraphicsPipe7::get_class_type(),
                            wdxGraphicsPipe7::pipe_constructor);
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("DirectX7");
 }

+ 3 - 0
panda/src/dxgsg8/config_dxgsg8.cxx

@@ -23,6 +23,7 @@
 #include "graphicsPipeSelection.h"
 #include "wdxGraphicsWindow8.h"
 #include "wdxGraphicsPipe8.h"
+#include "pandaSystem.h"
 
 #include "dconfig.h"
 
@@ -152,4 +153,6 @@ init_libdxgsg8() {
   selection->add_pipe_type(wdxGraphicsPipe8::get_class_type(),
                            wdxGraphicsPipe8::pipe_constructor);
 
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("DirectX8");
 }

+ 3 - 0
panda/src/dxgsg9/config_dxgsg9.cxx

@@ -23,6 +23,7 @@
 #include "graphicsPipeSelection.h"
 #include "wdxGraphicsWindow9.h"
 #include "wdxGraphicsPipe9.h"
+#include "pandaSystem.h"
 
 #include "dconfig.h"
 
@@ -152,4 +153,6 @@ init_libdxgsg9() {
   selection->add_pipe_type(wdxGraphicsPipe9::get_class_type(),
                            wdxGraphicsPipe9::pipe_constructor);
 
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("DirectX9");
 }

+ 4 - 0
panda/src/effects/config_effects.cxx

@@ -21,6 +21,7 @@
 #include "cgShaderAttrib.h"
 #include "cgShaderContext.h"
 #include "lensFlareNode.h"
+#include "pandaSystem.h"
 
 
 #include "dconfig.h"
@@ -46,6 +47,9 @@ init_libeffects() {
   CgShader::init_type();
   CgShaderAttrib::init_type();
   CgShaderContext::init_type();
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("Cg");
 #endif
 #if 0  // temporarily disabled until we can port to new scene graph.
   LensFlareNode::init_type();

+ 1 - 1
panda/src/egg2pg/config_egg2pg.cxx

@@ -155,7 +155,7 @@ init_libegg2pg() {
 
   LoaderFileTypeEgg::init_type();
 
-  LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
+  LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_global_ptr();
 
   reg->register_type(new LoaderFileTypeEgg);
 }

+ 2 - 2
panda/src/framework/windowFramework.cxx

@@ -561,13 +561,13 @@ load_model(const NodePath &parent, Filename filename) {
   bool is_image = false;
   string extension = filename.get_extension();
   if (!extension.empty()) {
-    LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
+    LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_global_ptr();
     LoaderFileType *model_type =
       reg->get_type_from_extension(extension);
     if (model_type == (LoaderFileType *)NULL) {
       // The extension isn't a known model file type, is it a known
       // image extension?
-      PNMFileTypeRegistry *reg = PNMFileTypeRegistry::get_ptr();
+      PNMFileTypeRegistry *reg = PNMFileTypeRegistry::get_global_ptr();
       PNMFileType *image_type =
         reg->get_type_from_extension(extension);
       if (image_type != (PNMFileType *)NULL) {

+ 1 - 0
panda/src/glgsg/glgsg.h

@@ -31,6 +31,7 @@
 #define CLP(name) GL##name
 #define GLPREFIX_QUOTED "gl"
 #define CLASSPREFIX_QUOTED "GL"
+#define GLSYSTEM_NAME "OpenGL"
 #define CONFIGOBJ config_glgsg
 #define GLCAT glgsg_cat
 #define EXPCL_GL EXPCL_PANDAGL

+ 8 - 0
panda/src/glstuff/glmisc_src.cxx

@@ -16,6 +16,7 @@
 //
 ////////////////////////////////////////////////////////////////////
 
+#include "pandaSystem.h"
 
 ConfigVariableBool CLP(cheap_textures)
   ("gl-cheap-textures", false,
@@ -63,5 +64,12 @@ void CLP(init_classes)() {
   CLP(SavedFrameBuffer)::init_type();
   CLP(TextureContext)::init_type();
   CLP(GeomContext)::init_type();
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system(GLSYSTEM_NAME);
+
+  // We can't add any tags defining the available OpenGL capabilities,
+  // since we won't know those until we create a graphics context (and
+  // the answer may be different for different contexts).
 }
 

+ 4 - 0
panda/src/glxdisplay/config_glxdisplay.cxx

@@ -23,6 +23,7 @@
 #include "glxGraphicsStateGuardian.h"
 #include "graphicsPipeSelection.h"
 #include "dconfig.h"
+#include "pandaSystem.h"
 
 Configure(config_glxdisplay);
 NotifyCategoryDef(glxdisplay, "display");
@@ -63,4 +64,7 @@ init_libglxdisplay() {
   GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
   selection->add_pipe_type(glxGraphicsPipe::get_class_type(),
                            glxGraphicsPipe::pipe_constructor);
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->set_system_tag("OpenGL", "window_system", "GLX");
 }

+ 7 - 7
panda/src/linmath/config_linmath.cxx

@@ -31,16 +31,16 @@ ConfigureFn(config_linmath) {
 
 ConfigVariableBool paranoid_hpr_quat
 ("paranoid-hpr-quat", false,
- "Set this true to doublecheck the quaternion-hpr compose and "
- "decompose operations against the quaternion-matrix and matrix-hpr "
- "operations.  This only has effect if NDEBUG is not defined.");
+ PRC_DESC("Set this true to doublecheck the quaternion-hpr compose and "
+          "decompose operations against the quaternion-matrix and matrix-hpr "
+          "operations.  This only has effect if NDEBUG is not defined."));
 
 ConfigVariableBool temp_hpr_fix
 ("temp-hpr-fix", true,
- "Set this true to compute hpr's correctly.  Historically, Panda has "
- "applied these in the wrong order, and roll was backwards relative "
- "to the other two.  Set this false if you need compatibility with "
- "Panda's old hpr calculations.");
+ PRC_DESC("Set this true to compute hpr's correctly.  Historically, Panda has "
+          "applied these in the wrong order, and roll was backwards relative "
+          "to the other two.  Set this false if you need compatibility with "
+          "Panda's old hpr calculations."));
 
 ////////////////////////////////////////////////////////////////////
 //     Function: init_liblinmath

+ 6 - 0
panda/src/mathutil/config_mathutil.cxx

@@ -26,6 +26,7 @@
 #include "boundingLine.h"
 #include "linmath_events.h"
 #include "dconfig.h"
+#include "pandaSystem.h"
 
 Configure(config_mathutil);
 NotifyCategoryDef(mathutil, "");
@@ -57,5 +58,10 @@ ConfigureFn(config_mathutil) {
   EventStoreVec2::register_with_read_factory();
   EventStoreVec3::register_with_read_factory();
   EventStoreMat4::register_with_read_factory();
+
+#ifdef HAVE_FFTW
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("fftw");
+#endif  // FFTW
 }
 

+ 1 - 0
panda/src/mesadisplay/mesagsg.h

@@ -38,6 +38,7 @@
 #endif
 #define CLP(name) Mesa##name
 #define CLASSPREFIX_QUOTED "Mesa"
+#define GLSYSTEM_NAME "Mesa"
 #define CONFIGOBJ config_mesadisplay
 #define GLCAT mesadisplay_cat
 #define EXPCL_GL EXPCL_PANDAMESA

+ 5 - 0
panda/src/net/config_net.cxx

@@ -19,6 +19,7 @@
 #include "config_net.h"
 
 #include "netDatagram.h"
+#include "pandaSystem.h"
 
 #include "dconfig.h"
 
@@ -47,9 +48,13 @@ init_libnet() {
   initialized = true;
 
   NetDatagram::init_type();
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("NSPR");
 }
 
 
+
 // The following two maximum queue sizes are totally arbitrary and
 // serve only to provide sanity caps on the various queues in the net
 // package.  You can set them to any sane values you like.  Also see

+ 1 - 1
panda/src/pgraph/config_pgraph.cxx

@@ -343,6 +343,6 @@ init_libpgraph() {
   TransformState::register_with_read_factory();
   TransparencyAttrib::register_with_read_factory();
 
-  LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
+  LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_global_ptr();
   reg->register_type(new LoaderFileTypeBam);
 }

+ 5 - 5
panda/src/pgraph/loader.cxx

@@ -104,7 +104,7 @@ find_all_files(const Filename &filename, const DSearchPath &search_path,
 
   if (!extension.empty()) {
     // If the extension is not empty, it specifies a single file type.
-    LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
+    LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_global_ptr();
     LoaderFileType *requested_type =
       reg->get_type_from_extension(extension);
 
@@ -132,7 +132,7 @@ find_all_files(const Filename &filename, const DSearchPath &search_path,
   } else {
     // If the extension *is* empty, we have to search for all possible
     // file types.
-    LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
+    LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_global_ptr();
     int num_types = reg->get_num_types();
 
     if (!filename.is_local()) {
@@ -332,7 +332,7 @@ load_file_types() {
         // Multiple words: the first n words are filename extensions,
         // and the last word is the name of the library to load should
         // any of those filename extensions be encountered.
-        LoaderFileTypeRegistry *registry = LoaderFileTypeRegistry::get_ptr();
+        LoaderFileTypeRegistry *registry = LoaderFileTypeRegistry::get_global_ptr();
         size_t num_extensions = words.size() - 1;
         string library_name = words[num_extensions];
         
@@ -424,7 +424,7 @@ load_file(const Filename &filename, bool search) const {
     // unknown file type.  Report a useful message either way.
     string extension = filename.get_extension();
     if (!extension.empty()) {
-      LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
+      LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_global_ptr();
       LoaderFileType *requested_type =
         reg->get_type_from_extension(extension);
       if (requested_type == (LoaderFileType *)NULL) {
@@ -433,7 +433,7 @@ load_file(const Filename &filename, bool search) const {
           << " is unrecognized; cannot load.\n";
         loader_cat.error(false)
           << "Currently known scene file types are:\n";
-        reg->write_types(loader_cat.error(false), 2);
+        reg->write(loader_cat.error(false), 2);
         return NULL;
       }
     }

+ 1 - 1
panda/src/pgraph/loaderFileType.cxx

@@ -41,7 +41,7 @@ LoaderFileType::
 
 ////////////////////////////////////////////////////////////////////
 //     Function: LoaderFileType::get_additional_extensions
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Returns a space-separated list of extension, in
 //               addition to the one returned by get_extension(), that
 //               are recognized by this loader.

+ 2 - 0
panda/src/pgraph/loaderFileType.h

@@ -41,10 +41,12 @@ protected:
 public:
   virtual ~LoaderFileType();
 
+PUBLISHED:
   virtual string get_name() const=0;
   virtual string get_extension() const=0;
   virtual string get_additional_extensions() const;
 
+public:
   virtual PT(PandaNode) load_file(const Filename &path, bool report_errors) const;
 
 public:

+ 80 - 80
panda/src/pgraph/loaderFileTypeRegistry.cxx

@@ -47,22 +47,78 @@ LoaderFileTypeRegistry::
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: LoaderFileTypeRegistry::get_ptr
-//       Access: Public, Static
-//  Description: Returns a pointer to the global LoaderFileTypeRegistry
-//               object.
+//     Function: LoaderFileTypeRegistry::register_type
+//       Access: Public
+//  Description: Defines a new LoaderFileType in the universe.
 ////////////////////////////////////////////////////////////////////
-LoaderFileTypeRegistry *LoaderFileTypeRegistry::
-get_ptr() {
-  if (_global_ptr == (LoaderFileTypeRegistry *)NULL) {
-    _global_ptr = new LoaderFileTypeRegistry;
+void LoaderFileTypeRegistry::
+register_type(LoaderFileType *type) {
+  // Make sure we haven't already registered this type.
+  if (find(_types.begin(), _types.end(), type) != _types.end()) {
+    loader_cat->debug()
+      << "Attempt to register LoaderFileType " << type->get_name()
+      << " (" << type->get_type() << ") more than once.\n";
+    return;
+  }
+
+  _types.push_back(type);
+
+  record_extension(type->get_extension(), type);
+
+  vector_string words;
+  extract_words(type->get_additional_extensions(), words);
+  vector_string::const_iterator wi;
+  for (wi = words.begin(); wi != words.end(); ++wi) {
+    record_extension(*wi, type);
   }
-  return _global_ptr;
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: LoaderFileTypeRegistry::get_num_types
+//     Function: LoaderFileTypeRegistry::register_deferred_type
 //       Access: Public
+//  Description: Records a type associated with a particular extension
+//               to be loaded in the future.  The named library will
+//               be dynamically loaded the first time files of this
+//               extension are loaded; presumably this library will
+//               call register_type() when it initializes, thus making
+//               the extension loadable.
+////////////////////////////////////////////////////////////////////
+void LoaderFileTypeRegistry::
+register_deferred_type(const string &extension, const string &library) {
+  string dcextension = downcase(extension);
+
+  Extensions::const_iterator ei;
+  ei = _extensions.find(dcextension);
+  if (ei != _extensions.end()) {
+    // We already have a loader for this type; no need to register
+    // another one.
+    loader_cat->debug()
+      << "Attempt to register loader library " << library
+      << " (" << dcextension << ") when extension is already known.\n";
+    return;
+  }
+
+  DeferredTypes::const_iterator di;
+  di = _deferred_types.find(dcextension);
+  if (di != _deferred_types.end()) {
+    if ((*di).second == library) {
+      loader_cat->debug()
+        << "Attempt to register loader library " << library
+        << " (" << dcextension << ") more than once.\n";
+      return;
+    } else {
+      loader_cat->debug()
+        << "Multiple libraries registered that use the extension "
+        << dcextension << "\n";
+    }
+  }
+
+  _deferred_types[dcextension] = library;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LoaderFileTypeRegistry::get_num_types
+//       Access: Published
 //  Description: Returns the total number of types registered.
 ////////////////////////////////////////////////////////////////////
 int LoaderFileTypeRegistry::
@@ -72,7 +128,7 @@ get_num_types() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: LoaderFileTypeRegistry::get_type
-//       Access: Public
+//       Access: Published
 //  Description: Returns the nth type registered.
 ////////////////////////////////////////////////////////////////////
 LoaderFileType *LoaderFileTypeRegistry::
@@ -83,7 +139,7 @@ get_type(int n) const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: LoaderFileTypeRegistry::get_type_from_extension
-//       Access: Public
+//       Access: Published
 //  Description: Determines the type of the file based on the indicated
 //               extension (without a leading dot).  Returns NULL if
 //               the extension matches no known file types.
@@ -133,13 +189,13 @@ get_type_from_extension(const string &extension) {
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: LoaderFileTypeRegistry::write_types
-//       Access: Public
+//     Function: LoaderFileTypeRegistry::write
+//       Access: Published
 //  Description: Writes a list of supported file types to the
 //               indicated output stream, one per line.
 ////////////////////////////////////////////////////////////////////
 void LoaderFileTypeRegistry::
-write_types(ostream &out, int indent_level) const {
+write(ostream &out, int indent_level) const {
   if (_types.empty()) {
     indent(out, indent_level) << "(No file types are known).\n";
   } else {
@@ -165,73 +221,17 @@ write_types(ostream &out, int indent_level) const {
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: LoaderFileTypeRegistry::register_type
-//       Access: Public
-//  Description: Defines a new LoaderFileType in the universe.
-////////////////////////////////////////////////////////////////////
-void LoaderFileTypeRegistry::
-register_type(LoaderFileType *type) {
-  // Make sure we haven't already registered this type.
-  if (find(_types.begin(), _types.end(), type) != _types.end()) {
-    loader_cat->debug()
-      << "Attempt to register LoaderFileType " << type->get_name()
-      << " (" << type->get_type() << ") more than once.\n";
-    return;
-  }
-
-  _types.push_back(type);
-
-  record_extension(type->get_extension(), type);
-
-  vector_string words;
-  extract_words(type->get_additional_extensions(), words);
-  vector_string::const_iterator wi;
-  for (wi = words.begin(); wi != words.end(); ++wi) {
-    record_extension(*wi, type);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: LoaderFileTypeRegistry::register_deferred_type
-//       Access: Public
-//  Description: Records a type associated with a particular extension
-//               to be loaded in the future.  The named library will
-//               be dynamically loaded the first time files of this
-//               extension are loaded; presumably this library will
-//               call register_type() when it initializes, thus making
-//               the extension loadable.
+//     Function: LoaderFileTypeRegistry::get_global_ptr
+//       Access: Published, Static
+//  Description: Returns a pointer to the global LoaderFileTypeRegistry
+//               object.
 ////////////////////////////////////////////////////////////////////
-void LoaderFileTypeRegistry::
-register_deferred_type(const string &extension, const string &library) {
-  string dcextension = downcase(extension);
-
-  Extensions::const_iterator ei;
-  ei = _extensions.find(dcextension);
-  if (ei != _extensions.end()) {
-    // We already have a loader for this type; no need to register
-    // another one.
-    loader_cat->debug()
-      << "Attempt to register loader library " << library
-      << " (" << dcextension << ") when extension is already known.\n";
-    return;
-  }
-
-  DeferredTypes::const_iterator di;
-  di = _deferred_types.find(dcextension);
-  if (di != _deferred_types.end()) {
-    if ((*di).second == library) {
-      loader_cat->debug()
-        << "Attempt to register loader library " << library
-        << " (" << dcextension << ") more than once.\n";
-      return;
-    } else {
-      loader_cat->debug()
-        << "Multiple libraries registered that use the extension "
-        << dcextension << "\n";
-    }
+LoaderFileTypeRegistry *LoaderFileTypeRegistry::
+get_global_ptr() {
+  if (_global_ptr == (LoaderFileTypeRegistry *)NULL) {
+    _global_ptr = new LoaderFileTypeRegistry;
   }
-
-  _deferred_types[dcextension] = library;
+  return _global_ptr;
 }
 
 ////////////////////////////////////////////////////////////////////

+ 5 - 5
panda/src/pgraph/loaderFileTypeRegistry.h

@@ -39,17 +39,17 @@ protected:
 public:
   ~LoaderFileTypeRegistry();
 
-  static LoaderFileTypeRegistry *get_ptr();
+  void register_type(LoaderFileType *type);
+  void register_deferred_type(const string &extension, const string &library);
 
+PUBLISHED:
   int get_num_types() const;
   LoaderFileType *get_type(int n) const;
-
   LoaderFileType *get_type_from_extension(const string &extension);
 
-  void write_types(ostream &out, int indent_level = 0) const;
+  void write(ostream &out, int indent_level = 0) const;
 
-  void register_type(LoaderFileType *type);
-  void register_deferred_type(const string &extension, const string &library);
+  static LoaderFileTypeRegistry *get_global_ptr();
 
 private:
   void record_extension(const string &extension, LoaderFileType *type);

+ 3 - 3
panda/src/pnmimage/pnmFileType.cxx

@@ -46,7 +46,7 @@ PNMFileType::
 
 ////////////////////////////////////////////////////////////////////
 //     Function: PNMFileType::get_num_extensions
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Returns the number of different possible filename
 //               extensions associated with this particular file type.
 ////////////////////////////////////////////////////////////////////
@@ -57,7 +57,7 @@ get_num_extensions() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: PNMFileType::get_extension
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Returns the nth possible filename extension
 //               associated with this particular file type, without a
 //               leading dot.
@@ -70,7 +70,7 @@ get_extension(int) const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: PNMFileType::get_suggested_extension
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Returns a suitable filename extension (without a
 //               leading dot) to suggest for files of this type, or
 //               empty string if no suggestions are available.

+ 2 - 0
panda/src/pnmimage/pnmFileType.h

@@ -43,12 +43,14 @@ protected:
 public:
   virtual ~PNMFileType();
 
+PUBLISHED:
   virtual string get_name() const=0;
 
   virtual int get_num_extensions() const;
   virtual string get_extension(int n) const;
   virtual string get_suggested_extension() const;
 
+public:
   virtual bool has_magic_number() const;
   virtual bool matches_magic_number(const string &magic_number) const;
 

+ 53 - 53
panda/src/pnmimage/pnmFileTypeRegistry.cxx

@@ -48,22 +48,49 @@ PNMFileTypeRegistry::
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: PNMFileTypeRegistry::get_ptr
-//       Access: Public, Static
-//  Description: Returns a pointer to the global PNMFileTypeRegistry
-//               object.
+//     Function: PNMFileTypeRegistry::register_type
+//       Access: Public
+//  Description: Defines a new PNMFileType in the universe.
 ////////////////////////////////////////////////////////////////////
-PNMFileTypeRegistry *PNMFileTypeRegistry::
-get_ptr() {
-  if (_global_ptr == (PNMFileTypeRegistry *)NULL) {
-    _global_ptr = new PNMFileTypeRegistry;
+void PNMFileTypeRegistry::
+register_type(PNMFileType *type) {
+  // Make sure we haven't already registered this type.
+  Handles::iterator hi = _handles.find(type->get_type());
+  if (hi != _handles.end()) {
+    pnmimage_cat.warning()
+      << "Attempt to register PNMFileType " << type->get_name()
+      << " (" << type->get_type() << ") more than once.\n";
+    return;
   }
-  return _global_ptr;
+
+  _types.push_back(type);
+  _handles.insert(Handles::value_type(type->get_type(), type));
+
+  // Collect the unique extensions associated with the type.
+  pset<string> unique_extensions;
+  int num_extensions = type->get_num_extensions();
+  for (int i = 0; i < num_extensions; i++) {
+    string extension = downcase(type->get_extension(i));
+
+    if (!unique_extensions.insert(extension).second) {
+      pnmimage_cat.warning()
+        << "PNMFileType " << type->get_name()
+        << " (" << type->get_type() << ") defined extension "
+        << extension << " more than once.\n";
+    }
+  }
+
+  pset<string>::iterator ui;
+  for (ui = unique_extensions.begin(); ui != unique_extensions.end(); ++ui) {
+    _extensions[*ui].push_back(type);
+  }
+
+  _requires_sort = true;
 }
 
 ////////////////////////////////////////////////////////////////////
 //     Function: PNMFileTypeRegistry::get_num_types
-//       Access: Public
+//       Access: Published
 //  Description: Returns the total number of types registered.
 ////////////////////////////////////////////////////////////////////
 int PNMFileTypeRegistry::
@@ -76,7 +103,7 @@ get_num_types() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: PNMFileTypeRegistry::get_type
-//       Access: Public
+//       Access: Published
 //  Description: Returns the nth type registered.
 ////////////////////////////////////////////////////////////////////
 PNMFileType *PNMFileTypeRegistry::
@@ -87,7 +114,7 @@ get_type(int n) const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: PNMFileTypeRegistry::get_type_from_extension
-//       Access: Public
+//       Access: Published
 //  Description: Tries to determine what the PNMFileType is likely to
 //               be for a particular image file based on its
 //               extension.  Returns a suitable PNMFileType pointer,
@@ -132,7 +159,7 @@ get_type_from_extension(const string &filename) const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: PNMFileTypeRegistry::get_type_from_magic_number
-//       Access: Public
+//       Access: Published
 //  Description: Tries to determine what the PNMFileType is likely to
 //               be for a particular image file based on its
 //               magic number, the first two bytes read from the
@@ -159,7 +186,7 @@ get_type_from_magic_number(const string &magic_number) const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: PNMFileTypeRegistry::get_type_by_handle
-//       Access: Public
+//       Access: Published
 //  Description: Returns the PNMFileType instance stored in the
 //               registry for the given TypeHandle, e.g. as retrieved
 //               by a previous call to get_type() on the type
@@ -177,13 +204,13 @@ get_type_by_handle(TypeHandle handle) const {
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: PNMFileTypeRegistry::write_types
-//       Access: Public
+//     Function: PNMFileTypeRegistry::write
+//       Access: Published
 //  Description: Writes a list of supported image file types to the
 //               indicated output stream, one per line.
 ////////////////////////////////////////////////////////////////////
 void PNMFileTypeRegistry::
-write_types(ostream &out, int indent_level) const {
+write(ostream &out, int indent_level) const {
   if (_types.empty()) {
     indent(out, indent_level) << "(No image types are known).\n";
   } else {
@@ -209,44 +236,17 @@ write_types(ostream &out, int indent_level) const {
 }
 
 ////////////////////////////////////////////////////////////////////
-//     Function: PNMFileTypeRegistry::register_type
-//       Access: Public
-//  Description: Defines a new PNMFileType in the universe.
+//     Function: PNMFileTypeRegistry::get_global_ptr
+//       Access: Published, Static
+//  Description: Returns a pointer to the global PNMFileTypeRegistry
+//               object.
 ////////////////////////////////////////////////////////////////////
-void PNMFileTypeRegistry::
-register_type(PNMFileType *type) {
-  // Make sure we haven't already registered this type.
-  Handles::iterator hi = _handles.find(type->get_type());
-  if (hi != _handles.end()) {
-    pnmimage_cat.warning()
-      << "Attempt to register PNMFileType " << type->get_name()
-      << " (" << type->get_type() << ") more than once.\n";
-    return;
-  }
-
-  _types.push_back(type);
-  _handles.insert(Handles::value_type(type->get_type(), type));
-
-  // Collect the unique extensions associated with the type.
-  pset<string> unique_extensions;
-  int num_extensions = type->get_num_extensions();
-  for (int i = 0; i < num_extensions; i++) {
-    string extension = downcase(type->get_extension(i));
-
-    if (!unique_extensions.insert(extension).second) {
-      pnmimage_cat.warning()
-        << "PNMFileType " << type->get_name()
-        << " (" << type->get_type() << ") defined extension "
-        << extension << " more than once.\n";
-    }
-  }
-
-  pset<string>::iterator ui;
-  for (ui = unique_extensions.begin(); ui != unique_extensions.end(); ++ui) {
-    _extensions[*ui].push_back(type);
+PNMFileTypeRegistry *PNMFileTypeRegistry::
+get_global_ptr() {
+  if (_global_ptr == (PNMFileTypeRegistry *)NULL) {
+    _global_ptr = new PNMFileTypeRegistry;
   }
-
-  _requires_sort = true;
+  return _global_ptr;
 }
 
 ////////////////////////////////////////////////////////////////////

+ 4 - 3
panda/src/pnmimage/pnmFileTypeRegistry.h

@@ -37,8 +37,9 @@ protected:
 public:
   ~PNMFileTypeRegistry();
 
-  static PNMFileTypeRegistry *get_ptr();
+  void register_type(PNMFileType *type);
 
+PUBLISHED:
   int get_num_types() const;
   PNMFileType *get_type(int n) const;
 
@@ -46,9 +47,9 @@ public:
   PNMFileType *get_type_from_magic_number(const string &magic_number) const;
   PNMFileType *get_type_by_handle(TypeHandle handle) const;
 
-  void write_types(ostream &out, int indent_level = 0) const;
+  void write(ostream &out, int indent_level = 0) const;
 
-  void register_type(PNMFileType *type);
+  static PNMFileTypeRegistry *get_global_ptr();
 
 private:
   void sort_preferences();

+ 5 - 5
panda/src/pnmimage/pnmImageHeader.cxx

@@ -144,7 +144,7 @@ make_reader(istream *file, bool owns_file, const Filename &filename,
       return NULL;
     }
 
-    type = PNMFileTypeRegistry::get_ptr()->
+    type = PNMFileTypeRegistry::get_global_ptr()->
       get_type_from_magic_number(magic_number);
 
     if (pnmimage_cat.is_debug()) {
@@ -162,7 +162,7 @@ make_reader(istream *file, bool owns_file, const Filename &filename,
   if (type == (PNMFileType *)NULL && !filename.empty()) {
     // We still don't know the type; attempt to guess it from the
     // filename extension.
-    type = PNMFileTypeRegistry::get_ptr()->get_type_from_extension(filename);
+    type = PNMFileTypeRegistry::get_global_ptr()->get_type_from_extension(filename);
 
     if (pnmimage_cat.is_debug()) {
       if (type != (PNMFileType *)NULL) {
@@ -192,8 +192,8 @@ make_reader(istream *file, bool owns_file, const Filename &filename,
       pnmimage_cat.error()
         << "Cannot determine type of image file " << filename << ".\n"
         << "Currently supported image types:\n";
-      PNMFileTypeRegistry::get_ptr()->
-        write_types(pnmimage_cat.error(false), 2);
+      PNMFileTypeRegistry::get_global_ptr()->
+        write(pnmimage_cat.error(false), 2);
     }
     if (owns_file) {
       VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
@@ -306,7 +306,7 @@ make_writer(ostream *file, bool owns_file, const Filename &filename,
   if (type == (PNMFileType *)NULL && !filename.empty()) {
     // We don't know the type; attempt to guess it from the filename
     // extension.
-    type = PNMFileTypeRegistry::get_ptr()->get_type_from_extension(filename);
+    type = PNMFileTypeRegistry::get_global_ptr()->get_type_from_extension(filename);
 
     if (pnmimage_cat.is_debug()) {
       if (type != (PNMFileType *)NULL) {

+ 15 - 1
panda/src/pnmimagetypes/config_pnmimagetypes.cxx

@@ -32,6 +32,7 @@
 #include "pnmFileTypeRegistry.h"
 #include "string_utils.h"
 #include "dconfig.h"
+#include "pandaSystem.h"
 
 Configure(config_pnmimagetypes);
 NotifyCategoryDefName(pnmimage_sgi, "sgi", pnmimage_cat);
@@ -209,7 +210,7 @@ init_libpnmimagetypes() {
 #endif
 
   // Register each type with the PNMFileTypeRegistry.
-  PNMFileTypeRegistry *tr = PNMFileTypeRegistry::get_ptr();
+  PNMFileTypeRegistry *tr = PNMFileTypeRegistry::get_global_ptr();
 
   tr->register_type(new PNMFileTypeSGI);
   tr->register_type(new PNMFileTypeAlias);
@@ -243,4 +244,17 @@ init_libpnmimagetypes() {
 #ifdef HAVE_TIFF
   PNMFileTypeTIFF::register_with_read_factory();
 #endif
+
+  // And register with the PandaSystem.
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+
+#ifdef HAVE_JPEG
+  ps->add_system("libjpeg");
+#endif
+#ifdef HAVE_PNG
+  ps->add_system("libpng");
+#endif
+#ifdef HAVE_TIFF
+  ps->add_system("libtiff");
+#endif
 }

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypeAlias.cxx

@@ -416,5 +416,5 @@ register_with_read_factory() {
 ////////////////////////////////////////////////////////////////////
 TypedWritable *PNMFileTypeAlias::
 make_PNMFileTypeAlias(const FactoryParams &params) {
-  return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
+  return PNMFileTypeRegistry::get_global_ptr()->get_type_by_handle(get_class_type());
 }

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypeBMP.cxx

@@ -161,5 +161,5 @@ register_with_read_factory() {
 ////////////////////////////////////////////////////////////////////
 TypedWritable *PNMFileTypeBMP::
 make_PNMFileTypeBMP(const FactoryParams &params) {
-  return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
+  return PNMFileTypeRegistry::get_global_ptr()->get_type_by_handle(get_class_type());
 }

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypeIMG.cxx

@@ -375,5 +375,5 @@ register_with_read_factory() {
 ////////////////////////////////////////////////////////////////////
 TypedWritable *PNMFileTypeIMG::
 make_PNMFileTypeIMG(const FactoryParams &params) {
-  return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
+  return PNMFileTypeRegistry::get_global_ptr()->get_type_by_handle(get_class_type());
 }

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypeJPG.cxx

@@ -165,7 +165,7 @@ register_with_read_factory() {
 ////////////////////////////////////////////////////////////////////
 TypedWritable *PNMFileTypeJPG::
 make_PNMFileTypeJPG(const FactoryParams &params) {
-  return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
+  return PNMFileTypeRegistry::get_global_ptr()->get_type_by_handle(get_class_type());
 }
 
 #endif  // HAVE_JPEG

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypePNG.cxx

@@ -183,7 +183,7 @@ register_with_read_factory() {
 ////////////////////////////////////////////////////////////////////
 TypedWritable *PNMFileTypePNG::
 make_PNMFileTypePNG(const FactoryParams &params) {
-  return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
+  return PNMFileTypeRegistry::get_global_ptr()->get_type_by_handle(get_class_type());
 }
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypeSGI.cxx

@@ -165,5 +165,5 @@ register_with_read_factory() {
 ////////////////////////////////////////////////////////////////////
 TypedWritable *PNMFileTypeSGI::
 make_PNMFileTypeSGI(const FactoryParams &params) {
-  return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
+  return PNMFileTypeRegistry::get_global_ptr()->get_type_by_handle(get_class_type());
 }

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypeSoftImage.cxx

@@ -789,5 +789,5 @@ register_with_read_factory() {
 ////////////////////////////////////////////////////////////////////
 TypedWritable *PNMFileTypeSoftImage::
 make_PNMFileTypeSoftImage(const FactoryParams &params) {
-  return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
+  return PNMFileTypeRegistry::get_global_ptr()->get_type_by_handle(get_class_type());
 }

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypeTGA.cxx

@@ -593,7 +593,7 @@ register_with_read_factory() {
 ////////////////////////////////////////////////////////////////////
 TypedWritable *PNMFileTypeTGA::
 make_PNMFileTypeTGA(const FactoryParams &params) {
-  return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
+  return PNMFileTypeRegistry::get_global_ptr()->get_type_by_handle(get_class_type());
 }
 
 void PNMFileTypeTGA::Reader::

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx

@@ -1091,7 +1091,7 @@ register_with_read_factory() {
 ////////////////////////////////////////////////////////////////////
 TypedWritable *PNMFileTypeTIFF::
 make_PNMFileTypeTIFF(const FactoryParams &params) {
-  return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
+  return PNMFileTypeRegistry::get_global_ptr()->get_type_by_handle(get_class_type());
 }
 
 #endif  // HAVE_TIFF

+ 4 - 0
panda/src/text/config_text.cxx

@@ -25,6 +25,7 @@
 #include "dynamicTextPage.h"
 #include "geomTextGlyph.h"
 #include "unicodeLatinMap.h"
+#include "pandaSystem.h"
 
 #include "dconfig.h"
 #include "config_express.h"
@@ -167,5 +168,8 @@ init_libtext() {
   DynamicTextPage::init_type();
   GeomTextGlyph::init_type();
   GeomTextGlyph::register_with_read_factory();
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->add_system("Freetype");
 #endif
 }

+ 4 - 0
panda/src/wgldisplay/config_wgldisplay.cxx

@@ -23,6 +23,7 @@
 #include "wglGraphicsWindow.h"
 #include "graphicsPipeSelection.h"
 #include "dconfig.h"
+#include "pandaSystem.h"
 
 Configure(config_wgldisplay);
 NotifyCategoryDef(wgldisplay, "windisplay");
@@ -70,4 +71,7 @@ init_libwgldisplay() {
   GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
   selection->add_pipe_type(wglGraphicsPipe::get_class_type(),
                            wglGraphicsPipe::pipe_constructor);
+
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->set_system_tag("OpenGL", "window_system", "WGL");
 }

+ 1 - 1
pandatool/src/mayaprogs/config_mayaloader.cxx

@@ -50,7 +50,7 @@ init_libmayaloader() {
 
   LoaderFileTypePandatool::init_type();
 
-  LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
+  LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_global_ptr();
 
   init_libmayaegg();
   MayaToEggConverter *maya = new MayaToEggConverter;

+ 1 - 1
pandatool/src/palettizer/pal_string_utils.cxx

@@ -55,7 +55,7 @@ extract_param_value(const string &str, string &param, string &value) {
 bool
 parse_image_type_request(const string &word, PNMFileType *&color_type,
                          PNMFileType *&alpha_type) {
-  PNMFileTypeRegistry *registry = PNMFileTypeRegistry::get_ptr();
+  PNMFileTypeRegistry *registry = PNMFileTypeRegistry::get_global_ptr();
   color_type = (PNMFileType *)NULL;
   alpha_type = (PNMFileType *)NULL;
 

+ 1 - 1
pandatool/src/palettizer/palettizer.cxx

@@ -112,7 +112,7 @@ Palettizer() {
   _coverage_threshold = 2.5;
   _aggressively_clean_mapdir = true;
   _force_power_2 = true;
-  _color_type = PNMFileTypeRegistry::get_ptr()->get_type_from_extension("rgb");
+  _color_type = PNMFileTypeRegistry::get_global_ptr()->get_type_from_extension("rgb");
   _alpha_type = (PNMFileType *)NULL;
   _shadow_color_type = (PNMFileType *)NULL;
   _shadow_alpha_type = (PNMFileType *)NULL;

+ 2 - 2
pandatool/src/palettizer/txaFile.cxx

@@ -413,7 +413,7 @@ parse_imagetype_line(const vector_string &words) {
   const string &imagetype = words[1];
   if (!parse_image_type_request(imagetype, pal->_color_type, pal->_alpha_type)) {
     nout << "\nKnown image types are:\n";
-    PNMFileTypeRegistry::get_ptr()->write_types(nout, 2);
+    PNMFileTypeRegistry::get_global_ptr()->write(nout, 2);
     nout << "\n";
     return false;
   }
@@ -439,7 +439,7 @@ parse_shadowtype_line(const vector_string &words) {
   if (!parse_image_type_request(shadowtype, pal->_shadow_color_type,
                                 pal->_shadow_alpha_type)) {
     nout << "\nKnown image types are:\n";
-    PNMFileTypeRegistry::get_ptr()->write_types(nout, 2);
+    PNMFileTypeRegistry::get_global_ptr()->write(nout, 2);
     nout << "\n";
     return false;
   }

+ 2 - 2
pandatool/src/progbase/programBase.cxx

@@ -1168,14 +1168,14 @@ bool ProgramBase::
 dispatch_image_type(const string &opt, const string &arg, void *var) {
   PNMFileType **ip = (PNMFileType **)var;
 
-  PNMFileTypeRegistry *reg = PNMFileTypeRegistry::get_ptr();
+  PNMFileTypeRegistry *reg = PNMFileTypeRegistry::get_global_ptr();
 
   (*ip) = reg->get_type_from_extension(arg);
 
   if ((*ip) == (PNMFileType *)NULL) {
     nout << "Invalid image type for -" << opt << ": " << arg << "\n"
          << "The following image types are known:\n";
-    reg->write_types(nout, 2);
+    reg->write(nout, 2);
     return false;
   }
 

+ 1 - 1
pandatool/src/ptloader/config_ptloader.cxx

@@ -68,7 +68,7 @@ init_libptloader() {
 
   LoaderFileTypePandatool::init_type();
 
-  LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
+  LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_global_ptr();
 
   init_liblwo();
   FltToEggConverter *flt = new FltToEggConverter;