vmap/plugins/entity/plugin.cpp

103 lines
2.3 KiB
C++
Raw Normal View History

2020-11-17 11:16:16 +00:00
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
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 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
*/
#include "debugging/debugging.h"
#include "iscenegraph.h"
#include "irender.h"
#include "iselection.h"
#include "ientity.h"
#include "iundo.h"
#include "ieclass.h"
#include "igl.h"
#include "ireference.h"
#include "ifilter.h"
#include "preferencesystem.h"
#include "qerplugin.h"
#include "namespace.h"
#include "modelskin.h"
#include "typesystem.h"
#include "entity.h"
#include "skincache.h"
#include "modulesystem/singletonmodule.h"
class EntityDependencies :
2021-08-04 20:23:18 +00:00
public GlobalRadiantModuleRef,
public GlobalOpenGLModuleRef,
public GlobalUndoModuleRef,
public GlobalSceneGraphModuleRef,
public GlobalShaderCacheModuleRef,
public GlobalSelectionModuleRef,
public GlobalReferenceModuleRef,
public GlobalFilterModuleRef,
public GlobalPreferenceSystemModuleRef,
public GlobalNamespaceModuleRef,
public GlobalModelSkinCacheModuleRef {
2020-11-17 11:16:16 +00:00
};
class EntityQ3API : public TypeSystemRef {
2021-08-04 20:23:18 +00:00
EntityCreator *m_entityq3;
2020-11-17 11:16:16 +00:00
public:
2021-08-04 20:23:18 +00:00
typedef EntityCreator Type;
2020-11-17 11:16:16 +00:00
2021-08-04 20:23:18 +00:00
STRING_CONSTANT(Name, "quake3");
2020-11-17 11:16:16 +00:00
2021-08-04 20:23:18 +00:00
EntityQ3API()
{
Entity_Construct();
2020-11-17 11:16:16 +00:00
2021-08-04 20:23:18 +00:00
m_entityq3 = &GetEntityCreator();
2020-11-17 11:16:16 +00:00
2021-08-04 20:23:18 +00:00
GlobalReferenceCache().setEntityCreator(*m_entityq3);
}
2020-11-17 11:16:16 +00:00
2021-08-04 20:23:18 +00:00
~EntityQ3API()
{
Entity_Destroy();
}
2020-11-17 11:16:16 +00:00
2021-08-04 20:23:18 +00:00
EntityCreator *getTable()
{
return m_entityq3;
}
2020-11-17 11:16:16 +00:00
};
typedef SingletonModule<EntityQ3API, EntityDependencies> EntityQ3Module;
EntityQ3Module g_EntityQ3Module;
2021-06-02 08:49:27 +00:00
extern "C" void
#ifdef _WIN32
__declspec(dllexport)
#else
__attribute__((visibility("default")))
#endif
Radiant_RegisterModules(ModuleServer &server)
2020-11-17 11:16:16 +00:00
{
2021-08-04 20:23:18 +00:00
initialiseModule(server);
2020-11-17 11:16:16 +00:00
2021-08-04 20:23:18 +00:00
g_EntityQ3Module.selfRegister();
Doom3ModelSkinCacheModule_selfRegister(server);
2020-11-17 11:16:16 +00:00
}