diff options
Diffstat (limited to 'src/T2DLL/T2SilhouetteDef.cpp')
-rw-r--r-- | src/T2DLL/T2SilhouetteDef.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/T2DLL/T2SilhouetteDef.cpp b/src/T2DLL/T2SilhouetteDef.cpp index 526a450..f514197 100644 --- a/src/T2DLL/T2SilhouetteDef.cpp +++ b/src/T2DLL/T2SilhouetteDef.cpp @@ -1,10 +1,32 @@ +#include "CResFile.h" +#include "T2BitImage.h" +#include "T2ImageObj.h" #include "T2SilhouetteDef.h" -T2SilhouetteDef::T2SilhouetteDef(unsigned long, T2PluginSpecifier&, CResFile*) { +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&) { +/*virtual*/ void T2SilhouetteDef::GetName(CString& outStr) { + outStr = mName; } |