#ifndef XMATERIAL_H
#define XMATERIAL_H

#include "materialtechset.h"
#include "xgfxstatebits.h"
#include "xmaterialinfo.h"
#include "xmaterialtexturedef.h"
#include "xmaterialconstantdef.h"

class XMaterial : public XAsset
{
public:
    explicit XMaterial();
    ~XMaterial() override;

    virtual void ParseData(QDataStream* aStream) override;
    virtual void Clear() override;

private:
    XMaterialInfo mInfo;

    QVector<quint8> mStateBitsEntry;
    quint8 mTextureCount;
    quint8 mConstantCount;
    quint8 mStateBitsCount;
    quint8 mStateFlags;
    quint8 mCameraRegion;

    qint32 mTechSetPtr;
    XMaterialTechSet *mTechniqueSet;

    qint32 mTextureTablePtr;
    XMaterialTextureDef *mTextureTable;

    qint32 mConstantTablePtr;
    XMaterialConstantDef *mConstantTable;

    qint32 mStateBitsTablePtr;
    XGfxStateBits *mStateBitsTable;
};

#endif // MATERIAL_H
