#include "xmaterial.h"

XMaterial::XMaterial()
    : XAsset()
    , mInfo()
    , mStateBitsEntry()
    , mTextureCount(0)
    , mConstantCount(0)
    , mStateBitsCount(0)
    , mStateFlags(0)
    , mCameraRegion(0)
    , mTechSetPtr(0)
    , mTechniqueSet(new XMaterialTechSet)
    , mTextureTablePtr(0)
    , mTextureTable(new XMaterialTextureDef)
    , mConstantTablePtr(0)
    , mConstantTable(new XMaterialConstantDef)
    , mStateBitsTablePtr(0)
    , mStateBitsTable(new XGfxStateBits)
{
    
}

XMaterial::~XMaterial()
{
    delete mTechniqueSet;
    delete mTextureTable;
    delete mConstantTable;
    delete mStateBitsTable;
}

void XMaterial::ParseData(QDataStream *aStream)
{
    
}

void XMaterial::Clear()
{
    mInfo.Clear();
    mStateBitsEntry.clear();
    mTextureCount = 0;
    mConstantCount = 0;
    mStateBitsCount = 0;
    mStateFlags = 0;
    mCameraRegion = 0;
    mTechSetPtr = 0;
    mTechniqueSet = new XMaterialTechSet();
    mTextureTablePtr = 0;
    mTextureTable = new XMaterialTextureDef();
    mConstantTablePtr = 0;
    mConstantTable = new XMaterialConstantDef();
    mStateBitsTablePtr = 0;
    mStateBitsTable = new XGfxStateBits();
}
