00001 // Filename: config_ptloader.cxx 00002 // Created by: drose (26Apr01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include "config_ptloader.h" 00020 #include "loaderFileTypePandatool.h" 00021 00022 #include "config_lwo.h" 00023 #include "fltToEggConverter.h" 00024 #include "config_flt.h" 00025 #include "lwoToEggConverter.h" 00026 00027 /* 00028 #ifdef HAVE_DX 00029 #include "config_xfile.h" 00030 #include "xFileToEggConverter.h" 00031 #endif 00032 */ 00033 00034 #ifdef HAVE_MAYA 00035 #include "config_mayaegg.h" 00036 #include "mayaToEggConverter.h" 00037 #endif 00038 00039 #include "dconfig.h" 00040 #include "loaderFileTypeRegistry.h" 00041 #include "eggData.h" 00042 00043 ConfigureDef(config_ptloader); 00044 00045 ConfigureFn(config_ptloader) { 00046 init_libptloader(); 00047 } 00048 00049 //////////////////////////////////////////////////////////////////// 00050 // Function: init_libptloader 00051 // Description: Initializes the library. This must be called at 00052 // least once before any of the functions or classes in 00053 // this library can be used. Normally it will be 00054 // called by the static initializers and need not be 00055 // called explicitly, but special cases exist. 00056 //////////////////////////////////////////////////////////////////// 00057 void 00058 init_libptloader() { 00059 static bool initialized = false; 00060 if (initialized) { 00061 return; 00062 } 00063 initialized = true; 00064 00065 LoaderFileTypePandatool::init_type(); 00066 00067 LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr(); 00068 00069 init_liblwo(); 00070 FltToEggConverter *flt = new FltToEggConverter; 00071 reg->register_type(new LoaderFileTypePandatool(flt)); 00072 00073 init_libflt(); 00074 LwoToEggConverter *lwo = new LwoToEggConverter; 00075 reg->register_type(new LoaderFileTypePandatool(lwo)); 00076 00077 /* 00078 #ifdef HAVE_DX 00079 init_libxfile(); 00080 XFileToEggConverter *xfile = new XFileToEggConverter; 00081 reg->register_type(new LoaderFileTypePandatool(xfile)); 00082 #endif 00083 */ 00084 00085 #ifdef HAVE_MAYA 00086 init_libmayaegg(); 00087 MayaToEggConverter *maya = new MayaToEggConverter; 00088 reg->register_type(new LoaderFileTypePandatool(maya)); 00089 #endif 00090 }