summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2SilhouetteDef.cpp
blob: e4ec009fd68ce78199f843bb28cc1651ccc84d54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "StdAfx.h"
#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;
}