#include "StdAfx.h" #include "CResFile.h" #include "T2BitImage.h" #include "T2HallEventPlugin.h" #include "T2ImageObj.h" 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& 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*/ DWORD T2HallEventPlugin::LoadSelf() { DWORD result = 0; CResFile resFile; if (resFile.OpenResource(mSpecifier.mPath, 128, 'HEDF')) LoadRsrcFromStream(resFile); else result = 0xFFFFFFFF; return result; }