#include "xgfxlightgrid.h"

XGfxLightGrid::XGfxLightGrid()
    : XAsset()
    , mHasLightRegions(false)
    , mSunPrimaryLightIndex(0)
    , mMins()
    , mMaxs()
    , mRowAxis(0)
    , mColAxis(0)
    , mRowDataStart(nullptr)
    , mRawRowDataSize(0)
    , mRawRowData(nullptr)
    , mEntryCount(0)
    , mEntries()
    , mColorCount(0)
    , mColors()
{
}

XGfxLightGrid::~XGfxLightGrid()
{
    Clear();
}

void XGfxLightGrid::Clear()
{
    mHasLightRegions = false;
    mSunPrimaryLightIndex = 0;
    mMins = QVector3D();
    mMaxs = QVector3D();
    mRowAxis = 0;
    mColAxis = 0;
    mRowDataStart = nullptr;
    mRawRowDataSize = 0;
    mRawRowData = nullptr;
    mEntryCount = 0;
    mEntries = QVector<XGfxLightGridEntry>();
    mColorCount = 0;
    mColors = QVector<XGfxLightGridColors>();
}

void XGfxLightGrid::ParseData(QDataStream *aStream)
{
    // Implement parsing logic here
    Clear();

    // Parse data from stream
    // Example:
    // hasLightRegions = ...
    // sunPrimaryLightIndex = ...
    // mins[0] = ...; mins[1] = ...; mins[2] = ...
    // maxs[0] = ...; maxs[1] = ...; maxs[2] = ...
    // rowAxis = ...; colAxis = ...

    // For now, we'll just read some dummy data to keep the compiler happy
    qint32 dummy;
    *aStream >> dummy;
}


