iw4x-client/iw4/Components/Loader.cpp

40 lines
883 B
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());
Loader::Register(new Colors());
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());
Loader::Register(new Materials());
2015-12-23 08:45:53 -05:00
Loader::Register(new QuickPatch());
}
void Loader::Uninitialize()
{
for (auto component : Loader::Components)
{
OutputDebugStringA(Utils::VA("Unregistering component: %s", component->GetName()));
delete component;
}
Loader::Components.clear();
}
void Loader::Register(Component* component)
{
if (component)
{
OutputDebugStringA(Utils::VA("Component registered: %s", component->GetName()));
Loader::Components.push_back(component);
}
}
}