2019-07-25 23:21:03 +02:00
|
|
|
#include "../dll/dll.h"
|
|
|
|
#include "Hook_Manager.h"
|
|
|
|
|
2020-01-19 18:55:14 +01:00
|
|
|
#ifdef EMU_OVERLAY
|
2019-08-14 15:09:57 +02:00
|
|
|
|
2019-08-27 15:38:07 +02:00
|
|
|
Hook_Manager::Hook_Manager()
|
2019-07-25 23:21:03 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
Hook_Manager::~Hook_Manager()
|
|
|
|
{
|
|
|
|
for (auto& i : _hooks)
|
|
|
|
delete i;
|
|
|
|
}
|
|
|
|
|
|
|
|
Hook_Manager& Hook_Manager::Inst()
|
|
|
|
{
|
|
|
|
static Hook_Manager hook;
|
|
|
|
return hook;
|
|
|
|
}
|
|
|
|
|
2019-08-27 15:38:07 +02:00
|
|
|
void Hook_Manager::AddHook(Base_Hook* hook)
|
2019-07-25 23:21:03 +02:00
|
|
|
{
|
2019-08-27 15:38:07 +02:00
|
|
|
_hooks.insert(hook);
|
2019-07-25 23:21:03 +02:00
|
|
|
}
|
|
|
|
|
2019-08-27 15:38:07 +02:00
|
|
|
void Hook_Manager::RemoveHook(Base_Hook* hook)
|
2019-07-25 23:21:03 +02:00
|
|
|
{
|
2019-08-27 15:38:07 +02:00
|
|
|
auto it = _hooks.find(hook);
|
|
|
|
if (it != _hooks.end())
|
2019-07-25 23:21:03 +02:00
|
|
|
{
|
2019-08-27 15:38:07 +02:00
|
|
|
delete hook;
|
|
|
|
_hooks.erase(it);
|
2019-08-16 10:36:44 +02:00
|
|
|
}
|
2019-08-14 15:09:57 +02:00
|
|
|
}
|
|
|
|
|
2020-01-19 18:55:14 +01:00
|
|
|
#endif//EMU_OVERLAY
|