X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=plugins%2Fmd3model%2Fplugin.cpp;h=95fb54771e561e4003f5a90e74896f9de949610b;hp=dbdff93591137bd89bdaacb183bb61c243d63d8d;hb=3c73487420fde8d4a3b5360d8b99e48132517900;hpb=95ac019c0063b6e281fe5eeefb7fe19b9b7be9b0 diff --git a/plugins/md3model/plugin.cpp b/plugins/md3model/plugin.cpp index dbdff935..95fb5477 100644 --- a/plugins/md3model/plugin.cpp +++ b/plugins/md3model/plugin.cpp @@ -1,23 +1,23 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. + Copyright (C) 2001-2006, William Joseph. + All Rights Reserved. -This file is part of GtkRadiant. + This file is part of GtkRadiant. -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + GtkRadiant is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + GtkRadiant is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ + You should have received a copy of the GNU General Public License + along with GtkRadiant; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #include "plugin.h" @@ -46,38 +46,35 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA class MD3ModelLoader : public ModelLoader { public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMD3Model(file); - } +scene::Node& loadModel( ArchiveFile& file ){ + return loadMD3Model( file ); +} }; class ModelDependencies : - public GlobalFileSystemModuleRef, - public GlobalOpenGLModuleRef, - public GlobalUndoModuleRef, - public GlobalSceneGraphModuleRef, - public GlobalShaderCacheModuleRef, - public GlobalSelectionModuleRef, - public GlobalFiletypesModuleRef + public GlobalFileSystemModuleRef, + public GlobalOpenGLModuleRef, + public GlobalUndoModuleRef, + public GlobalSceneGraphModuleRef, + public GlobalShaderCacheModuleRef, + public GlobalSelectionModuleRef, + public GlobalFiletypesModuleRef { }; class ModelMD3API : public TypeSystemRef { - MD3ModelLoader m_modelmd3; +MD3ModelLoader m_modelmd3; public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "md3"); - - ModelMD3API() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("md3 models", "*.md3")); - } - ModelLoader* getTable() - { - return &m_modelmd3; - } +typedef ModelLoader Type; +STRING_CONSTANT( Name, "md3" ); + +ModelMD3API(){ + GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "md3 models", "*.md3" ) ); +} +ModelLoader* getTable(){ + return &m_modelmd3; +} }; typedef SingletonModule ModelMD3Module; @@ -89,27 +86,24 @@ ModelMD3Module g_ModelMD3Module; class MD2ModelLoader : public ModelLoader { public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMD2Model(file); - } +scene::Node& loadModel( ArchiveFile& file ){ + return loadMD2Model( file ); +} }; class ModelMD2API : public TypeSystemRef { - MD2ModelLoader m_modelmd2; +MD2ModelLoader m_modelmd2; public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "md2"); - - ModelMD2API() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("md2 models", "*.md2")); - } - ModelLoader* getTable() - { - return &m_modelmd2; - } +typedef ModelLoader Type; +STRING_CONSTANT( Name, "md2" ); + +ModelMD2API(){ + GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "md2 models", "*.md2" ) ); +} +ModelLoader* getTable(){ + return &m_modelmd2; +} }; typedef SingletonModule ModelMD2Module; @@ -119,27 +113,24 @@ ModelMD2Module g_ModelMD2Module; class MDLModelLoader : public ModelLoader { public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMDLModel(file); - } +scene::Node& loadModel( ArchiveFile& file ){ + return loadMDLModel( file ); +} }; class ModelMDLAPI : public TypeSystemRef { - MDLModelLoader m_modelmdl; +MDLModelLoader m_modelmdl; public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "mdl"); - - ModelMDLAPI() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("mdl models", "*.mdl")); - } - ModelLoader* getTable() - { - return &m_modelmdl; - } +typedef ModelLoader Type; +STRING_CONSTANT( Name, "mdl" ); + +ModelMDLAPI(){ + GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "mdl models", "*.mdl" ) ); +} +ModelLoader* getTable(){ + return &m_modelmdl; +} }; typedef SingletonModule ModelMDLModule; @@ -149,27 +140,24 @@ ModelMDLModule g_ModelMDLModule; class MDCModelLoader : public ModelLoader { public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMDCModel(file); - } +scene::Node& loadModel( ArchiveFile& file ){ + return loadMDCModel( file ); +} }; class ModelMDCAPI : public TypeSystemRef { - MDCModelLoader m_modelmdc; +MDCModelLoader m_modelmdc; public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "mdc"); - - ModelMDCAPI() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("mdc models", "*.mdc")); - } - ModelLoader* getTable() - { - return &m_modelmdc; - } +typedef ModelLoader Type; +STRING_CONSTANT( Name, "mdc" ); + +ModelMDCAPI(){ + GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "mdc models", "*.mdc" ) ); +} +ModelLoader* getTable(){ + return &m_modelmdc; +} }; typedef SingletonModule ModelMDCModule; @@ -179,19 +167,17 @@ ModelMDCModule g_ModelMDCModule; class ImageMDLAPI { - _QERPlugImageTable m_imagemdl; +_QERPlugImageTable m_imagemdl; public: - typedef _QERPlugImageTable Type; - STRING_CONSTANT(Name, "mdl"); - - ImageMDLAPI() - { - m_imagemdl.loadImage = &LoadMDLImage; - } - _QERPlugImageTable* getTable() - { - return &m_imagemdl; - } +typedef _QERPlugImageTable Type; +STRING_CONSTANT( Name, "mdl" ); + +ImageMDLAPI(){ + m_imagemdl.loadImage = &LoadMDLImage; +} +_QERPlugImageTable* getTable(){ + return &m_imagemdl; +} }; typedef SingletonModule ImageMDLModule; @@ -202,10 +188,9 @@ ImageMDLModule g_ImageMDLModule; class MD5ModelLoader : public ModelLoader { public: - scene::Node& loadModel(ArchiveFile& file) - { - return loadMD5Model(file); - } +scene::Node& loadModel( ArchiveFile& file ){ + return loadMD5Model( file ); +} }; class ModelMD5Dependencies : public ModelDependencies, public GlobalScripLibModuleRef @@ -214,19 +199,17 @@ class ModelMD5Dependencies : public ModelDependencies, public GlobalScripLibModu class ModelMD5API : public TypeSystemRef { - MD5ModelLoader m_modelmd5; +MD5ModelLoader m_modelmd5; public: - typedef ModelLoader Type; - STRING_CONSTANT(Name, "md5mesh"); - - ModelMD5API() - { - GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("md5 meshes", "*.md5mesh")); - } - ModelLoader* getTable() - { - return &m_modelmd5; - } +typedef ModelLoader Type; +STRING_CONSTANT( Name, "md5mesh" ); + +ModelMD5API(){ + GlobalFiletypesModule::getTable().addType( Type::Name(), Name(), filetype_t( "md5 meshes", "*.md5mesh" ) ); +} +ModelLoader* getTable(){ + return &m_modelmd5; +} }; typedef SingletonModule ModelMD5Module; @@ -234,14 +217,13 @@ typedef SingletonModule ModelMD5Module; ModelMD5Module g_ModelMD5Module; -extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server) -{ - initialiseModule(server); - - g_ModelMD3Module.selfRegister(); - g_ModelMD2Module.selfRegister(); - g_ModelMDLModule.selfRegister(); - g_ModelMDCModule.selfRegister(); - g_ImageMDLModule.selfRegister(); - g_ModelMD5Module.selfRegister(); +extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer& server ){ + initialiseModule( server ); + + g_ModelMD3Module.selfRegister(); + g_ModelMD2Module.selfRegister(); + g_ModelMDLModule.selfRegister(); + g_ModelMDCModule.selfRegister(); + g_ImageMDLModule.selfRegister(); + g_ModelMD5Module.selfRegister(); }