#include "CResFile.h" #include "T2BitImage.h" #include "T2ImageObj.h" #include "T2SilhouetteDef.h" T2SilhouetteDef::T2SilhouetteDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile) : T2TemplatePlugin(type, specifier, resFile, NULL) { *resFile >> mSilhouetteType; *resFile >> mWidth; *resFile >> mRouteType; *resFile >> mResID; *resFile >> mName; mHasImage = false; mImage = new T2BitImage(mModuleHandle, mResID, true); mHasImage = true; for (int i = 0; i < 6; i++) { CRect rect(0, i * 36, 16, (i + 1) * 36); mImageObj->AddObject(i, 0, *mImage, rect, true, false); } } /*virtual*/ T2SilhouetteDef::~T2SilhouetteDef() { if (mHasImage) delete mImage; } /*virtual*/ void T2SilhouetteDef::GetName(CString& outStr) { outStr = mName; }