2 Copyright (C) 2001-2006, William Joseph.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "iscenegraph.h"
24 #include "iselection.h"
28 #include "ifilesystem.h"
30 #include "ifiletypes.h"
31 #include "iscriplib.h"
33 #include "modulesystem/singletonmodule.h"
34 #include "typesystem.h"
44 class MD3ModelLoader : public ModelLoader
47 scene::Node& loadModel( ArchiveFile& file ){
48 return loadMD3Model( file );
52 class ModelDependencies :
53 public GlobalFileSystemModuleRef,
54 public GlobalOpenGLModuleRef,
55 public GlobalUndoModuleRef,
56 public GlobalSceneGraphModuleRef,
57 public GlobalShaderCacheModuleRef,
58 public GlobalSelectionModuleRef,
59 public GlobalFiletypesModuleRef
63 class ModelMD3API : public TypeSystemRef
65 MD3ModelLoader m_modelmd3;
67 typedef ModelLoader Type;
68 STRING_CONSTANT( Name, "md3" );
71 GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "md3 models", "*.md3" ) );
73 ModelLoader* getTable(){
78 typedef SingletonModule<ModelMD3API, ModelDependencies> ModelMD3Module;
80 ModelMD3Module g_ModelMD3Module;
84 class MD2ModelLoader : public ModelLoader
87 scene::Node& loadModel( ArchiveFile& file ){
88 return loadMD2Model( file );
92 class ModelMD2API : public TypeSystemRef
94 MD2ModelLoader m_modelmd2;
96 typedef ModelLoader Type;
97 STRING_CONSTANT( Name, "md2" );
100 GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "md2 models", "*.md2" ) );
102 ModelLoader* getTable(){
107 typedef SingletonModule<ModelMD2API, ModelDependencies> ModelMD2Module;
109 ModelMD2Module g_ModelMD2Module;
111 class MDLModelLoader : public ModelLoader
114 scene::Node& loadModel( ArchiveFile& file ){
115 return loadMDLModel( file );
119 class ModelMDLAPI : public TypeSystemRef
121 MDLModelLoader m_modelmdl;
123 typedef ModelLoader Type;
124 STRING_CONSTANT( Name, "mdl" );
127 GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "mdl models", "*.mdl" ) );
129 ModelLoader* getTable(){
134 typedef SingletonModule<ModelMDLAPI, ModelDependencies> ModelMDLModule;
136 ModelMDLModule g_ModelMDLModule;
138 class MDCModelLoader : public ModelLoader
141 scene::Node& loadModel( ArchiveFile& file ){
142 return loadMDCModel( file );
146 class ModelMDCAPI : public TypeSystemRef
148 MDCModelLoader m_modelmdc;
150 typedef ModelLoader Type;
151 STRING_CONSTANT( Name, "mdc" );
154 GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "mdc models", "*.mdc" ) );
156 ModelLoader* getTable(){
161 typedef SingletonModule<ModelMDCAPI, ModelDependencies> ModelMDCModule;
163 ModelMDCModule g_ModelMDCModule;
168 _QERPlugImageTable m_imagemdl;
170 typedef _QERPlugImageTable Type;
171 STRING_CONSTANT( Name, "mdl" );
174 m_imagemdl.loadImage = &LoadMDLImage;
176 _QERPlugImageTable* getTable(){
181 typedef SingletonModule<ImageMDLAPI, GlobalFileSystemModuleRef> ImageMDLModule;
183 ImageMDLModule g_ImageMDLModule;
186 class MD5ModelLoader : public ModelLoader
189 scene::Node& loadModel( ArchiveFile& file ){
190 return loadMD5Model( file );
194 class ModelMD5Dependencies : public ModelDependencies, public GlobalScripLibModuleRef
198 class ModelMD5API : public TypeSystemRef
200 MD5ModelLoader m_modelmd5;
202 typedef ModelLoader Type;
203 STRING_CONSTANT( Name, "md5mesh" );
206 GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "md5 meshes", "*.md5mesh" ) );
208 ModelLoader* getTable(){
213 typedef SingletonModule<ModelMD5API, ModelMD5Dependencies> ModelMD5Module;
215 ModelMD5Module g_ModelMD5Module;
218 extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer& server ){
219 initialiseModule( server );
221 g_ModelMD3Module.selfRegister();
222 g_ModelMD2Module.selfRegister();
223 g_ModelMDLModule.selfRegister();
224 g_ModelMDCModule.selfRegister();
225 g_ImageMDLModule.selfRegister();
226 g_ModelMD5Module.selfRegister();