r5sdk/r5dev/tier1/interface.cpp
Kawe Mazidjatari befd38bf51 Interface factory system rewrite
Removed all extraneous copies by adding the class 'InterfaceReg' which will construct a new interface, and link it to the engine's static register. The Source Engine macro 'EXPOSE_INTERFACE_FN' will help utilizing this. The game module from the plugin is not obtained through the process environment block, so the executable is no longer sensitive to names.
2023-08-22 01:11:49 +02:00

21 lines
594 B
C++

//===========================================================================//
//
// Purpose:
//
//===========================================================================//
#include "tier1/interface.h"
// ------------------------------------------------------------------------- //
// InterfaceReg.
// ------------------------------------------------------------------------- //
InterfaceReg** s_ppInterfaceRegs;
InterfaceReg::InterfaceReg(InstantiateInterfaceFn fn, const char* pName) :
m_pName(pName)
{
m_CreateFn = fn;
m_pNext = *s_ppInterfaceRegs;
*s_ppInterfaceRegs = this;
}