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
24 #include "iscenegraph.h"
26 #include "iselection.h"
30 #include "ifilesystem.h"
32 #include "ifiletypes.h"
33 #include "iscriplib.h"
35 #include "modulesystem/singletonmodule.h"
36 #include "typesystem.h"
46 class MD3ModelLoader : public ModelLoader
49 scene::Node& loadModel(ArchiveFile& file)
51 return loadMD3Model(file);
55 class ModelDependencies :
56 public GlobalFileSystemModuleRef,
57 public GlobalOpenGLModuleRef,
58 public GlobalUndoModuleRef,
59 public GlobalSceneGraphModuleRef,
60 public GlobalShaderCacheModuleRef,
61 public GlobalSelectionModuleRef,
62 public GlobalFiletypesModuleRef
66 class ModelMD3API : public TypeSystemRef
68 MD3ModelLoader m_modelmd3;
70 typedef ModelLoader Type;
71 STRING_CONSTANT(Name, "md3");
75 GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("md3 models", "*.md3"));
77 ModelLoader* getTable()
83 typedef SingletonModule<ModelMD3API, ModelDependencies> ModelMD3Module;
85 ModelMD3Module g_ModelMD3Module;
89 class MD2ModelLoader : public ModelLoader
92 scene::Node& loadModel(ArchiveFile& file)
94 return loadMD2Model(file);
98 class ModelMD2API : public TypeSystemRef
100 MD2ModelLoader m_modelmd2;
102 typedef ModelLoader Type;
103 STRING_CONSTANT(Name, "md2");
107 GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("md2 models", "*.md2"));
109 ModelLoader* getTable()
115 typedef SingletonModule<ModelMD2API, ModelDependencies> ModelMD2Module;
117 ModelMD2Module g_ModelMD2Module;
119 class MDLModelLoader : public ModelLoader
122 scene::Node& loadModel(ArchiveFile& file)
124 return loadMDLModel(file);
128 class ModelMDLAPI : public TypeSystemRef
130 MDLModelLoader m_modelmdl;
132 typedef ModelLoader Type;
133 STRING_CONSTANT(Name, "mdl");
137 GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("mdl models", "*.mdl"));
139 ModelLoader* getTable()
145 typedef SingletonModule<ModelMDLAPI, ModelDependencies> ModelMDLModule;
147 ModelMDLModule g_ModelMDLModule;
149 class MDCModelLoader : public ModelLoader
152 scene::Node& loadModel(ArchiveFile& file)
154 return loadMDCModel(file);
158 class ModelMDCAPI : public TypeSystemRef
160 MDCModelLoader m_modelmdc;
162 typedef ModelLoader Type;
163 STRING_CONSTANT(Name, "mdc");
167 GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("mdc models", "*.mdc"));
169 ModelLoader* getTable()
175 typedef SingletonModule<ModelMDCAPI, ModelDependencies> ModelMDCModule;
177 ModelMDCModule g_ModelMDCModule;
182 _QERPlugImageTable m_imagemdl;
184 typedef _QERPlugImageTable Type;
185 STRING_CONSTANT(Name, "mdl");
189 m_imagemdl.loadImage = &LoadMDLImage;
191 _QERPlugImageTable* getTable()
197 typedef SingletonModule<ImageMDLAPI, GlobalFileSystemModuleRef> ImageMDLModule;
199 ImageMDLModule g_ImageMDLModule;
202 class MD5ModelLoader : public ModelLoader
205 scene::Node& loadModel(ArchiveFile& file)
207 return loadMD5Model(file);
211 class ModelMD5Dependencies : public ModelDependencies, public GlobalScripLibModuleRef
215 class ModelMD5API : public TypeSystemRef
217 MD5ModelLoader m_modelmd5;
219 typedef ModelLoader Type;
220 STRING_CONSTANT(Name, "md5mesh");
224 GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("md5 meshes", "*.md5mesh"));
226 ModelLoader* getTable()
232 typedef SingletonModule<ModelMD5API, ModelMD5Dependencies> ModelMD5Module;
234 ModelMD5Module g_ModelMD5Module;
237 extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
239 initialiseModule(server);
241 g_ModelMD3Module.selfRegister();
242 g_ModelMD2Module.selfRegister();
243 g_ModelMDLModule.selfRegister();
244 g_ModelMDCModule.selfRegister();
245 g_ImageMDLModule.selfRegister();
246 g_ModelMD5Module.selfRegister();