diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-06-14 00:50:34 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-06-14 00:50:34 +0100 |
commit | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (patch) | |
tree | eaf6e857382eef16c2dd940eb4125536fbe068bd /src/T2DLL/T2AdvertisePlugin.cpp | |
download | t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.tar.gz t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.zip |
initial commit
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2AdvertisePlugin.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
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; +} |