#include "StdAfx.h" #include "CResFile.h" #include "T2BitImage.h" #include "T2ImageObj.h" #include "T2SubPlugin.h" T2SubPlugin::T2SubPlugin(DWORD type, T2PluginSpecifier& specifier) : CResourcePlugin(type, specifier) { mDupCustomerTableDefRes = false; mTieup = 0; mTitle[0] = 0; mTieup = NULL; mOpenTime = 0; mCloseTime = 0; mImage = NULL; mImageObj = NULL; } /*virtual*/ T2SubPlugin::~T2SubPlugin() { if (mTieup) delete mTieup; if (mImage) delete mImage; if (mImageObj) delete mImageObj; } BOOL T2SubPlugin::IsTieupFinish() { BOOL result = false; if (mTieup) { CTime now = CTime::GetTickCount(); if (*mTieup < now) result = true; } return result; } /*virtual*/ void T2SubPlugin::GetTitle(CString& outStr) { outStr = mTitle; } /*virtual*/ void T2SubPlugin::LoadRsrcFromStream(CResFile& resFile) { resFile >> mTitle; unsigned int t; resFile >> t; if (t != 0) { int year = (t >> 28) & 0xF; year *= 10; year += (t >> 24) & 0xF; year *= 10; year += (t >> 20) & 0xF; year *= 10; year += (t >> 16) & 0xF; int month = (t >> 12) & 0xF; month *= 10; month += (t >> 8) & 0xF; int day = (t >> 4) & 0xF; day *= 10; day += (t & 0xF) + 1; mTieup = new CTime(year, month, day, 0, 0, 0); } }