summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2HallEventPlugin.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
committerAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
commitc0c336500955a23e344651e5412c9d9d441ef4ee (patch)
tree790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2HallEventPlugin.cpp
parent37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff)
downloadt2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz
t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip
first pass of T2DLL
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2HallEventPlugin.cpp62
1 files changed, 59 insertions, 3 deletions
diff --git a/src/T2DLL/T2HallEventPlugin.cpp b/src/T2DLL/T2HallEventPlugin.cpp
index 8001663..b75e4ff 100644
--- a/src/T2DLL/T2HallEventPlugin.cpp
+++ b/src/T2DLL/T2HallEventPlugin.cpp
@@ -1,16 +1,72 @@
+#include "CResFile.h"
+#include "T2BitImage.h"
#include "T2HallEventPlugin.h"
+#include "T2ImageObj.h"
-T2HallEventPlugin::T2HallEventPlugin(unsigned long, T2PluginSpecifier&) {
+T2HallEventPlugin::T2HallEventPlugin(DWORD inType, T2PluginSpecifier& inSpecifier)
+ : T2SubPlugin(inType, inSpecifier)
+{
+ mCC = 0;
+ mD0 = 0;
+ _F0 = 0;
+ mF4 = 0;
+ mResID = 0;
}
/*virtual*/ T2HallEventPlugin::~T2HallEventPlugin() {
}
-/*virtual*/ void T2HallEventPlugin::LoadRsrcFromStream(CResFile&) {
+/*virtual*/ void T2HallEventPlugin::LoadRsrcFromStream(CResFile& inResFile) {
+ T2SubPlugin::LoadRsrcFromStream(inResFile);
+
+ inResFile >> mResID;
+ inResFile >> mCC;
+ inResFile >> mD0;
+ inResFile >> mOpenTime;
+ inResFile >> mCloseTime;
+ inResFile >> mD4;
+ inResFile >> mD8;
+
+ unsigned short us;
+ inResFile >> us;
+ mDupCustomerTableDefRes = us;
+
+ inResFile >> mDC;
+ inResFile >> mE0;
+ inResFile >> mE4;
+ inResFile >> mBindTime;
+ inResFile >> mF4;
+ inResFile >> mF8;
+ inResFile >> mEC;
}
void T2HallEventPlugin::UnfoldPluginSelf() {
+ if (mResID) {
+ mImage = new T2BitImage(mSpecifier.mPath, mResID, true);
+ mImageObj = new T2ImageObj;
+
+ int width = mImage->mBitmap.header.biWidth;
+ int height = mImage->mBitmap.header.biHeight;
+ if (height < 0)
+ height = 0 - height;
+ height /= 4;
+
+ CRect rect(0, 0, width, height);
+ for (int n = 0; n < 4; n++) {
+ mImageObj->AddObject("SCRE", 200 + n, *mImage, &rect, false, false);
+ rect.OffsetRect(0, height);
+ }
+ }
}
-/*virtual*/ unsigned long T2HallEventPlugin::LoadSelf() {
+/*virtual*/ DWORD T2HallEventPlugin::LoadSelf() {
+ DWORD result = 0;
+ CResFile resFile;
+
+ if (resFile.OpenResource(mSpecifier.mPath, 128, 'HEDF'))
+ LoadRsrcFromStream(resFile);
+ else
+ result = 0xFFFFFFFF;
+
+ return result;
}