summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2AdvertisePlugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2AdvertisePlugin.cpp65
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;
+}