summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2TenantPlugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/T2DLL/T2TenantPlugin.cpp')
-rw-r--r--src/T2DLL/T2TenantPlugin.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/T2DLL/T2TenantPlugin.cpp b/src/T2DLL/T2TenantPlugin.cpp
index 428b111..e642b84 100644
--- a/src/T2DLL/T2TenantPlugin.cpp
+++ b/src/T2DLL/T2TenantPlugin.cpp
@@ -1,19 +1,38 @@
+#include "CResFile.h"
#include "T2TenantPlugin.h"
-T2TenantPlugin::T2TenantPlugin(unsigned long, T2PluginSpecifier&) {
+T2TenantPlugin::T2TenantPlugin(DWORD type, T2PluginSpecifier& specifier)
+ : T2EquipPlugin(type, specifier)
+{
}
/*virtual*/ T2TenantPlugin::~T2TenantPlugin() {
}
-int T2TenantPlugin::TestLoadAllDefRsrcPlugin() {
+BOOL T2TenantPlugin::TestLoadAllDefRsrcPlugin() {
+ return true;
}
-int T2TenantPlugin::LoadAllTemplatePlugin(T2WorldDef*, T2TemplatePluginDB*) {
+BOOL T2TenantPlugin::LoadAllTemplatePlugin(T2WorldDef* worldDef, T2TemplatePluginDB*) {
+ LoadT2TenantDef(worldDef);
+ return true;
}
-unsigned long T2TenantPlugin::GetShopPluginType() {
+DWORD T2TenantPlugin::GetShopPluginType() {
+ return 0;
}
-void T2TenantPlugin::LoadT2TenantDef(T2WorldDef*) {
+typedef T2TemplatePlugin *(MSVC_STDCALL* ConstructTemplatePluginType) (T2PluginSpecifier *, CResFile *, T2WorldDef *, T2TenantPlugin *);
+
+void T2TenantPlugin::LoadT2TenantDef(T2WorldDef* worldDef) {
+ ConstructTemplatePluginType func = (ConstructTemplatePluginType) GetProcAddress((HMODULE) mModuleHandle, "ConstructTemplatePlugin");
+#line 41
+ _ASSERT(func);
+
+ CResFile resFile;
+ resFile.OpenResource(mModuleHandle, 1, 'TnDf');
+ T2TemplatePlugin *plugin = func(&mSpecifier, &resFile, worldDef, this);
+ resFile.End();
+
+ mTemplatePlugin = plugin;
}