| 1 | /* ----------------------------------------------------------------------------- |
| 2 | |
| 3 | PicoModel Library |
| 4 | |
| 5 | Copyright (c) 2002, Randy Reddig & seaw0lf |
| 6 | All rights reserved. |
| 7 | |
| 8 | Redistribution and use in source and binary forms, with or without modification, |
| 9 | are permitted provided that the following conditions are met: |
| 10 | |
| 11 | Redistributions of source code must retain the above copyright notice, this list |
| 12 | of conditions and the following disclaimer. |
| 13 | |
| 14 | Redistributions in binary form must reproduce the above copyright notice, this |
| 15 | list of conditions and the following disclaimer in the documentation and/or |
| 16 | other materials provided with the distribution. |
| 17 | |
| 18 | Neither the names of the copyright holders nor the names of its contributors may |
| 19 | be used to endorse or promote products derived from this software without |
| 20 | specific prior written permission. |
| 21 | |
| 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
| 26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 29 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | |
| 33 | ----------------------------------------------------------------------------- */ |
| 34 | |
| 35 | /* dependencies */ |
| 36 | #include "picointernal.h" |
| 37 | |
| 38 | |
| 39 | |
| 40 | /* external modules */ |
| 41 | extern const picoModule_t picoModuleMD3; |
| 42 | extern const picoModule_t picoModule3DS; |
| 43 | extern const picoModule_t picoModuleASE; |
| 44 | extern const picoModule_t picoModuleOBJ; |
| 45 | extern const picoModule_t picoModuleMS3D; |
| 46 | extern const picoModule_t picoModuleMDC; |
| 47 | extern const picoModule_t picoModuleMD2; |
| 48 | extern const picoModule_t picoModuleFM; |
| 49 | extern const picoModule_t picoModuleLWO; |
| 50 | extern const picoModule_t picoModuleTerrain; |
| 51 | extern const picoModule_t picoModuleGLTF; |
| 52 | #if defined(RADIANT_IQM_PLUGIN_picomodel) |
| 53 | extern const picoModule_t picoModuleIQM; |
| 54 | #endif // defined(RADIANT_IQM_PLUGIN_picomodel) |
| 55 | |
| 56 | |
| 57 | |
| 58 | /* list of all supported file format modules */ |
| 59 | const picoModule_t *picoModules[] = |
| 60 | { |
| 61 | &picoModuleMD3, /* quake3 arena md3 */ |
| 62 | &picoModule3DS, /* autodesk 3ds */ |
| 63 | &picoModuleASE, /* autodesk ase */ |
| 64 | &picoModuleMS3D, /* milkshape3d */ |
| 65 | &picoModuleMDC, /* return to castle wolfenstein mdc */ |
| 66 | &picoModuleMD2, /* quake2 md2 */ |
| 67 | &picoModuleFM, /* heretic2 fm */ |
| 68 | &picoModuleLWO, /* lightwave object */ |
| 69 | &picoModuleTerrain, /* picoterrain object */ |
| 70 | &picoModuleOBJ, /* wavefront object */ |
| 71 | &picoModuleGLTF, /* gltf 2.0 (gltf/glb) */ |
| 72 | #if defined(RADIANT_IQM_PLUGIN_picomodel) |
| 73 | &picoModuleIQM, /* interquake model */ |
| 74 | #endif // defined(RADIANT_IQM_PLUGIN_picomodel) |
| 75 | NULL /* arnold */ |
| 76 | }; |
| 77 | |
| 78 | |
| 79 | |
| 80 | /* |
| 81 | PicoModuleList() |
| 82 | returns a pointer to the module list and optionally stores |
| 83 | the number of supported modules in 'numModules'. Note that |
| 84 | this param can be NULL when the count is not needed. |
| 85 | */ |
| 86 | |
| 87 | const picoModule_t **PicoModuleList( int *numModules ){ |
| 88 | /* get module count */ |
| 89 | if ( numModules != NULL ) { |
| 90 | for ( ( *numModules ) = 0; picoModules[ *numModules ] != NULL; ( *numModules )++ ) ; |
| 91 | } |
| 92 | |
| 93 | /* return list of modules */ |
| 94 | return (const picoModule_t**) picoModules; |
| 95 | } |