From 37e364b2c6cc7487a1c888d256a73e5337bb7189 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 14 Jun 2023 00:50:34 +0100 Subject: initial commit --- src/T2DLL/T2AdvertisePlugin.cpp | 65 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/T2DLL/T2AdvertisePlugin.cpp (limited to 'src/T2DLL/T2AdvertisePlugin.cpp') diff --git a/src/T2DLL/T2AdvertisePlugin.cpp b/src/T2DLL/T2AdvertisePlugin.cpp new file mode 100644 index 0000000..8486955 --- /dev/null +++ b/src/T2DLL/T2AdvertisePlugin.cpp @@ -0,0 +1,65 @@ +#include "CResFile.h" +#include "T2AdvertisePlugin.h" +#include "T2BitImage.h" +#include "T2ImageObj.h" + +T2AdvertisePlugin::T2AdvertisePlugin(DWORD type, T2PluginSpecifier& specifier) + : T2SubPlugin(type, specifier) +{ + mPath = ""; + mCC = 0; + mD0 = 0; + mDay = 0; + mMoney = 0; + mSubType = 0; + mTieup = NULL; +} + +/*virtual*/ T2AdvertisePlugin::~T2AdvertisePlugin() { +} + +/*virtual*/ void T2AdvertisePlugin::LoadRsrcFromStream(CResFile& resFile) { + T2SubPlugin::LoadRsrcFromStream(resFile); + resFile >> mSubType; + resFile >> mCC; + resFile >> mD0; + resFile >> mDay; + resFile >> mMoney; + resFile >> mPath; +} + +void T2AdvertisePlugin::UnfoldPluginSelf() { + if (mCC != 0) { + mBitImage = new T2BitImage(mSpecifier.mPath, mCC, 1); + mImageObj = new T2ImageObj; + mImageObj->AddObject("BILL", -1, *mBitImage, NULL, 0, 0); + } +} + +unsigned int T2AdvertisePlugin::GetSubType() { + return mSubType; +} + +unsigned int T2AdvertisePlugin::GetDay() { + return mDay; +} + +int T2AdvertisePlugin::GetMoney() { + return mMoney; +} + +void T2AdvertisePlugin::GetPath(CString& outStr) { + outStr = mPath; +} + +/*virtual*/ unsigned long T2AdvertisePlugin::LoadSelf() { + unsigned long result = 0; + + CResFile resFile; + if (resFile.OpenResource(mSpecifier.mPath, 128, 'ADDF')) + LoadRsrcFromStream(resFile); + else + result = 0xFFFFFFFF; + + return result; +} -- cgit v1.2.3