iw4x-client/iw4/Components/Loader.cpp

46 lines
1.0 KiB
C++
Raw Normal View History

2015-12-23 08:45:53 -05:00
#include "..\STDInclude.hpp"
namespace Components
{
std::vector<Component*> Loader::Components;
void Loader::Initialize()
{
Loader::Register(new Dvar());
2015-12-23 16:21:03 -05:00
Loader::Register(new Menus());
2015-12-23 08:45:53 -05:00
Loader::Register(new Colors());
2015-12-23 16:21:03 -05:00
Loader::Register(new Logger());
2015-12-23 08:45:53 -05:00
Loader::Register(new Window());
Loader::Register(new Command());
Loader::Register(new Console());
Loader::Register(new RawFiles());
2015-12-23 10:56:02 -05:00
Loader::Register(new Renderer());
2015-12-23 21:26:46 -05:00
Loader::Register(new FastFiles());
2015-12-23 10:56:02 -05:00
Loader::Register(new Materials());
2015-12-23 21:26:46 -05:00
Loader::Register(new FileSystem());
2015-12-23 08:45:53 -05:00
Loader::Register(new QuickPatch());
2015-12-23 16:21:03 -05:00
Loader::Register(new AssetHandler());
Loader::Register(new MusicalTalent());
2015-12-23 08:45:53 -05:00
}
void Loader::Uninitialize()
{
for (auto component : Loader::Components)
{
2015-12-23 16:21:03 -05:00
Logger::Print("Unregistering component: %s", component->GetName());
2015-12-23 08:45:53 -05:00
delete component;
}
Loader::Components.clear();
}
void Loader::Register(Component* component)
{
if (component)
{
2015-12-23 16:21:03 -05:00
Logger::Print("Component registered: %s", component->GetName());
2015-12-23 08:45:53 -05:00
Loader::Components.push_back(component);
}
}
}