#ifndef XGFXWORLD_H
#define XGFXWORLD_H

#include "xasset.h"
#include "xd3dindexbuffer.h"
#include "xgfxbrushmodel.h"
#include "xgfxcell.h"
#include "xgfxlightgrid.h"
#include "xgfxlightmaparray.h"
#include "xgfxlightregion.h"
#include "xgfxscenedynmodel.h"
#include "xgfxscenedynbrush.h"
#include "xgfxshadowgeometry.h"
#include "xgfxworlddpvsdynamic.h"
#include "xgfxworlddpvsplanes.h"
#include "xgfxworlddpvsstatic.h"
#include "xgfxworldstreaminfo.h"
#include "xgfxworldvertexdata.h"
#include "xgfxworldvertexlayerdata.h"
#include "xmaterialmemory.h"
#include "xsunlightparseparams.h"
#include "xgfxlight.h"
#include "xsunflare.h"
#include "xgfxreflectionprobe.h"

class XGfxWorld : public XAsset
{
public:
    explicit XGfxWorld();
    ~XGfxWorld();

    void ParseData(XDataStream *aStream) override;
    void Clear() override;

private:
    XString mName;
    XString mBaseName;
    qint32 mPlaneCount;
    qint32 mNodeCount;
    qint32 mIndexCount;
    QByteArray mIndices;
    XD3DIndexBuffer mIndexBuffer;
    qint32 mSurfaceCount;
    XGfxWorldStreamInfo mStreamInfo;
    qint32 mSkySurfCount;
    QVector<qint32> mSkyStartSurfs;
    XGfxImage mSkyImage;
    quint8 mSkySamplerState;
    quint32 mVertexCount;
    XGfxWorldVertexData mVertexData;
    quint32 mVertexLayerDataSize;
    XGfxWorldVertexLayerData mVertexLayerData;
    XSunLightParseParams mSunParse;
    XGfxLight mSunLight;
    QColor mSunColorFromBsp;
    quint32 mSunPrimaryLightIndex;
    quint32 mPrimaryLightCount;
    qint32 mCullGroupCount;
    quint32 mReflectionProbeCount;
    QVector<XGfxReflectionProbe> mReflectionProbes;
    QVector<XGfxTexture> mReflectionProbeTextures;
    XGfxWorldDpvsPlanes mDpvsPlanes;
    qint32 mCellBitsCount;
    QVector<XGfxCell> mCells;
    qint32 mLightmapCount;
    QVector<XGfxLightmapArray> mLightmaps;
    XGfxLightGrid mLightGrid;
    QVector<XGfxTexture> mLightmapPrimaryTextures;
    QVector<XGfxTexture> mLightmapSecondaryTextures;
    qint32 mModelCount;
    QVector<XGfxBrushModel> mModels;
    QVector3D mMins;
    QVector3D mMaxs;
    quint32 mChecksum;
    qint32 mMaterialMemoryCount;
    QVector<XMaterialMemory> mMaterialMemory;
    XSunFlare mSun;
    QVector<QVector<float>> mOutdoorLookupMatrix;
    XGfxImage mOutdoorImage;
    QVector<quint32> mCellCasterBits;
    QVector<XGfxSceneDynModel> mSceneDynModel;
    QVector<XGfxSceneDynBrush> mSceneDynBrush;
    quint32 mPrimaryLightEntityShadowVis;
    quint32 mPrimaryLightDynEntShadowVis[2];
    quint8 mNonSunPrimaryLightForModelDynEnt;
    XGfxShadowGeometry mShadowGeom;
    XGfxLightRegion mLightRegion;
    XGfxWorldDpvsStatic mDpvs;
    XGfxWorldDpvsDynamic mDpvsDyn;
};

#endif // XGFXWORLD_H
