#include "xgfxcolor.h"

XGfxColor::XGfxColor()
    : XAsset()
    , mArray(4)
{
    SetName("GFX Color");
}

void XGfxColor::ParseData(XDataStream *aStream)
{
    *aStream >> mArray[0];
    if (IsDebug())
    {
        qDebug() << QString("[%1] mArray[0] = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mArray[0]);
    }

    *aStream >> mArray[1];
    if (IsDebug())
    {
        qDebug() << QString("[%1] mArray[1] = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mArray[1]);
    }

    *aStream >> mArray[2];
    if (IsDebug())
    {
        qDebug() << QString("[%1] mArray[2] = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mArray[2]);
    }

    *aStream >> mArray[3];
    if (IsDebug())
    {
        qDebug() << QString("[%1] mArray[3] = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mArray[3]);
    }
}

void XGfxColor::Clear()
{

}

void XGfxColor::SetColor(quint8 r, quint8 g, quint8 b, quint8 a)
{
    mArray[0] = r;
    mArray[1] = g;
    mArray[2] = b;
    mArray[3] = a;
}
