diff options
Diffstat (limited to 'src/T2DLL/T2HallEventPlugin.cpp')
-rw-r--r-- | src/T2DLL/T2HallEventPlugin.cpp | 62 |
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; } |