summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2SilhouetteDef.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
committerAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
commitc0c336500955a23e344651e5412c9d9d441ef4ee (patch)
tree790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2SilhouetteDef.cpp
parent37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff)
downloadt2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz
t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip
first pass of T2DLL
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2SilhouetteDef.cpp26
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;
}