Browse Source

*** empty log message ***

David Rose 24 years ago
parent
commit
031018bcb2

+ 19 - 0
pandatool/src/flt/config_flt.cxx

@@ -48,6 +48,25 @@ NotifyCategoryDef(flt, "");
 const bool flt_error_abort = config_flt.GetBool("flt-error-abort", false);
 const bool flt_error_abort = config_flt.GetBool("flt-error-abort", false);
 
 
 ConfigureFn(config_flt) {
 ConfigureFn(config_flt) {
+  init_libflt();
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: init_libflt
+//  Description: Initializes the library.  This must be called at
+//               least once before any of the functions or classes in
+//               this library can be used.  Normally it will be
+//               called by the static initializers and need not be
+//               called explicitly, but special cases exist.
+////////////////////////////////////////////////////////////////////
+void
+init_libflt() {
+  static bool initialized = false;
+  if (initialized) {
+    return;
+  }
+  initialized = true;
+
   FltRecord::init_type();
   FltRecord::init_type();
   FltBead::init_type();
   FltBead::init_type();
   FltBeadID::init_type();
   FltBeadID::init_type();

+ 2 - 0
pandatool/src/flt/config_flt.h

@@ -14,4 +14,6 @@ NotifyCategoryDeclNoExport(flt);
 
 
 extern const bool flt_error_abort;
 extern const bool flt_error_abort;
 
 
+extern void init_libflt();
+
 #endif
 #endif

+ 1 - 1
pandatool/src/lwo/Sources.pp

@@ -1,6 +1,6 @@
 #define LOCAL_LIBS pandatoolbase
 #define LOCAL_LIBS pandatoolbase
 #define OTHER_LIBS \
 #define OTHER_LIBS \
-  mathutil:c linmath:c putil:c express:c panda:m dtoolconfig dtool
+  mathutil:c linmath:c putil:c express:c panda:m pandaexpress:m dtoolconfig dtool
 #define UNIX_SYS_LIBS \
 #define UNIX_SYS_LIBS \
   m
   m
 
 

+ 19 - 0
pandatool/src/lwo/config_lwo.cxx

@@ -46,6 +46,25 @@
 Configure(config_lwo);
 Configure(config_lwo);
 
 
 ConfigureFn(config_lwo) {
 ConfigureFn(config_lwo) {
+  init_liblwo();
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: init_liblwo
+//  Description: Initializes the library.  This must be called at
+//               least once before any of the functions or classes in
+//               this library can be used.  Normally it will be
+//               called by the static initializers and need not be
+//               called explicitly, but special cases exist.
+////////////////////////////////////////////////////////////////////
+void
+init_liblwo() {
+  static bool initialized = false;
+  if (initialized) {
+    return;
+  }
+  initialized = true;
+
   IffChunk::init_type();
   IffChunk::init_type();
   IffGenericChunk::init_type();
   IffGenericChunk::init_type();
   IffInputFile::init_type();
   IffInputFile::init_type();

+ 2 - 0
pandatool/src/lwo/config_lwo.h

@@ -8,4 +8,6 @@
 
 
 #include <pandatoolbase.h>
 #include <pandatoolbase.h>
 
 
+extern void init_liblwo();
+
 #endif
 #endif

+ 4 - 0
pandatool/src/ptloader/config_ptloader.cxx

@@ -6,7 +6,9 @@
 #include "config_ptloader.h"
 #include "config_ptloader.h"
 #include "loaderFileTypePandatool.h"
 #include "loaderFileTypePandatool.h"
 
 
+#include <config_lwo.h>
 #include <fltToEggConverter.h>
 #include <fltToEggConverter.h>
+#include <config_flt.h>
 #include <lwoToEggConverter.h>
 #include <lwoToEggConverter.h>
 
 
 #include <dconfig.h>
 #include <dconfig.h>
@@ -39,9 +41,11 @@ init_libptloader() {
 
 
   LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
   LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
 
 
+  init_liblwo();
   FltToEggConverter *flt = new FltToEggConverter;
   FltToEggConverter *flt = new FltToEggConverter;
   reg->register_type(new LoaderFileTypePandatool(flt));
   reg->register_type(new LoaderFileTypePandatool(flt));
 
 
+  init_libflt();
   LwoToEggConverter *lwo = new LwoToEggConverter;
   LwoToEggConverter *lwo = new LwoToEggConverter;
   reg->register_type(new LoaderFileTypePandatool(lwo));
   reg->register_type(new LoaderFileTypePandatool(lwo));
 }
 }