From c0c336500955a23e344651e5412c9d9d441ef4ee Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 28 Jun 2023 22:22:32 +0100 Subject: first pass of T2DLL --- src/T2DLL/T2MoverPlugin.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/T2DLL/T2MoverPlugin.cpp') diff --git a/src/T2DLL/T2MoverPlugin.cpp b/src/T2DLL/T2MoverPlugin.cpp index a2a5a3a..0b38037 100644 --- a/src/T2DLL/T2MoverPlugin.cpp +++ b/src/T2DLL/T2MoverPlugin.cpp @@ -1,13 +1,29 @@ +#include "CResFile.h" #include "T2MoverPlugin.h" -T2MoverPlugin::T2MoverPlugin(unsigned long, T2PluginSpecifier&) { +T2MoverPlugin::T2MoverPlugin(DWORD type, T2PluginSpecifier& specifier) + : T2EquipPlugin(type, specifier) +{ } /*virtual*/ T2MoverPlugin::~T2MoverPlugin() { } -int T2MoverPlugin::LoadAllTemplatePlugin(T2WorldDef*, T2TemplatePluginDB*) { +BOOL T2MoverPlugin::LoadAllTemplatePlugin(T2WorldDef* worldDef, T2TemplatePluginDB*) { + LoadT2MoverDef(worldDef); + return true; } -void T2MoverPlugin::LoadT2MoverDef(T2WorldDef*) { +typedef T2TemplatePlugin *(MSVC_STDCALL* ConstructTemplatePluginType) (T2PluginSpecifier *, CResFile *, T2WorldDef *, T2MoverPlugin *); + +void T2MoverPlugin::LoadT2MoverDef(T2WorldDef* worldDef) { + ConstructTemplatePluginType func = (ConstructTemplatePluginType) GetProcAddress((HMODULE) mModuleHandle, "ConstructTemplatePlugin"); +#line 26 + _ASSERT(func); + + CResFile resFile; + resFile.OpenResource(mModuleHandle, 1, 'MvDf'); + T2TemplatePlugin *plugin = func(&mSpecifier, &resFile, worldDef, this); + + mTemplatePlugin = plugin; } -- cgit v1.2.3