From c0c336500955a23e344651e5412c9d9d441ef4ee Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 28 Jun 2023 22:22:32 +0100 Subject: first pass of T2DLL --- src/T2DLL/T2SilhouetteDef.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/T2DLL/T2SilhouetteDef.cpp') 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; } -- cgit v1.2.3