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/T2OuterObjPlugin.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/T2DLL/T2OuterObjPlugin.cpp') diff --git a/src/T2DLL/T2OuterObjPlugin.cpp b/src/T2DLL/T2OuterObjPlugin.cpp index cc33816..0ad3022 100644 --- a/src/T2DLL/T2OuterObjPlugin.cpp +++ b/src/T2DLL/T2OuterObjPlugin.cpp @@ -1,13 +1,30 @@ +#include "CResFile.h" +#include "T2OuterObjDef.h" #include "T2OuterObjPlugin.h" -T2OuterObjPlugin::T2OuterObjPlugin(unsigned long, T2PluginSpecifier&) { +T2OuterObjPlugin::T2OuterObjPlugin(DWORD inType, T2PluginSpecifier& inSpecifier) + : T2ToolPlugin(inType, inSpecifier) +{ } /*virtual*/ T2OuterObjPlugin::~T2OuterObjPlugin() { } -int T2OuterObjPlugin::LoadAllTemplatePlugin(T2WorldDef*, T2TemplatePluginDB*) { +BOOL T2OuterObjPlugin::LoadAllTemplatePlugin(T2WorldDef* inWorldDef, T2TemplatePluginDB* inDB) { + LoadT2OuterObjDef(inWorldDef); + return true; } -void T2OuterObjPlugin::LoadT2OuterObjDef(T2WorldDef*) { +typedef T2OuterObjDef *(MSVC_STDCALL* ConstructTemplatePluginType) (T2PluginSpecifier *, CResFile *, T2WorldDef *, T2OuterObjPlugin *); + +void T2OuterObjPlugin::LoadT2OuterObjDef(T2WorldDef* inWorldDef) { + ConstructTemplatePluginType theFunc = (ConstructTemplatePluginType) GetProcAddress((HMODULE) mModuleHandle, "ConstructTemplatePlugin"); +#line 25 + _ASSERT(theFunc); + + CResFile resFile; + resFile.OpenResource(mModuleHandle, 1, 'OODf'); + T2OuterObjDef *theDef = theFunc(&mSpecifier, &resFile, inWorldDef, this); + + mTemplatePlugin = theDef; } -- cgit v1.2.3