#include "xmaterialtexturedef.h"

XMaterialTextureDef::XMaterialTextureDef()
    : XAsset()
    , mNameHash(0)
    , mNameStart(0)
    , mNameEnd(0)
    , mSamplerState(0)
    , mSemantic(0)
    , mDefInfo(*this)
{
    SetName("Material Texture Definition");
}

XMaterialTextureDef::~XMaterialTextureDef()
{
    
}

quint8 XMaterialTextureDef::GetSemantic() const
{
    return mSemantic;
}

void XMaterialTextureDef::ParseData(XDataStream *aStream)
{
    if (GetPtr() == -1)
    {
        *aStream
            >> mNameHash
            >> mNameStart
            >> mNameEnd
            >> mSamplerState
            >> mSemantic;

        mDefInfo.ParseData(aStream);

        if (mSemantic == 11)
        {

        }
        else
        {

        }
    }
}

void XMaterialTextureDef::Clear()
{
    mNameHash = 0;
    mNameStart = 0;
    mNameEnd = 0;
    mSamplerState = 0;
    mSemantic = 0;
    mDefInfo.Clear();
}
