From 031018bcb2ec48edf7ae6775fa0ec7561110e255 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 28 Apr 2001 01:02:53 +0000 Subject: [PATCH] *** empty log message *** --- pandatool/src/flt/config_flt.cxx | 19 +++++++++++++++++++ pandatool/src/flt/config_flt.h | 2 ++ pandatool/src/lwo/Sources.pp | 2 +- pandatool/src/lwo/config_lwo.cxx | 19 +++++++++++++++++++ pandatool/src/lwo/config_lwo.h | 2 ++ pandatool/src/ptloader/config_ptloader.cxx | 4 ++++ 6 files changed, 47 insertions(+), 1 deletion(-) diff --git a/pandatool/src/flt/config_flt.cxx b/pandatool/src/flt/config_flt.cxx index d739c99775..6cba726f9d 100644 --- a/pandatool/src/flt/config_flt.cxx +++ b/pandatool/src/flt/config_flt.cxx @@ -48,6 +48,25 @@ NotifyCategoryDef(flt, ""); const bool flt_error_abort = config_flt.GetBool("flt-error-abort", false); 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(); FltBead::init_type(); FltBeadID::init_type(); diff --git a/pandatool/src/flt/config_flt.h b/pandatool/src/flt/config_flt.h index e6f274bb83..37d09efd0a 100644 --- a/pandatool/src/flt/config_flt.h +++ b/pandatool/src/flt/config_flt.h @@ -14,4 +14,6 @@ NotifyCategoryDeclNoExport(flt); extern const bool flt_error_abort; +extern void init_libflt(); + #endif diff --git a/pandatool/src/lwo/Sources.pp b/pandatool/src/lwo/Sources.pp index b0e098618e..56e3b692ea 100644 --- a/pandatool/src/lwo/Sources.pp +++ b/pandatool/src/lwo/Sources.pp @@ -1,6 +1,6 @@ #define LOCAL_LIBS pandatoolbase #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 \ m diff --git a/pandatool/src/lwo/config_lwo.cxx b/pandatool/src/lwo/config_lwo.cxx index a11061199b..916d5dc488 100644 --- a/pandatool/src/lwo/config_lwo.cxx +++ b/pandatool/src/lwo/config_lwo.cxx @@ -46,6 +46,25 @@ Configure(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(); IffGenericChunk::init_type(); IffInputFile::init_type(); diff --git a/pandatool/src/lwo/config_lwo.h b/pandatool/src/lwo/config_lwo.h index 3a46ababb5..140f7c8520 100644 --- a/pandatool/src/lwo/config_lwo.h +++ b/pandatool/src/lwo/config_lwo.h @@ -8,4 +8,6 @@ #include +extern void init_liblwo(); + #endif diff --git a/pandatool/src/ptloader/config_ptloader.cxx b/pandatool/src/ptloader/config_ptloader.cxx index 907c68bff5..2a06a16335 100644 --- a/pandatool/src/ptloader/config_ptloader.cxx +++ b/pandatool/src/ptloader/config_ptloader.cxx @@ -6,7 +6,9 @@ #include "config_ptloader.h" #include "loaderFileTypePandatool.h" +#include #include +#include #include #include @@ -39,9 +41,11 @@ init_libptloader() { LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr(); + init_liblwo(); FltToEggConverter *flt = new FltToEggConverter; reg->register_type(new LoaderFileTypePandatool(flt)); + init_libflt(); LwoToEggConverter *lwo = new LwoToEggConverter; reg->register_type(new LoaderFileTypePandatool(lwo)); }