From 082f3893215797268d7ac8c1000ebe371f276af7 Mon Sep 17 00:00:00 2001 From: BobTheBob9 Date: Tue, 16 Aug 2022 01:12:59 +0100 Subject: lots of stuff idk --- NorthstarDLL/sourceinterface.h | 62 +++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'NorthstarDLL/sourceinterface.h') diff --git a/NorthstarDLL/sourceinterface.h b/NorthstarDLL/sourceinterface.h index a40653ff..474e961b 100644 --- a/NorthstarDLL/sourceinterface.h +++ b/NorthstarDLL/sourceinterface.h @@ -1,31 +1,31 @@ -#pragma once -#include - -// literally just copied from ttf2sdk definition -typedef void* (*CreateInterfaceFn)(const char* pName, int* pReturnCode); - -template class SourceInterface -{ - private: - T* m_interface; - - public: - SourceInterface(const std::string& moduleName, const std::string& interfaceName) - { - HMODULE handle = GetModuleHandleA(moduleName.c_str()); - CreateInterfaceFn createInterface = (CreateInterfaceFn)GetProcAddress(handle, "CreateInterface"); - m_interface = (T*)createInterface(interfaceName.c_str(), NULL); - if (m_interface == nullptr) - spdlog::error("Failed to call CreateInterface for %s in %s", interfaceName, moduleName); - } - - T* operator->() const - { - return m_interface; - } - - operator T*() const - { - return m_interface; - } -}; +#pragma once +#include + +// literally just copied from ttf2sdk definition +typedef void* (*CreateInterfaceFn)(const char* pName, int* pReturnCode); + +template class SourceInterface +{ + private: + T* m_interface; + + public: + SourceInterface(const std::string& moduleName, const std::string& interfaceName) + { + HMODULE handle = GetModuleHandleA(moduleName.c_str()); + CreateInterfaceFn createInterface = (CreateInterfaceFn)GetProcAddress(handle, "CreateInterface"); + m_interface = (T*)createInterface(interfaceName.c_str(), NULL); + if (m_interface == nullptr) + spdlog::error("Failed to call CreateInterface for %s in %s", interfaceName, moduleName); + } + + T* operator->() const + { + return m_interface; + } + + operator T*() const + { + return m_interface; + } +}; -- cgit v1.2.3