Compare commits
71 Commits
1eb340aaea
...
2f044a8d94
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f044a8d94 | ||
|
|
a1a54665d9 | ||
|
|
6e73c2d50c | ||
|
|
53f690c554 | ||
|
|
eebd333e11 | ||
|
|
3b65f1bdf2 | ||
|
|
a9444c05bf | ||
|
|
9a957138b5 | ||
|
|
a94e3bd012 | ||
|
|
b80cfab4fb | ||
|
|
da6233c10d | ||
|
|
43e925ae23 | ||
|
|
cd7c65ef4a | ||
|
|
fd7f466578 | ||
|
|
3a84ccd30f | ||
|
|
7fdd451cd1 | ||
|
|
59d5b12e80 | ||
|
|
d81513a95f | ||
|
|
23d577336f | ||
|
|
b9646c1140 | ||
|
|
7d103dfcea | ||
|
|
df1bad5380 | ||
|
|
6a41e543ee | ||
|
|
06e94e9648 | ||
|
|
096da843d1 | ||
|
|
ba6da187f3 | ||
|
|
11cc55dd71 | ||
|
|
e82dbce63c | ||
|
|
4677ab9637 | ||
|
|
b77e6e8077 | ||
|
|
3416060d4b | ||
|
|
ce7ed928c4 | ||
|
|
b7c7eff1b5 | ||
|
|
64b5471ea4 | ||
|
|
ef2d880039 | ||
|
|
a577d329ec | ||
|
|
80fc72e8b0 | ||
|
|
0a3fbfe39a | ||
|
|
4f430055f3 | ||
|
|
67832954e4 | ||
|
|
333de659ed | ||
|
|
0374410315 | ||
|
|
296a25d26f | ||
|
|
0e141ae95c | ||
|
|
fc1c89c710 | ||
|
|
422ceb9a25 | ||
|
|
14a494cc24 | ||
|
|
0da6a4aee7 | ||
|
|
00618f8081 | ||
|
|
d525f9bee3 | ||
|
|
ab7d2bb3b8 | ||
|
|
e2f35a0314 | ||
|
|
e4c409ab19 | ||
|
|
48c28e046d | ||
|
|
0f45fb5788 | ||
|
|
8d4303b166 | ||
|
|
857a55f133 | ||
|
|
b513834076 | ||
|
|
2131034ad9 | ||
|
|
4a53b0ff74 | ||
|
|
f7ff77b11d | ||
|
|
e06fe64311 | ||
|
|
e416d47df4 | ||
|
|
51a0d00b93 | ||
|
|
ae16506d87 | ||
|
|
75c128534e | ||
|
|
e0b7ff743c | ||
|
|
84314df7cb | ||
|
|
1545a92c27 | ||
|
|
b62c548193 | ||
|
|
d92098571e |
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
XBoneInfo::XBoneInfo()
|
XBoneInfo::XBoneInfo()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mBounds()
|
, mBounds(3)
|
||||||
, mOffset()
|
, mOffset()
|
||||||
, mRadiusSquared(0)
|
, mRadiusSquared(0)
|
||||||
{
|
{
|
||||||
@ -16,12 +16,25 @@ XBoneInfo::~XBoneInfo()
|
|||||||
|
|
||||||
void XBoneInfo::ParseData(QDataStream *aStream)
|
void XBoneInfo::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mBounds[0][0]
|
||||||
|
>> mBounds[0][1]
|
||||||
|
>> mBounds[0][2]
|
||||||
|
>> mBounds[1][0]
|
||||||
|
>> mBounds[1][1]
|
||||||
|
>> mBounds[1][2]
|
||||||
|
>> mOffset[0]
|
||||||
|
>> mOffset[1]
|
||||||
|
>> mOffset[2]
|
||||||
|
>> mRadiusSquared;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XBoneInfo::Clear()
|
void XBoneInfo::Clear()
|
||||||
{
|
{
|
||||||
mBounds = QVector<QVector3D>();
|
mBounds.clear();
|
||||||
mOffset = QVector3D();
|
mOffset = QVector3D();
|
||||||
mRadiusSquared = 0;
|
mRadiusSquared = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,10 +6,8 @@ XCBrush::XCBrush()
|
|||||||
, mContents(0)
|
, mContents(0)
|
||||||
, mMaxs()
|
, mMaxs()
|
||||||
, mNumsides()
|
, mNumsides()
|
||||||
, mSidesPtr()
|
|
||||||
, mSides()
|
, mSides()
|
||||||
, mAxialMaterialNum()
|
, mAxialMaterialNum()
|
||||||
, mBaseAdjacentSidePtr()
|
|
||||||
, mBaseAdjacentSide()
|
, mBaseAdjacentSide()
|
||||||
, mFirstAdjacentSideOffsets()
|
, mFirstAdjacentSideOffsets()
|
||||||
, mEdgeCount()
|
, mEdgeCount()
|
||||||
@ -24,7 +22,59 @@ XCBrush::~XCBrush()
|
|||||||
|
|
||||||
void XCBrush::ParseData(QDataStream *aStream)
|
void XCBrush::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
qint32 sidesPtr, baseAdjacentSidePtr;
|
||||||
|
*aStream
|
||||||
|
>> mMins[0]
|
||||||
|
>> mMins[1]
|
||||||
|
>> mMins[2]
|
||||||
|
>> mContents
|
||||||
|
>> mMaxs[0]
|
||||||
|
>> mMaxs[1]
|
||||||
|
>> mMaxs[2]
|
||||||
|
>> mNumsides
|
||||||
|
>> sidesPtr;
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mAxialMaterialNum[i][0]
|
||||||
|
>> mAxialMaterialNum[i][1]
|
||||||
|
>> mAxialMaterialNum[i][2];
|
||||||
|
}
|
||||||
|
|
||||||
|
*aStream >> baseAdjacentSidePtr;
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mFirstAdjacentSideOffsets[i][0]
|
||||||
|
>> mFirstAdjacentSideOffsets[i][1]
|
||||||
|
>> mFirstAdjacentSideOffsets[i][2];
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mEdgeCount[i][0]
|
||||||
|
>> mEdgeCount[i][1]
|
||||||
|
>> mEdgeCount[i][2];
|
||||||
|
}
|
||||||
|
|
||||||
|
aStream->skipRawData(10);
|
||||||
|
|
||||||
|
if (sidesPtr == -1)
|
||||||
|
{
|
||||||
|
XCBrushSide newSize;
|
||||||
|
newSize.ParseData(aStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (baseAdjacentSidePtr == -1)
|
||||||
|
{
|
||||||
|
XCBrushSide newSize;
|
||||||
|
newSize.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCBrush::Clear()
|
void XCBrush::Clear()
|
||||||
@ -33,10 +83,8 @@ void XCBrush::Clear()
|
|||||||
mContents = 0;
|
mContents = 0;
|
||||||
mMaxs = QVector3D();
|
mMaxs = QVector3D();
|
||||||
mNumsides = 0;
|
mNumsides = 0;
|
||||||
mSidesPtr = 0;
|
|
||||||
mSides = QVector<XCBrushSide>();
|
mSides = QVector<XCBrushSide>();
|
||||||
mAxialMaterialNum = QVector<QVector3D>();
|
mAxialMaterialNum = QVector<QVector3D>();
|
||||||
mBaseAdjacentSidePtr = 0;
|
|
||||||
mBaseAdjacentSide = 0;
|
mBaseAdjacentSide = 0;
|
||||||
mFirstAdjacentSideOffsets = QVector<QVector3D>();
|
mFirstAdjacentSideOffsets = QVector<QVector3D>();
|
||||||
mEdgeCount = QVector<QVector3D>();
|
mEdgeCount = QVector<QVector3D>();
|
||||||
|
|||||||
@ -20,10 +20,8 @@ private:
|
|||||||
int mContents;
|
int mContents;
|
||||||
QVector3D mMaxs;
|
QVector3D mMaxs;
|
||||||
uint mNumsides;
|
uint mNumsides;
|
||||||
qint32 mSidesPtr;
|
|
||||||
QVector<XCBrushSide> mSides;
|
QVector<XCBrushSide> mSides;
|
||||||
QVector<QVector3D> mAxialMaterialNum;
|
QVector<QVector3D> mAxialMaterialNum;
|
||||||
qint32 mBaseAdjacentSidePtr;
|
|
||||||
quint8 mBaseAdjacentSide;
|
quint8 mBaseAdjacentSide;
|
||||||
QVector<QVector3D> mFirstAdjacentSideOffsets;
|
QVector<QVector3D> mFirstAdjacentSideOffsets;
|
||||||
QVector<QVector3D> mEdgeCount;
|
QVector<QVector3D> mEdgeCount;
|
||||||
|
|||||||
@ -70,7 +70,7 @@ void XClipMap::ParseData(QDataStream *aStream)
|
|||||||
|
|
||||||
qint32 planePtr, staticModelPtr, materialsPtr, brushSidesPtr,
|
qint32 planePtr, staticModelPtr, materialsPtr, brushSidesPtr,
|
||||||
brushEdgesPtr, nodesPtr, leafsPtr, leafsBrushNodesPtr,
|
brushEdgesPtr, nodesPtr, leafsPtr, leafsBrushNodesPtr,
|
||||||
leafBrushesPtr, leafSurfacesPtr, vertPtr1, vertPtr2, vertPtr3,
|
leafBrushesPtr, leafSurfacesPtr, vertPtr,
|
||||||
triIndicesPtr, triEdgeWalkablePtr, bordersPtr, partitionsPtr, aabbTreesPtr,
|
triIndicesPtr, triEdgeWalkablePtr, bordersPtr, partitionsPtr, aabbTreesPtr,
|
||||||
cModelsPtr;
|
cModelsPtr;
|
||||||
*aStream
|
*aStream
|
||||||
@ -96,9 +96,7 @@ void XClipMap::ParseData(QDataStream *aStream)
|
|||||||
>> mNumLeafSurfaces
|
>> mNumLeafSurfaces
|
||||||
>> leafSurfacesPtr
|
>> leafSurfacesPtr
|
||||||
>> mVertCount
|
>> mVertCount
|
||||||
>> vertPtr1
|
>> vertPtr
|
||||||
>> vertPtr2
|
|
||||||
>> vertPtr3
|
|
||||||
>> mTriCount
|
>> mTriCount
|
||||||
>> triIndicesPtr
|
>> triIndicesPtr
|
||||||
>> triEdgeWalkablePtr
|
>> triEdgeWalkablePtr
|
||||||
@ -114,15 +112,17 @@ void XClipMap::ParseData(QDataStream *aStream)
|
|||||||
|
|
||||||
aStream->skipRawData(2);
|
aStream->skipRawData(2);
|
||||||
|
|
||||||
qint32 brushesPtr, visibilityPtr, mapEntsPtr, boxBrushPtr;
|
qint32 brushesPtr, visibilityPtr, mapEntsPtr;
|
||||||
*aStream
|
*aStream
|
||||||
>> brushesPtr
|
>> brushesPtr
|
||||||
>> mNumClusters
|
>> mNumClusters
|
||||||
>> mClusterBytes
|
>> mClusterBytes
|
||||||
>> visibilityPtr
|
>> visibilityPtr
|
||||||
>> mVised
|
>> mVised
|
||||||
>> mapEntsPtr
|
>> mapEntsPtr;
|
||||||
>> boxBrushPtr;
|
|
||||||
|
mMapEnts.ParsePtr(aStream, false);
|
||||||
|
mBoxBrush.ParsePtr(aStream, false);
|
||||||
|
|
||||||
mBoxModel.ParseData(aStream);
|
mBoxModel.ParseData(aStream);
|
||||||
|
|
||||||
@ -236,24 +236,117 @@ void XClipMap::ParseData(QDataStream *aStream)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mLeafsurfaces()
|
if (leafSurfacesPtr)
|
||||||
// mVerts()
|
{
|
||||||
// mTriIndices()
|
for (int i = 0; i < mNumLeafBrushes; i++)
|
||||||
// mTriEdgeIsWalkable()
|
{
|
||||||
// mBorders()
|
quint32 newBrush;
|
||||||
// mPartitions()
|
*aStream >> newBrush;
|
||||||
// mAabbTrees()
|
mLeafSurfaces.append(newBrush);
|
||||||
// mCodels()
|
}
|
||||||
// mBrushes()
|
}
|
||||||
// mVisibility()
|
|
||||||
// mMapEnts()
|
if (vertPtr)
|
||||||
// mBoxBrush()
|
{
|
||||||
// mBoxModel()
|
for (int i = 0; i < mVertCount; i++)
|
||||||
// mDynEntCount(0)
|
{
|
||||||
// mDynEntDefList()
|
QVector3D newVert;
|
||||||
// mDynEntPoseList()
|
*aStream
|
||||||
// mDynEntClientList()
|
>> newVert[0]
|
||||||
// mDynEntCollList()
|
>> newVert[1]
|
||||||
|
>> newVert[2];
|
||||||
|
mVerts.append(newVert);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (triIndicesPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mTriCount; i++)
|
||||||
|
{
|
||||||
|
quint32 newTri;
|
||||||
|
*aStream >> newTri;
|
||||||
|
mTriIndices.append(newTri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (triEdgeWalkablePtr)
|
||||||
|
{
|
||||||
|
aStream->readRawData(mTriEdgeIsWalkable.data(), ((3 * mTriCount + 31) >> 3) & 0xFFFFFFFC);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bordersPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mBorderCount; i++)
|
||||||
|
{
|
||||||
|
XCollisionBorder newBorder;
|
||||||
|
newBorder.ParseData(aStream);
|
||||||
|
mBorders.append(newBorder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (partitionsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mPartitionCount; i++)
|
||||||
|
{
|
||||||
|
XCollisionPartition newPartition;
|
||||||
|
newPartition.ParseData(aStream);
|
||||||
|
mPartitions.append(newPartition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aabbTreesPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mAabbTreeCount; i++)
|
||||||
|
{
|
||||||
|
XCollisionAabbTree newTree;
|
||||||
|
newTree.ParseData(aStream);
|
||||||
|
mAabbTrees.append(newTree);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cModelsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mNumSubModels; i++)
|
||||||
|
{
|
||||||
|
XCModel newCModel;
|
||||||
|
newCModel.ParseData(aStream);
|
||||||
|
mCModels.append(newCModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (brushesPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mNumBrushes; i++)
|
||||||
|
{
|
||||||
|
XCBrush newCBrush;
|
||||||
|
newCBrush.ParseData(aStream);
|
||||||
|
mBrushes.append(newCBrush);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visibilityPtr)
|
||||||
|
{
|
||||||
|
aStream->readRawData(mVisibility.data(), mClusterBytes * mNumClusters);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mapEntsPtr)
|
||||||
|
{
|
||||||
|
mMapEnts.ParseData(aStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
mBoxBrush.ParseData(aStream);
|
||||||
|
|
||||||
|
mDynEntDefList[0].ParseData(aStream);
|
||||||
|
mDynEntDefList[0].ParseData(aStream);
|
||||||
|
|
||||||
|
mDynEntPoseList[0].ParseData(aStream);
|
||||||
|
mDynEntPoseList[0].ParseData(aStream);
|
||||||
|
|
||||||
|
mDynEntClientList[0].ParseData(aStream);
|
||||||
|
mDynEntClientList[0].ParseData(aStream);
|
||||||
|
|
||||||
|
mDynEntCollList[0].ParseData(aStream);
|
||||||
|
mDynEntCollList[0].ParseData(aStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,14 +61,14 @@ private:
|
|||||||
QVector<quint32> mLeafBrushes;
|
QVector<quint32> mLeafBrushes;
|
||||||
|
|
||||||
quint32 mNumLeafSurfaces;
|
quint32 mNumLeafSurfaces;
|
||||||
QVector<uint> mLeafSurfaces;
|
QVector<quint32> mLeafSurfaces;
|
||||||
|
|
||||||
quint32 mVertCount;
|
quint32 mVertCount;
|
||||||
QVector<float> mVerts;
|
QVector<QVector3D> mVerts;
|
||||||
|
|
||||||
int mTriCount;
|
int mTriCount;
|
||||||
QVector<quint32> mTriIndices;
|
QVector<quint32> mTriIndices;
|
||||||
QVector<quint8> mTriEdgeIsWalkable;
|
QByteArray mTriEdgeIsWalkable;
|
||||||
|
|
||||||
int mBorderCount;
|
int mBorderCount;
|
||||||
QVector<XCollisionBorder> mBorders;
|
QVector<XCollisionBorder> mBorders;
|
||||||
@ -89,9 +89,9 @@ private:
|
|||||||
int mClusterBytes;
|
int mClusterBytes;
|
||||||
|
|
||||||
qint32 mVisibilityPtr;
|
qint32 mVisibilityPtr;
|
||||||
QVector<quint8> mVisibility;
|
QByteArray mVisibility;
|
||||||
int mVised;
|
int mVised;
|
||||||
QVector<XMapEnts> mMapEnts;
|
XMapEnts mMapEnts;
|
||||||
XCBrush mBoxBrush;
|
XCBrush mBoxBrush;
|
||||||
XCModel mBoxModel;
|
XCModel mBoxModel;
|
||||||
QVector<quint32> mDynEntCounts;
|
QVector<quint32> mDynEntCounts;
|
||||||
|
|||||||
@ -17,7 +17,16 @@ XCModel::~XCModel()
|
|||||||
|
|
||||||
void XCModel::ParseData(QDataStream *aStream)
|
void XCModel::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream
|
||||||
|
>> mMins[0]
|
||||||
|
>> mMins[1]
|
||||||
|
>> mMins[2]
|
||||||
|
>> mMaxs[0]
|
||||||
|
>> mMaxs[1]
|
||||||
|
>> mMaxs[2]
|
||||||
|
>> mRadius;
|
||||||
|
|
||||||
|
mLeaf.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCModel::Clear()
|
void XCModel::Clear()
|
||||||
|
|||||||
@ -15,7 +15,9 @@ XCollisionAabbTreeIndex::~XCollisionAabbTreeIndex()
|
|||||||
|
|
||||||
void XCollisionAabbTreeIndex::ParseData(QDataStream *aStream) {
|
void XCollisionAabbTreeIndex::ParseData(QDataStream *aStream) {
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
*aStream >> mFirstChildIndex;
|
*aStream
|
||||||
|
>> mFirstChildIndex
|
||||||
|
>> mPartitionIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
XCollisionBorder::XCollisionBorder()
|
XCollisionBorder::XCollisionBorder()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mDistEq()
|
, mDistEq(3)
|
||||||
, mZBase(0.0f)
|
, mZBase(0.0f)
|
||||||
, mZSlope(0.0f)
|
, mZSlope(0.0f)
|
||||||
, mStart(0.0f)
|
, mStart(0.0f)
|
||||||
@ -18,7 +18,9 @@ XCollisionBorder::~XCollisionBorder()
|
|||||||
void XCollisionBorder::ParseData(QDataStream *aStream) {
|
void XCollisionBorder::ParseData(QDataStream *aStream) {
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
*aStream
|
*aStream
|
||||||
>> mDistEq
|
>> mDistEq[0]
|
||||||
|
>> mDistEq[1]
|
||||||
|
>> mDistEq[2]
|
||||||
>> mZBase
|
>> mZBase
|
||||||
>> mZSlope
|
>> mZSlope
|
||||||
>> mStart
|
>> mStart
|
||||||
@ -28,7 +30,7 @@ void XCollisionBorder::ParseData(QDataStream *aStream) {
|
|||||||
|
|
||||||
void XCollisionBorder::Clear()
|
void XCollisionBorder::Clear()
|
||||||
{
|
{
|
||||||
mDistEq = QVector3D();
|
mDistEq.clear();
|
||||||
mZBase = 0.0f;
|
mZBase = 0.0f;
|
||||||
mZSlope = 0.0f;
|
mZSlope = 0.0f;
|
||||||
mStart = 0.0f;
|
mStart = 0.0f;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector3D mDistEq;
|
QVector<float> mDistEq;
|
||||||
float mZBase;
|
float mZBase;
|
||||||
float mZSlope;
|
float mZSlope;
|
||||||
float mStart;
|
float mStart;
|
||||||
|
|||||||
@ -17,9 +17,25 @@ XCollisionPartition::~XCollisionPartition()
|
|||||||
void XCollisionPartition::ParseData(QDataStream *aStream) {
|
void XCollisionPartition::ParseData(QDataStream *aStream) {
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
*aStream
|
*aStream
|
||||||
>>mTriCount
|
>> mTriCount
|
||||||
>>mBorderCount
|
>> mBorderCount;
|
||||||
>>mFirstTri;
|
|
||||||
|
aStream->skipRawData(2);
|
||||||
|
|
||||||
|
qint32 bordersPtr;
|
||||||
|
*aStream
|
||||||
|
>> mFirstTri
|
||||||
|
>> bordersPtr;
|
||||||
|
|
||||||
|
if (bordersPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mBorderCount; i++)
|
||||||
|
{
|
||||||
|
XCollisionBorder newBorder;
|
||||||
|
newBorder.ParseData(aStream);
|
||||||
|
mBorders.append(newBorder);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,10 +10,15 @@ XD3DIndexBuffer::XD3DIndexBuffer()
|
|||||||
|
|
||||||
void XD3DIndexBuffer::ParseData(QDataStream *aStream)
|
void XD3DIndexBuffer::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
XD3DResource::ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mAddress
|
||||||
|
>> mSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XD3DIndexBuffer::Clear()
|
void XD3DIndexBuffer::Clear()
|
||||||
{
|
{
|
||||||
|
mAddress = 0;
|
||||||
|
mSize = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,12 +16,23 @@ XDObjAnimMat::~XDObjAnimMat()
|
|||||||
|
|
||||||
void XDObjAnimMat::ParseData(QDataStream *aStream)
|
void XDObjAnimMat::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mQuat[0]
|
||||||
|
>> mQuat[1]
|
||||||
|
>> mQuat[2]
|
||||||
|
>> mQuat[3]
|
||||||
|
>> mTrans[0]
|
||||||
|
>> mTrans[1]
|
||||||
|
>> mTrans[2]
|
||||||
|
>> mTransWeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XDObjAnimMat::Clear()
|
void XDObjAnimMat::Clear()
|
||||||
{
|
{
|
||||||
mQuat = QVector<float>();
|
mQuat.clear();
|
||||||
mTrans = QVector<float>();
|
mTrans.clear();
|
||||||
mTransWeight = 0;
|
mTransWeight = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,14 @@ XDynEntityClient::~XDynEntityClient()
|
|||||||
|
|
||||||
void XDynEntityClient::ParseData(QDataStream *aStream)
|
void XDynEntityClient::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr())
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mPhysObjId
|
||||||
|
>> mFlags
|
||||||
|
>> mLightingHandle
|
||||||
|
>> mHealth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XDynEntityClient::Clear()
|
void XDynEntityClient::Clear()
|
||||||
|
|||||||
@ -18,12 +18,22 @@ XDynEntityColl::~XDynEntityColl()
|
|||||||
void XDynEntityColl::ParseData(QDataStream *aStream)
|
void XDynEntityColl::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (GetPtr())
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mSector
|
||||||
|
>> mNextEntInSector
|
||||||
|
>> mLinkMins[0]
|
||||||
|
>> mLinkMins[1]
|
||||||
|
>> mLinkMaxs[0]
|
||||||
|
>> mLinkMaxs[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XDynEntityColl::Clear()
|
void XDynEntityColl::Clear()
|
||||||
{
|
{
|
||||||
mSector = 0;
|
mSector = 0;
|
||||||
mNextEntInSector = 0;
|
mNextEntInSector = 0;
|
||||||
mLinkMins.clear();
|
mLinkMins = QVector2D();
|
||||||
mLinkMaxs.clear();
|
mLinkMaxs = QVector2D();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
|
|
||||||
#include <QVector>
|
#include <QVector2D>
|
||||||
|
|
||||||
class XDynEntityColl : public XAsset
|
class XDynEntityColl : public XAsset
|
||||||
{
|
{
|
||||||
@ -17,8 +17,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
quint32 mSector;
|
quint32 mSector;
|
||||||
quint32 mNextEntInSector;
|
quint32 mNextEntInSector;
|
||||||
QVector<float> mLinkMins;
|
QVector2D mLinkMins;
|
||||||
QVector<float> mLinkMaxs;
|
QVector2D mLinkMaxs;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XDYNENTITYCOLL_H
|
#endif // XDYNENTITYCOLL_H
|
||||||
|
|||||||
@ -4,15 +4,11 @@ XDynEntityDef::XDynEntityDef()
|
|||||||
: XAsset()
|
: XAsset()
|
||||||
, mType()
|
, mType()
|
||||||
, mPose()
|
, mPose()
|
||||||
, mModelPtr(0)
|
|
||||||
, mModel()
|
, mModel()
|
||||||
, mBrushModel(0)
|
, mBrushModel(0)
|
||||||
, mPhysicsBrushModel(0)
|
, mPhysicsBrushModel(0)
|
||||||
, mBestroyFxPtr(0)
|
|
||||||
, mDestroyFx()
|
, mDestroyFx()
|
||||||
, mDestroyPiecesPtr(0)
|
|
||||||
, mDestroyPieces()
|
, mDestroyPieces()
|
||||||
, mPhysPresetPtr(0)
|
|
||||||
, mPhysPreset()
|
, mPhysPreset()
|
||||||
, mHealth(0)
|
, mHealth(0)
|
||||||
, mMass()
|
, mMass()
|
||||||
@ -28,7 +24,32 @@ XDynEntityDef::~XDynEntityDef()
|
|||||||
|
|
||||||
void XDynEntityDef::ParseData(QDataStream *aStream)
|
void XDynEntityDef::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr())
|
||||||
|
{
|
||||||
|
*aStream >> mType;
|
||||||
|
|
||||||
|
mPose.ParseData(aStream);
|
||||||
|
mModel.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mBrushModel
|
||||||
|
>> mPhysicsBrushModel;
|
||||||
|
|
||||||
|
mDestroyFx.ParsePtr(aStream, false);
|
||||||
|
mDestroyPieces.ParsePtr(aStream, false);
|
||||||
|
mPhysPreset.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream >> mHealth;
|
||||||
|
|
||||||
|
mMass.ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream >> mContents;
|
||||||
|
|
||||||
|
mModel.ParseData(aStream);
|
||||||
|
mDestroyFx.ParseData(aStream);
|
||||||
|
mDestroyPieces.ParseData(aStream);
|
||||||
|
mPhysPreset.ParseData(aStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XDynEntityDef::Clear()
|
void XDynEntityDef::Clear()
|
||||||
|
|||||||
@ -27,15 +27,11 @@ public:
|
|||||||
private:
|
private:
|
||||||
XDynEntityType mType;
|
XDynEntityType mType;
|
||||||
XGfxPlacement mPose;
|
XGfxPlacement mPose;
|
||||||
qint32 mModelPtr;
|
|
||||||
XModel mModel;
|
XModel mModel;
|
||||||
quint32 mBrushModel;
|
quint32 mBrushModel;
|
||||||
quint32 mPhysicsBrushModel;
|
quint32 mPhysicsBrushModel;
|
||||||
qint32 mBestroyFxPtr;
|
|
||||||
XFxEffectDef mDestroyFx;
|
XFxEffectDef mDestroyFx;
|
||||||
qint32 mDestroyPiecesPtr;
|
|
||||||
XModelPieces mDestroyPieces;
|
XModelPieces mDestroyPieces;
|
||||||
qint32 mPhysPresetPtr;
|
|
||||||
XPhysPreset mPhysPreset;
|
XPhysPreset mPhysPreset;
|
||||||
int mHealth;
|
int mHealth;
|
||||||
XPhysMass mMass;
|
XPhysMass mMass;
|
||||||
|
|||||||
@ -15,11 +15,16 @@ XDynEntityPose::~XDynEntityPose()
|
|||||||
|
|
||||||
void XDynEntityPose::ParseData(QDataStream *aStream)
|
void XDynEntityPose::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
mPose = XGfxPlacement();
|
if (GetPtr())
|
||||||
mRadius = 0.0f;
|
{
|
||||||
|
mPose.ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream >> mRadius;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XDynEntityPose::Clear()
|
void XDynEntityPose::Clear()
|
||||||
{
|
{
|
||||||
|
mPose.Clear();
|
||||||
|
mRadius = 0.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
XFont::XFont()
|
XFont::XFont()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mFontName("")
|
, mFontName()
|
||||||
, mPixelHeight(0)
|
, mPixelHeight(0)
|
||||||
, mGlyphCount(0)
|
, mGlyphCount(0)
|
||||||
, mMaterial(new XMaterial())
|
, mMaterial()
|
||||||
, mGlowMaterial(new XMaterial())
|
, mGlowMaterial()
|
||||||
, mGlyphs()
|
, mGlyphs()
|
||||||
{
|
{
|
||||||
SetType(ASSET_TYPE_FONT);
|
SetType(ASSET_TYPE_FONT);
|
||||||
@ -20,15 +20,42 @@ XFont::~XFont()
|
|||||||
|
|
||||||
void XFont::Clear()
|
void XFont::Clear()
|
||||||
{
|
{
|
||||||
mFontName = "";
|
mFontName.Clear();
|
||||||
mPixelHeight = 0;
|
mPixelHeight = 0;
|
||||||
mGlyphCount = 0;
|
mGlyphCount = 0;
|
||||||
delete mMaterial;
|
mMaterial.Clear();
|
||||||
delete mGlowMaterial;
|
mGlowMaterial.Clear();
|
||||||
mGlyphs.clear();
|
mGlyphs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XFont::ParseData(QDataStream *aStream)
|
void XFont::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
mFontName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
qint32 glyphsPtr;
|
||||||
|
*aStream
|
||||||
|
>> mPixelHeight
|
||||||
|
>> mGlyphCount;
|
||||||
|
|
||||||
|
mMaterial.ParsePtr(aStream, false);
|
||||||
|
mGlowMaterial.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream >> glyphsPtr;
|
||||||
|
|
||||||
|
mFontName.ParseData(aStream);
|
||||||
|
mMaterial.ParseData(aStream);
|
||||||
|
mGlowMaterial.ParseData(aStream);
|
||||||
|
|
||||||
|
if (glyphsPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mGlyphCount; i++)
|
||||||
|
{
|
||||||
|
XGlyph newGlyph;
|
||||||
|
newGlyph.ParseData(aStream);
|
||||||
|
mGlyphs.append(newGlyph);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,11 +15,11 @@ public:
|
|||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mFontName;
|
XString mFontName;
|
||||||
int mPixelHeight;
|
int mPixelHeight;
|
||||||
int mGlyphCount;
|
int mGlyphCount;
|
||||||
XMaterial *mMaterial;
|
XMaterial mMaterial;
|
||||||
XMaterial *mGlowMaterial;
|
XMaterial mGlowMaterial;
|
||||||
QVector<XGlyph> mGlyphs;
|
QVector<XGlyph> mGlyphs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
XFxEffectDef::XFxEffectDef()
|
XFxEffectDef::XFxEffectDef()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mName("")
|
, mName()
|
||||||
, mFlags(0)
|
, mFlags(0)
|
||||||
, mTotalSize(0)
|
, mTotalSize(0)
|
||||||
, mMsecLoopingLife(0)
|
, mMsecLoopingLife(0)
|
||||||
@ -27,5 +27,27 @@ void XFxEffectDef::Clear()
|
|||||||
|
|
||||||
void XFxEffectDef::ParseData(QDataStream *aStream)
|
void XFxEffectDef::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
qint32 elemDefsPtr;
|
||||||
|
*aStream
|
||||||
|
>> mFlags
|
||||||
|
>> mTotalSize
|
||||||
|
>> mMsecLoopingLife
|
||||||
|
>> mElemDefCountLooping
|
||||||
|
>> mElemDefCountOneShot
|
||||||
|
>> mElemDefCountEmission
|
||||||
|
>> elemDefsPtr;
|
||||||
|
|
||||||
|
mName.ParseData(aStream);
|
||||||
|
|
||||||
|
if (elemDefsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mElemDefCountEmission + mElemDefCountOneShot + mElemDefCountLooping; i++)
|
||||||
|
{
|
||||||
|
XFxElemDef newElemDef;
|
||||||
|
newElemDef.ParseData(aStream);
|
||||||
|
mElemDefs.append(newElemDef);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public:
|
|||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
XString mName;
|
||||||
int mFlags;
|
int mFlags;
|
||||||
int mTotalSize;
|
int mTotalSize;
|
||||||
int mMsecLoopingLife;
|
int mMsecLoopingLife;
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#include "xfxelemdef.h"
|
#include "xfxelemdef.h"
|
||||||
#include "xfxtraildef.h"
|
|
||||||
|
|
||||||
XFxElemDef::XFxElemDef()
|
XFxElemDef::XFxElemDef()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
@ -11,11 +10,11 @@ XFxElemDef::XFxElemDef()
|
|||||||
, mSpawnFrustumCullRadius(0)
|
, mSpawnFrustumCullRadius(0)
|
||||||
, mSpawnDelayMsec()
|
, mSpawnDelayMsec()
|
||||||
, mLifeSpanMsec()
|
, mLifeSpanMsec()
|
||||||
, mSpawnOrigin()
|
, mSpawnOrigin(3)
|
||||||
, mSpawnOffsetRadius()
|
, mSpawnOffsetRadius()
|
||||||
, mSpawnOffsetHeight()
|
, mSpawnOffsetHeight()
|
||||||
, mSpawnAngles()
|
, mSpawnAngles(3)
|
||||||
, mAngularVelocity()
|
, mAngularVelocity(3)
|
||||||
, mInitialRotation()
|
, mInitialRotation()
|
||||||
, mGravity()
|
, mGravity()
|
||||||
, mReflectionFactor()
|
, mReflectionFactor()
|
||||||
@ -36,8 +35,7 @@ XFxElemDef::XFxElemDef()
|
|||||||
, mEffectEmitted()
|
, mEffectEmitted()
|
||||||
, mEmitDist()
|
, mEmitDist()
|
||||||
, mEmitDistVariance()
|
, mEmitDistVariance()
|
||||||
, mTrailDefPtr(0)
|
, mTrailDef()
|
||||||
, mTrailDef(new XFxTrailDef())
|
|
||||||
, mSortOrder(0)
|
, mSortOrder(0)
|
||||||
, mLightingFrac(0)
|
, mLightingFrac(0)
|
||||||
, mUseItemClip(0)
|
, mUseItemClip(0)
|
||||||
@ -85,8 +83,7 @@ void XFxElemDef::Clear()
|
|||||||
mEffectEmitted.Clear();
|
mEffectEmitted.Clear();
|
||||||
mEmitDist.Clear();
|
mEmitDist.Clear();
|
||||||
mEmitDistVariance.Clear();
|
mEmitDistVariance.Clear();
|
||||||
mTrailDefPtr = 0;
|
mTrailDef.Clear();
|
||||||
mTrailDef->Clear();
|
|
||||||
mSortOrder = 0;
|
mSortOrder = 0;
|
||||||
mLightingFrac = 0;
|
mLightingFrac = 0;
|
||||||
mUseItemClip = 0;
|
mUseItemClip = 0;
|
||||||
@ -94,5 +91,90 @@ void XFxElemDef::Clear()
|
|||||||
|
|
||||||
void XFxElemDef::ParseData(QDataStream *aStream)
|
void XFxElemDef::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream >> mFlags;
|
||||||
|
|
||||||
|
mSpawn.ParseData(aStream);
|
||||||
|
mSpawnRange.ParseData(aStream);
|
||||||
|
mFadeInRange.ParseData(aStream);
|
||||||
|
mFadeOutRange.ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream >> mSpawnFrustumCullRadius;
|
||||||
|
|
||||||
|
mSpawnDelayMsec.ParseData(aStream);
|
||||||
|
mLifeSpanMsec.ParseData(aStream);
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
mSpawnOrigin[i].ParseData(aStream);
|
||||||
|
}
|
||||||
|
mSpawnOffsetRadius.ParseData(aStream);
|
||||||
|
mSpawnOffsetHeight.ParseData(aStream);
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
mSpawnAngles[i].ParseData(aStream);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
mAngularVelocity[i].ParseData(aStream);
|
||||||
|
}
|
||||||
|
mInitialRotation.ParseData(aStream);
|
||||||
|
mGravity.ParseData(aStream);
|
||||||
|
mReflectionFactor.ParseData(aStream);
|
||||||
|
mAtlas.ParseData(aStream);
|
||||||
|
|
||||||
|
qint32 velSamplesPtr, visSamplesPtr;
|
||||||
|
*aStream
|
||||||
|
>> mElemType
|
||||||
|
>> mVisualCount
|
||||||
|
>> mVelIntervalCount
|
||||||
|
>> mVisStateIntervalCount
|
||||||
|
>> velSamplesPtr
|
||||||
|
>> visSamplesPtr;
|
||||||
|
|
||||||
|
mVisuals.ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mCollMins[0]
|
||||||
|
>> mCollMins[1]
|
||||||
|
>> mCollMins[2]
|
||||||
|
>> mCollMaxs[0]
|
||||||
|
>> mCollMaxs[1]
|
||||||
|
>> mCollMaxs[2];
|
||||||
|
|
||||||
|
mEffectOnImpact.ParseData(aStream);
|
||||||
|
mEffectOnDeath.ParseData(aStream);
|
||||||
|
mEffectEmitted.ParseData(aStream);
|
||||||
|
mEmitDist.ParseData(aStream);
|
||||||
|
mEmitDistVariance.ParseData(aStream);
|
||||||
|
mEffectOnImpact.ParseData(aStream);
|
||||||
|
|
||||||
|
qint32 trailDefPtr;
|
||||||
|
*aStream
|
||||||
|
>> trailDefPtr
|
||||||
|
>> mSortOrder
|
||||||
|
>> mLightingFrac
|
||||||
|
>> mUseItemClip;
|
||||||
|
|
||||||
|
aStream->skipRawData(1);
|
||||||
|
|
||||||
|
if (velSamplesPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mVelIntervalCount + 1; i++)
|
||||||
|
{
|
||||||
|
XFxElemVelStateSample newVelSample;
|
||||||
|
newVelSample.ParseData(aStream);
|
||||||
|
mVelSamples.append(newVelSample);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visSamplesPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mVisStateIntervalCount + 1; i++)
|
||||||
|
{
|
||||||
|
XFxElemVisStateSample newVisSample;
|
||||||
|
newVisSample.ParseData(aStream);
|
||||||
|
mVisSamples.append(newVisSample);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Finish this ugh
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,8 +10,7 @@
|
|||||||
#include "xfxelemvisstatesample.h"
|
#include "xfxelemvisstatesample.h"
|
||||||
#include "xeffectdefref.h"
|
#include "xeffectdefref.h"
|
||||||
#include "xfxelemdefvisuals.h"
|
#include "xfxelemdefvisuals.h"
|
||||||
|
#include "xfxtraildef.h"
|
||||||
class XFxTrailDef;
|
|
||||||
|
|
||||||
class XFxElemDef : public XAsset
|
class XFxElemDef : public XAsset
|
||||||
{
|
{
|
||||||
@ -57,8 +56,7 @@ private:
|
|||||||
XFxFloatRange mEmitDist;
|
XFxFloatRange mEmitDist;
|
||||||
XFxFloatRange mEmitDistVariance;
|
XFxFloatRange mEmitDistVariance;
|
||||||
|
|
||||||
qint32 mTrailDefPtr;
|
XFxTrailDef mTrailDef;
|
||||||
XFxTrailDef* mTrailDef;
|
|
||||||
|
|
||||||
quint8 mSortOrder;
|
quint8 mSortOrder;
|
||||||
quint8 mLightingFrac;
|
quint8 mLightingFrac;
|
||||||
|
|||||||
@ -21,5 +21,11 @@ void XFxElemVec3Range::Clear()
|
|||||||
|
|
||||||
void XFxElemVec3Range::ParseData(QDataStream *aStream)
|
void XFxElemVec3Range::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream
|
||||||
|
>> mBase[0]
|
||||||
|
>> mBase[1]
|
||||||
|
>> mBase[2]
|
||||||
|
>> mAmplitude[0]
|
||||||
|
>> mAmplitude[1]
|
||||||
|
>> mAmplitude[2];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,5 +21,6 @@ void XFxElemVelStateInFrame::Clear()
|
|||||||
|
|
||||||
void XFxElemVelStateInFrame::ParseData(QDataStream *aStream)
|
void XFxElemVelStateInFrame::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mVelocity.ParseData(aStream);
|
||||||
|
mTotalDelta.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,5 +21,6 @@ void XFxElemVelStateSample::Clear()
|
|||||||
|
|
||||||
void XFxElemVelStateSample::ParseData(QDataStream *aStream)
|
void XFxElemVelStateSample::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mLocal.ParseData(aStream);
|
||||||
|
mWorld.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,5 +21,6 @@ void XFxElemVisStateSample::Clear()
|
|||||||
|
|
||||||
void XFxElemVisStateSample::ParseData(QDataStream *aStream)
|
void XFxElemVisStateSample::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mBase.ParseData(aStream);
|
||||||
|
mAmplitude.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,5 +27,23 @@ void XFxElemVisualState::Clear()
|
|||||||
|
|
||||||
void XFxElemVisualState::ParseData(QDataStream *aStream)
|
void XFxElemVisualState::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
quint8 r, g, b, a;
|
||||||
|
*aStream
|
||||||
|
>> r
|
||||||
|
>> g
|
||||||
|
>> b
|
||||||
|
>> a;
|
||||||
|
mColor = QColor(r, g, b, a);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mRotationDelta
|
||||||
|
>> mRotationTotal;
|
||||||
|
|
||||||
|
float width, height;
|
||||||
|
*aStream
|
||||||
|
>> width
|
||||||
|
>> height;
|
||||||
|
mSize = QSize(width, height);
|
||||||
|
|
||||||
|
*aStream >> mScale;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
XGameWorldMp::XGameWorldMp()
|
XGameWorldMp::XGameWorldMp()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mName("")
|
, mName()
|
||||||
{
|
{
|
||||||
SetType(ASSET_TYPE_GAMEWORLD_MP);
|
SetType(ASSET_TYPE_GAMEWORLD_MP);
|
||||||
SetName("GameWorld MP");
|
SetName("GameWorld MP");
|
||||||
@ -17,19 +17,11 @@ XGameWorldMp::~XGameWorldMp()
|
|||||||
void XGameWorldMp::ParseData(QDataStream *aStream) {
|
void XGameWorldMp::ParseData(QDataStream *aStream) {
|
||||||
// Parse the name string
|
// Parse the name string
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
mName = XString::ParseCustom(aStream);
|
mName.ParsePtr(aStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGameWorldMp::Clear()
|
void XGameWorldMp::Clear()
|
||||||
{
|
{
|
||||||
mName.clear();
|
mName.Clear();
|
||||||
}
|
|
||||||
|
|
||||||
QString XGameWorldMp::GetName() const {
|
|
||||||
return mName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void XGameWorldMp::SetName(const QString& name) {
|
|
||||||
mName = name;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#define XGAMEWORLDMP_H
|
#define XGAMEWORLDMP_H
|
||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
|
#include "xstring.h"
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
@ -14,11 +15,8 @@ public:
|
|||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
QString GetName() const;
|
|
||||||
void SetName(const QString& name);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
XString mName;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XGAMEWORLDMP_H
|
#endif // XGAMEWORLDMP_H
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
XGameWorldSp::XGameWorldSp()
|
XGameWorldSp::XGameWorldSp()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mName("")
|
, mName()
|
||||||
, mPath()
|
, mPath()
|
||||||
{
|
{
|
||||||
SetType(ASSET_TYPE_GAMEWORLD_SP);
|
SetType(ASSET_TYPE_GAMEWORLD_SP);
|
||||||
@ -18,24 +18,14 @@ XGameWorldSp::~XGameWorldSp()
|
|||||||
void XGameWorldSp::ParseData(QDataStream *aStream) {
|
void XGameWorldSp::ParseData(QDataStream *aStream) {
|
||||||
// Parse the name string
|
// Parse the name string
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
mName = XString::ParseCustom(aStream);
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
// Parse the path data using our new XPathData class
|
|
||||||
mPath.ParseData(aStream);
|
mPath.ParseData(aStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGameWorldSp::Clear()
|
void XGameWorldSp::Clear()
|
||||||
{
|
{
|
||||||
mName.clear();
|
mName.Clear();
|
||||||
mPath.Clear();
|
mPath.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString XGameWorldSp::GetName() const {
|
|
||||||
return mName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void XGameWorldSp::SetName(const QString& name) {
|
|
||||||
mName = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
#include "xpathdata.h"
|
#include "xpathdata.h"
|
||||||
|
#include "xstring.h"
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
class XGameWorldSp : public XAsset
|
class XGameWorldSp : public XAsset
|
||||||
{
|
{
|
||||||
@ -15,11 +14,8 @@ public:
|
|||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
QString GetName() const;
|
|
||||||
void SetName(const QString& name);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
XString mName;
|
||||||
XPathData mPath;
|
XPathData mPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,62 @@ XGfxCell::~XGfxCell()
|
|||||||
|
|
||||||
void XGfxCell::ParseData(QDataStream *aStream)
|
void XGfxCell::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
qint32 aabbTreePtr, portalsPtr, cullGroupsPtr, reflectionProbesPtr;
|
||||||
|
*aStream
|
||||||
|
>> mMins[0]
|
||||||
|
>> mMins[1]
|
||||||
|
>> mMins[2]
|
||||||
|
>> mMaxs[0]
|
||||||
|
>> mMaxs[1]
|
||||||
|
>> mMaxs[2]
|
||||||
|
>> mAabbTreeCount
|
||||||
|
>> aabbTreePtr
|
||||||
|
>> mPortalCount
|
||||||
|
>> portalsPtr
|
||||||
|
>> mCullGroupCount
|
||||||
|
>> cullGroupsPtr
|
||||||
|
>> mReflectionProbeCount
|
||||||
|
>> reflectionProbesPtr;
|
||||||
|
|
||||||
|
if (aabbTreePtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mAabbTreeCount; i++)
|
||||||
|
{
|
||||||
|
XGfxAabbTree newTree;
|
||||||
|
newTree.ParseData(aStream);
|
||||||
|
mAabbTree.append(newTree);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (portalsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mPortalCount; i++)
|
||||||
|
{
|
||||||
|
XGfxPortal newPortal;
|
||||||
|
newPortal.ParseData(aStream);
|
||||||
|
mPortals.append(newPortal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cullGroupsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mCullGroupCount; i++)
|
||||||
|
{
|
||||||
|
qint32 newCullGroup;
|
||||||
|
*aStream >> newCullGroup;
|
||||||
|
mCullGroups.append(newCullGroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reflectionProbesPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mReflectionProbeCount; i++)
|
||||||
|
{
|
||||||
|
quint8 newReflectionProbe;
|
||||||
|
*aStream >> newReflectionProbe;
|
||||||
|
mReflectionProbes.append(newReflectionProbe);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxCell::Clear()
|
void XGfxCell::Clear()
|
||||||
|
|||||||
@ -28,7 +28,7 @@ private:
|
|||||||
QVector<XGfxPortal> mPortals;
|
QVector<XGfxPortal> mPortals;
|
||||||
|
|
||||||
int mCullGroupCount;
|
int mCullGroupCount;
|
||||||
QVector<int> mCullGroups;
|
QVector<qint32> mCullGroups;
|
||||||
|
|
||||||
quint8 mReflectionProbeCount;
|
quint8 mReflectionProbeCount;
|
||||||
QVector<quint8> mReflectionProbes;
|
QVector<quint8> mReflectionProbes;
|
||||||
|
|||||||
@ -2,15 +2,18 @@
|
|||||||
|
|
||||||
XGfxColor::XGfxColor()
|
XGfxColor::XGfxColor()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mPacked(0)
|
, mArray(4)
|
||||||
, mArray()
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxColor::ParseData(QDataStream *aStream)
|
void XGfxColor::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream
|
||||||
|
>> mArray[0]
|
||||||
|
>> mArray[1]
|
||||||
|
>> mArray[2]
|
||||||
|
>> mArray[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxColor::Clear()
|
void XGfxColor::Clear()
|
||||||
|
|||||||
@ -14,8 +14,7 @@ public:
|
|||||||
void SetColor(quint8 r, quint8 g, quint8 b, quint8 a);
|
void SetColor(quint8 r, quint8 g, quint8 b, quint8 a);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint32 mPacked;
|
QVector<quint8> mArray;
|
||||||
quint8 mArray[4];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XGFXCOLOR_H
|
#endif // XGFXCOLOR_H
|
||||||
|
|||||||
@ -3,18 +3,21 @@
|
|||||||
XGfxDrawSurf::XGfxDrawSurf()
|
XGfxDrawSurf::XGfxDrawSurf()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mFields()
|
, mFields()
|
||||||
, mPacked(0)
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XGfxDrawSurf::~XGfxDrawSurf()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxDrawSurf::ParseData(QDataStream *aStream)
|
void XGfxDrawSurf::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mFields.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxDrawSurf::Clear()
|
void XGfxDrawSurf::Clear()
|
||||||
{
|
{
|
||||||
mFields = XGfxDrawSurfFields();
|
mFields.Clear();
|
||||||
mPacked = 0;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,13 +8,13 @@ class XGfxDrawSurf : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XGfxDrawSurf();
|
explicit XGfxDrawSurf();
|
||||||
|
~XGfxDrawSurf();
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XGfxDrawSurfFields mFields;
|
XGfxDrawSurfFields mFields;
|
||||||
quint64 mPacked;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XGFXDRAWSURF_H
|
#endif // XGFXDRAWSURF_H
|
||||||
|
|||||||
@ -17,7 +17,20 @@ XGfxDrawSurfFields::XGfxDrawSurfFields()
|
|||||||
|
|
||||||
void XGfxDrawSurfFields::ParseData(QDataStream *aStream)
|
void XGfxDrawSurfFields::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
// Read the raw 64-bit value from the stream
|
||||||
|
quint64 raw = 0;
|
||||||
|
*aStream >> raw;
|
||||||
|
|
||||||
|
// Decode bitfields from the 64-bit packed value
|
||||||
|
mObjectId = raw & 0xFFFF; // bits 0-15
|
||||||
|
mReflectionProbeIndex = (raw >> 16) & 0xFF; // bits 16-23
|
||||||
|
mCustomIndex = (raw >> 24) & 0x1F; // bits 24-28
|
||||||
|
mMaterialSortedIndex = (raw >> 29) & 0x7FF; // bits 29-39
|
||||||
|
mPrepass = (raw >> 40) & 0x3; // bits 40-41
|
||||||
|
mPrimaryLightIndex = (raw >> 42) & 0xFF; // bits 42-49
|
||||||
|
mSurfType = (raw >> 50) & 0xF; // bits 50-53
|
||||||
|
mPrimarySortKey = (raw >> 54) & 0x3F; // bits 54-59
|
||||||
|
mUnused = (raw >> 60) & 0xF; // bits 60-63
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxDrawSurfFields::Clear()
|
void XGfxDrawSurfFields::Clear()
|
||||||
|
|||||||
@ -28,44 +28,47 @@ XGfxImage::~XGfxImage()
|
|||||||
|
|
||||||
void XGfxImage::ParseData(QDataStream *aStream)
|
void XGfxImage::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
*aStream >> mMapType;
|
if (GetPtr() == -1)
|
||||||
|
|
||||||
mTexture.ParseData(aStream);
|
|
||||||
|
|
||||||
*aStream >> mSemantic;
|
|
||||||
|
|
||||||
aStream->skipRawData(3);
|
|
||||||
|
|
||||||
mCardMemory.ParseData(aStream);
|
|
||||||
|
|
||||||
qint32 pixelsPtr;
|
|
||||||
*aStream
|
|
||||||
>> mWidth
|
|
||||||
>> mHeight
|
|
||||||
>> mDepth
|
|
||||||
>> mCategory
|
|
||||||
>> mDelayLoadPixels
|
|
||||||
>> pixelsPtr
|
|
||||||
>> mBaseSize
|
|
||||||
>> mStreamSlot
|
|
||||||
>> mStreaming;
|
|
||||||
|
|
||||||
aStream->skipRawData(1);
|
|
||||||
|
|
||||||
mName.ParsePtr(aStream);
|
|
||||||
|
|
||||||
int variableSkip = 5;
|
|
||||||
if (mDelayLoadPixels)
|
|
||||||
{
|
{
|
||||||
variableSkip = 2;
|
*aStream >> mMapType;
|
||||||
|
|
||||||
|
mTexture.ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream >> mSemantic;
|
||||||
|
|
||||||
|
aStream->skipRawData(3);
|
||||||
|
|
||||||
|
mCardMemory.ParseData(aStream);
|
||||||
|
|
||||||
|
qint32 pixelsPtr;
|
||||||
|
*aStream
|
||||||
|
>> mWidth
|
||||||
|
>> mHeight
|
||||||
|
>> mDepth
|
||||||
|
>> mCategory
|
||||||
|
>> mDelayLoadPixels
|
||||||
|
>> pixelsPtr
|
||||||
|
>> mBaseSize
|
||||||
|
>> mStreamSlot
|
||||||
|
>> mStreaming;
|
||||||
|
|
||||||
|
aStream->skipRawData(1);
|
||||||
|
|
||||||
|
mName.ParsePtr(aStream);
|
||||||
|
|
||||||
|
int variableSkip = 5;
|
||||||
|
if (mDelayLoadPixels)
|
||||||
|
{
|
||||||
|
variableSkip = 2;
|
||||||
|
}
|
||||||
|
aStream->skipRawData(variableSkip);
|
||||||
|
if (pixelsPtr)
|
||||||
|
{
|
||||||
|
aStream->readRawData(mPixels.data(), mCardMemory.GetPlatform());
|
||||||
|
}
|
||||||
|
// TODO: This is wrong
|
||||||
|
mTexture.ParseData(aStream);
|
||||||
}
|
}
|
||||||
aStream->skipRawData(variableSkip);
|
|
||||||
if (pixelsPtr)
|
|
||||||
{
|
|
||||||
aStream->readRawData(mPixels.data(), mCardMemory.GetPlatform());
|
|
||||||
}
|
|
||||||
// TODO: This is wrong
|
|
||||||
mTexture.ParseData(aStream);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxImage::Clear()
|
void XGfxImage::Clear()
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
XGfxLightDef::XGfxLightDef()
|
XGfxLightDef::XGfxLightDef()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mName(new XString())
|
, mName()
|
||||||
, mAttenuation(new XGfxLightImage())
|
, mAttenuation()
|
||||||
, mLmapLookupStart(0)
|
, mLmapLookupStart(0)
|
||||||
{
|
{
|
||||||
SetType(ASSET_TYPE_LIGHT_DEF);
|
SetType(ASSET_TYPE_LIGHT_DEF);
|
||||||
@ -12,24 +12,22 @@ XGfxLightDef::XGfxLightDef()
|
|||||||
|
|
||||||
XGfxLightDef::~XGfxLightDef()
|
XGfxLightDef::~XGfxLightDef()
|
||||||
{
|
{
|
||||||
delete mName;
|
|
||||||
delete mAttenuation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxLightDef::Clear()
|
void XGfxLightDef::Clear()
|
||||||
{
|
{
|
||||||
mName->Clear();
|
mName.Clear();
|
||||||
mAttenuation->Clear();
|
mAttenuation.Clear();
|
||||||
mLmapLookupStart = 0;
|
mLmapLookupStart = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxLightDef::ParseData(QDataStream *aStream)
|
void XGfxLightDef::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
mName->ParsePtr(aStream, false);
|
mName.ParsePtr(aStream, false);
|
||||||
mAttenuation->ParseData(aStream);
|
mAttenuation.ParseData(aStream);
|
||||||
*aStream >> mLmapLookupStart;
|
*aStream >> mLmapLookupStart;
|
||||||
|
|
||||||
mName->ParseData(aStream);
|
mName.ParseData(aStream);
|
||||||
|
mAttenuation.ParseData(aStream);
|
||||||
//mAttenuation->
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,15 +8,15 @@
|
|||||||
struct XGfxLightDef : public XAsset
|
struct XGfxLightDef : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XGfxLightDef();
|
explicit XGfxLightDef();
|
||||||
~XGfxLightDef();
|
~XGfxLightDef();
|
||||||
|
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
virtual void ParseData(QDataStream *aStream) override;
|
virtual void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XString* mName;
|
XString mName;
|
||||||
XGfxLightImage* mAttenuation;
|
XGfxLightImage mAttenuation;
|
||||||
int mLmapLookupStart;
|
int mLmapLookupStart;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,19 @@ XGfxPackedVertex::XGfxPackedVertex()
|
|||||||
|
|
||||||
void XGfxPackedVertex::ParseData(QDataStream *aStream)
|
void XGfxPackedVertex::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mXYZ[0]
|
||||||
|
>> mXYZ[1]
|
||||||
|
>> mXYZ[2]
|
||||||
|
>> mBinormalSign;
|
||||||
|
|
||||||
|
mColor.ParseData(aStream);
|
||||||
|
mTexCoord.ParseData(aStream);
|
||||||
|
mNormal.ParseData(aStream);
|
||||||
|
mTangent.ParseData(aStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxPackedVertex::Clear()
|
void XGfxPackedVertex::Clear()
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
#include "xpackedtexcoords.h"
|
#include "xpackedtexcoords.h"
|
||||||
#include "xpackedunitvec.h"
|
#include "xpackedunitvec.h"
|
||||||
|
|
||||||
|
#include <QVector3D>
|
||||||
|
|
||||||
class XGfxPackedVertex : public XAsset
|
class XGfxPackedVertex : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -15,7 +17,7 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float mXYZ[3];
|
QVector3D mXYZ;
|
||||||
float mBinormalSign;
|
float mBinormalSign;
|
||||||
XGfxColor mColor;
|
XGfxColor mColor;
|
||||||
XPackedTexCoords mTexCoord;
|
XPackedTexCoords mTexCoord;
|
||||||
|
|||||||
@ -15,7 +15,14 @@ XGfxPlacement::~XGfxPlacement()
|
|||||||
|
|
||||||
void XGfxPlacement::ParseData(QDataStream *aStream)
|
void XGfxPlacement::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream
|
||||||
|
>> mQuat[0]
|
||||||
|
>> mQuat[1]
|
||||||
|
>> mQuat[2]
|
||||||
|
>> mQuat[3]
|
||||||
|
>> mOrigin[0]
|
||||||
|
>> mOrigin[2]
|
||||||
|
>> mOrigin[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxPlacement::Clear()
|
void XGfxPlacement::Clear()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
XGfxStateBits::XGfxStateBits()
|
XGfxStateBits::XGfxStateBits()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mLoadBits()
|
, mLoadBits(2)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -14,10 +14,15 @@ XGfxStateBits::~XGfxStateBits()
|
|||||||
|
|
||||||
void XGfxStateBits::ParseData(QDataStream *aStream)
|
void XGfxStateBits::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mLoadBits[0]
|
||||||
|
>> mLoadBits[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxStateBits::Clear()
|
void XGfxStateBits::Clear()
|
||||||
{
|
{
|
||||||
mLoadBits = QVector<quint32>();
|
mLoadBits.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,12 +3,60 @@
|
|||||||
|
|
||||||
XGfxWorld::XGfxWorld()
|
XGfxWorld::XGfxWorld()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mName("")
|
, mName()
|
||||||
, mStreamingInfo()
|
, mBaseName()
|
||||||
|
, mPlaneCount(0)
|
||||||
|
, mNodeCount(0)
|
||||||
|
, mIndexCount(0)
|
||||||
|
, mIndices(0)
|
||||||
|
, mIndexBuffer()
|
||||||
|
, mSurfaceCount(0)
|
||||||
|
, mStreamInfo()
|
||||||
|
, mSkySurfCount(0)
|
||||||
|
, mSkyStartSurfs()
|
||||||
|
, mSkyImage()
|
||||||
|
, mSkySamplerState(0)
|
||||||
|
, mVertexCount(0)
|
||||||
, mVertexData()
|
, mVertexData()
|
||||||
, mSunLightParams()
|
, mVertexLayerDataSize(0)
|
||||||
, mLights()
|
, mVertexLayerData()
|
||||||
|
, mSunParse()
|
||||||
|
, mSunLight()
|
||||||
|
, mSunColorFromBsp()
|
||||||
|
, mSunPrimaryLightIndex(0)
|
||||||
|
, mPrimaryLightCount(0)
|
||||||
|
, mCullGroupCount(0)
|
||||||
|
, mReflectionProbeCount(0)
|
||||||
, mReflectionProbes()
|
, mReflectionProbes()
|
||||||
|
, mReflectionProbeTextures()
|
||||||
|
, mDpvsPlanes()
|
||||||
|
, mCellBitsCount(0)
|
||||||
|
, mCells()
|
||||||
|
, mLightmapCount(0)
|
||||||
|
, mLightmaps()
|
||||||
|
, mLightGrid()
|
||||||
|
, mLightmapPrimaryTextures()
|
||||||
|
, mLightmapSecondaryTextures()
|
||||||
|
, mModelCount(0)
|
||||||
|
, mModels()
|
||||||
|
, mMins()
|
||||||
|
, mMaxs()
|
||||||
|
, mChecksum(0)
|
||||||
|
, mMaterialMemoryCount(0)
|
||||||
|
, mMaterialMemory()
|
||||||
|
, mSun()
|
||||||
|
, mOutdoorLookupMatrix()
|
||||||
|
, mOutdoorImage()
|
||||||
|
, mCellCasterBits()
|
||||||
|
, mSceneDynModel()
|
||||||
|
, mSceneDynBrush()
|
||||||
|
, mPrimaryLightEntityShadowVis()
|
||||||
|
, mPrimaryLightDynEntShadowVis()
|
||||||
|
, mNonSunPrimaryLightForModelDynEnt()
|
||||||
|
, mShadowGeom()
|
||||||
|
, mLightRegion()
|
||||||
|
, mDpvs()
|
||||||
|
, mDpvsDyn()
|
||||||
{
|
{
|
||||||
SetType(ASSET_TYPE_GFXWORLD);
|
SetType(ASSET_TYPE_GFXWORLD);
|
||||||
SetName("GFXWorld");
|
SetName("GFXWorld");
|
||||||
@ -21,35 +69,252 @@ XGfxWorld::~XGfxWorld()
|
|||||||
|
|
||||||
void XGfxWorld::ParseData(QDataStream *aStream) {
|
void XGfxWorld::ParseData(QDataStream *aStream) {
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
mName = XString::ParseCustom(aStream);
|
mName.ParsePtr(aStream, false);
|
||||||
|
mBaseName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
// Parse streaming info
|
qint32 indicesPtr;
|
||||||
mStreamingInfo.ParseData(aStream);
|
*aStream
|
||||||
|
>> mPlaneCount
|
||||||
|
>> mNodeCount
|
||||||
|
>> mIndexCount
|
||||||
|
>> indicesPtr;
|
||||||
|
|
||||||
|
mIndexBuffer.ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream >> mSurfaceCount;
|
||||||
|
|
||||||
|
mStreamInfo.SetPtr(-1);
|
||||||
|
mStreamInfo.ParseData(aStream);
|
||||||
|
|
||||||
|
qint32 skyStartSurfPtr, skyImagePtr;
|
||||||
|
*aStream
|
||||||
|
>> mSkySurfCount
|
||||||
|
>> skyStartSurfPtr
|
||||||
|
>> skyImagePtr
|
||||||
|
>> mSkySamplerState;
|
||||||
|
|
||||||
|
aStream->skipRawData(3);
|
||||||
|
|
||||||
|
*aStream >> mVertexCount;
|
||||||
|
|
||||||
// Parse vertex data
|
|
||||||
mVertexData.ParseData(aStream);
|
mVertexData.ParseData(aStream);
|
||||||
|
|
||||||
// Parse sun light params
|
*aStream >> mVertexLayerDataSize;
|
||||||
mSunLightParams.ParseData(aStream);
|
|
||||||
|
|
||||||
// Parse lights count and array
|
mVertexLayerData.ParseData(aStream);
|
||||||
int lightCount;
|
mSunParse.ParseData(aStream);
|
||||||
*aStream >> lightCount;
|
|
||||||
for (int i = 0; i < lightCount; ++i) {
|
mSunLight.ParsePtr(aStream, false);
|
||||||
XGfxLight light;
|
|
||||||
light.ParseData(aStream);
|
float r, g, b;
|
||||||
mLights.append(light);
|
*aStream
|
||||||
|
>> r
|
||||||
|
>> g
|
||||||
|
>> b;
|
||||||
|
mSunColorFromBsp = QColor(r, g, b);
|
||||||
|
|
||||||
|
qint32 reflectionProbesPtr, reflectionProbeTexturesPtr;
|
||||||
|
*aStream
|
||||||
|
>> mSunPrimaryLightIndex
|
||||||
|
>> mPrimaryLightCount
|
||||||
|
>> mCullGroupCount
|
||||||
|
>> mReflectionProbeCount
|
||||||
|
>> reflectionProbesPtr
|
||||||
|
>> reflectionProbeTexturesPtr;
|
||||||
|
|
||||||
|
mDpvsPlanes.ParseData(aStream);
|
||||||
|
|
||||||
|
qint32 cellsPtr, lightmapsPtr;
|
||||||
|
*aStream
|
||||||
|
>> mCellBitsCount
|
||||||
|
>> cellsPtr
|
||||||
|
>> mLightmapCount
|
||||||
|
>> lightmapsPtr;
|
||||||
|
|
||||||
|
mLightGrid.ParseData(aStream);
|
||||||
|
|
||||||
|
qint32 lightMapsPrimaryPtr, lightmapSecondaryPtr, modelsPtr, materialMemoryPtr;
|
||||||
|
*aStream
|
||||||
|
>> lightMapsPrimaryPtr
|
||||||
|
>> lightmapSecondaryPtr
|
||||||
|
>> mModelCount
|
||||||
|
>> modelsPtr
|
||||||
|
>> mMins[0]
|
||||||
|
>> mMins[1]
|
||||||
|
>> mMins[2]
|
||||||
|
>> mMaxs[0]
|
||||||
|
>> mMaxs[1]
|
||||||
|
>> mMaxs[2]
|
||||||
|
>> mChecksum
|
||||||
|
>> mMaterialMemoryCount
|
||||||
|
>> materialMemoryPtr;
|
||||||
|
|
||||||
|
mSun.ParseData(aStream);
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < 4; j++)
|
||||||
|
{
|
||||||
|
mOutdoorLookupMatrix[i][j];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse reflection probes count and array
|
qint32 outdoorImagePtr, cellCasterBitsPtr, sceneDynModelPtr, sceneDynBrushPtr,
|
||||||
int probeCount;
|
primaryLightEntPtr, primaryLightDynPtr, nonSunPrimaryPtr, shadowGeomPtr, lightRegionPtr;
|
||||||
*aStream >> probeCount;
|
*aStream
|
||||||
for (int i = 0; i < probeCount; ++i) {
|
>> outdoorImagePtr
|
||||||
XGfxReflectionProbe probe;
|
>> cellCasterBitsPtr
|
||||||
probe.ParseData(aStream);
|
>> sceneDynModelPtr
|
||||||
mReflectionProbes.append(probe);
|
>> sceneDynBrushPtr
|
||||||
|
>> primaryLightEntPtr
|
||||||
|
>> primaryLightDynPtr
|
||||||
|
>> nonSunPrimaryPtr
|
||||||
|
>> shadowGeomPtr
|
||||||
|
>> lightRegionPtr;
|
||||||
|
|
||||||
|
mDpvs.ParseData(aStream);
|
||||||
|
mDpvsDyn.ParseData(aStream);
|
||||||
|
|
||||||
|
mName.ParseData(aStream);
|
||||||
|
mBaseName.ParseData(aStream);
|
||||||
|
|
||||||
|
if (indicesPtr)
|
||||||
|
{
|
||||||
|
aStream->readRawData(mIndices.data(), 2 * mIndexCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
//mIndexBuffer.ParseData(aStream);
|
||||||
|
|
||||||
|
if (skyStartSurfPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mSkySurfCount; i++)
|
||||||
|
{
|
||||||
|
qint32 newSurface;
|
||||||
|
*aStream >> newSurface;
|
||||||
|
mSkyStartSurfs.append(newSurface);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mSkyImage.ParseData(aStream);
|
||||||
|
mSunLight.ParseData(aStream);
|
||||||
|
|
||||||
|
if (reflectionProbesPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mReflectionProbeCount; i++)
|
||||||
|
{
|
||||||
|
XGfxReflectionProbe newProbe;
|
||||||
|
newProbe.ParseData(aStream);
|
||||||
|
mReflectionProbes.append(newProbe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reflectionProbeTexturesPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mReflectionProbeCount; i++)
|
||||||
|
{
|
||||||
|
XGfxTexture newProbeTexture;
|
||||||
|
newProbeTexture.ParseData(aStream);
|
||||||
|
mReflectionProbeTextures.append(newProbeTexture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mDpvsPlanes.ParseData(aStream);
|
||||||
|
|
||||||
|
if (cellsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mDpvsPlanes.GetCellCount(); i++)
|
||||||
|
{
|
||||||
|
XGfxCell newCell;
|
||||||
|
newCell.ParseData(aStream);
|
||||||
|
mCells.append(newCell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lightmapsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mLightmapCount; i++)
|
||||||
|
{
|
||||||
|
XGfxLightmapArray lightMapArray;
|
||||||
|
lightMapArray.ParseData(aStream);
|
||||||
|
mLightmaps.append(lightMapArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mLightGrid.ParseData(aStream);
|
||||||
|
|
||||||
|
if (lightMapsPrimaryPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mLightmapCount; i++)
|
||||||
|
{
|
||||||
|
XGfxTexture primaryTexture;
|
||||||
|
primaryTexture.ParseData(aStream);
|
||||||
|
mLightmapPrimaryTextures.append(primaryTexture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (lightmapSecondaryPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mLightmapCount; i++)
|
||||||
|
{
|
||||||
|
XGfxTexture secondaryTexture;
|
||||||
|
secondaryTexture.ParseData(aStream);
|
||||||
|
mLightmapSecondaryTextures.append(secondaryTexture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (modelsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mModelCount; i++)
|
||||||
|
{
|
||||||
|
XGfxBrushModel newModel;
|
||||||
|
newModel.ParseData(aStream);
|
||||||
|
mModels.append(newModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (materialMemoryPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mMaterialMemoryCount; i++)
|
||||||
|
{
|
||||||
|
XMaterialMemory newMaterialMemory;
|
||||||
|
newMaterialMemory.ParseData(aStream);
|
||||||
|
mMaterialMemory.append(newMaterialMemory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//mVertexData.ParseData(aStream);
|
||||||
|
//mVertexLayerData.ParseData(aStream);
|
||||||
|
|
||||||
|
mSun.ParseData(aStream);
|
||||||
|
mOutdoorImage.ParseData(aStream);
|
||||||
|
|
||||||
|
if (cellCasterBitsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < ((mDpvsPlanes.GetCellCount() + 31) >> 5) * mDpvsPlanes.GetCellCount(); i++)
|
||||||
|
{
|
||||||
|
quint32 casterBit;
|
||||||
|
*aStream >> casterBit;
|
||||||
|
mCellCasterBits.append(casterBit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sceneDynModelPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mDpvsDyn.GetClientCount(1); i++)
|
||||||
|
{
|
||||||
|
XGfxSceneDynModel dynModel;
|
||||||
|
dynModel.ParseData(aStream);
|
||||||
|
mSceneDynModel.append(dynModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sceneDynBrushPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mDpvsDyn.GetClientCount(1); i++)
|
||||||
|
{
|
||||||
|
XGfxSceneDynBrush dynBrush;
|
||||||
|
dynBrush.ParseData(aStream);
|
||||||
|
mSceneDynBrush.append(dynBrush);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// TODO: Finish this... Double ugh
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxWorld::Clear()
|
void XGfxWorld::Clear()
|
||||||
|
|||||||
@ -2,10 +2,25 @@
|
|||||||
#define XGFXWORLD_H
|
#define XGFXWORLD_H
|
||||||
|
|
||||||
#include "xasset.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 "xgfxworldstreaminfo.h"
|
||||||
#include "xgfxworldvertexdata.h"
|
#include "xgfxworldvertexdata.h"
|
||||||
|
#include "xgfxworldvertexlayerdata.h"
|
||||||
|
#include "xmaterialmemory.h"
|
||||||
#include "xsunlightparseparams.h"
|
#include "xsunlightparseparams.h"
|
||||||
#include "xgfxlight.h"
|
#include "xgfxlight.h"
|
||||||
|
#include "xsunflare.h"
|
||||||
#include "xgfxreflectionprobe.h"
|
#include "xgfxreflectionprobe.h"
|
||||||
|
|
||||||
class XGfxWorld : public XAsset
|
class XGfxWorld : public XAsset
|
||||||
@ -18,12 +33,60 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
XString mName;
|
||||||
XGfxWorldStreamInfo mStreamingInfo;
|
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;
|
XGfxWorldVertexData mVertexData;
|
||||||
XSunLightParseParams mSunLightParams;
|
quint32 mVertexLayerDataSize;
|
||||||
QVector<XGfxLight> mLights;
|
XGfxWorldVertexLayerData mVertexLayerData;
|
||||||
|
XSunLightParseParams mSunParse;
|
||||||
|
XGfxLight mSunLight;
|
||||||
|
QColor mSunColorFromBsp;
|
||||||
|
quint32 mSunPrimaryLightIndex;
|
||||||
|
quint32 mPrimaryLightCount;
|
||||||
|
qint32 mCullGroupCount;
|
||||||
|
quint32 mReflectionProbeCount;
|
||||||
QVector<XGfxReflectionProbe> mReflectionProbes;
|
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
|
#endif // XGFXWORLD_H
|
||||||
|
|||||||
@ -17,6 +17,11 @@ XGfxWorldDpvsDynamic::~XGfxWorldDpvsDynamic()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint XGfxWorldDpvsDynamic::GetClientCount(int aIndex) const
|
||||||
|
{
|
||||||
|
return mDynEntClientCount[aIndex];
|
||||||
|
}
|
||||||
|
|
||||||
void XGfxWorldDpvsDynamic::ParseData(QDataStream *aStream)
|
void XGfxWorldDpvsDynamic::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,8 @@ public:
|
|||||||
XGfxWorldDpvsDynamic();
|
XGfxWorldDpvsDynamic();
|
||||||
~XGfxWorldDpvsDynamic();
|
~XGfxWorldDpvsDynamic();
|
||||||
|
|
||||||
|
uint GetClientCount(int aIndex) const;
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,11 @@ XGfxWorldDpvsPlanes::~XGfxWorldDpvsPlanes()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int XGfxWorldDpvsPlanes::GetCellCount() const
|
||||||
|
{
|
||||||
|
return aCellCount;
|
||||||
|
}
|
||||||
|
|
||||||
void XGfxWorldDpvsPlanes::ParseData(QDataStream *aStream)
|
void XGfxWorldDpvsPlanes::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,8 @@ public:
|
|||||||
explicit XGfxWorldDpvsPlanes();
|
explicit XGfxWorldDpvsPlanes();
|
||||||
~XGfxWorldDpvsPlanes();
|
~XGfxWorldDpvsPlanes();
|
||||||
|
|
||||||
|
int GetCellCount() const;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
|
|||||||
@ -1,51 +1,30 @@
|
|||||||
#include "xgfxworldvertexdata.h"
|
#include "xgfxworldvertexdata.h"
|
||||||
|
|
||||||
XGfxWorldVertexData::XGfxWorldVertexData()
|
XGfxWorldVertexData::XGfxWorldVertexData()
|
||||||
: XAsset() {
|
: XAsset()
|
||||||
|
, mVertices()
|
||||||
|
, mWorldVertexBuffer()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XGfxWorldVertexData::~XGfxWorldVertexData()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxWorldVertexData::Clear()
|
||||||
|
{
|
||||||
|
mVertices.clear();
|
||||||
|
mWorldVertexBuffer.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGfxWorldVertexData::ParseData(QDataStream *aStream) {
|
void XGfxWorldVertexData::ParseData(QDataStream *aStream) {
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
// Parse vertex count
|
|
||||||
int vertexCount;
|
|
||||||
*aStream >> vertexCount;
|
|
||||||
|
|
||||||
// Clear existing data before parsing new data
|
qint32 worldVertexPtr;
|
||||||
mVertices.clear();
|
*aStream >> worldVertexPtr;
|
||||||
|
|
||||||
// Parse vertices
|
mWorldVertexBuffer.ParseData(aStream);
|
||||||
for (int i = 0; i < vertexCount; ++i) {
|
|
||||||
XGfxWorldVertex vertex;
|
|
||||||
vertex.ParseData(aStream);
|
|
||||||
mVertices.append(vertex);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Skip D3DVertexBuffer pointer - we'll handle this appropriately later
|
|
||||||
qint32 bufferPtr;
|
|
||||||
*aStream >> bufferPtr;
|
|
||||||
if (bufferPtr == -1)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<XGfxWorldVertex>& XGfxWorldVertexData::GetVertices() {
|
|
||||||
return mVertices;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QVector<XGfxWorldVertex>& XGfxWorldVertexData::GetVertices() const {
|
|
||||||
return mVertices;
|
|
||||||
}
|
|
||||||
|
|
||||||
void XGfxWorldVertexData::SetVertices(const QVector<XGfxWorldVertex>& vertices) {
|
|
||||||
mVertices = vertices;
|
|
||||||
}
|
|
||||||
|
|
||||||
int XGfxWorldVertexData::GetVertexBufferPtr() const {
|
|
||||||
return mVertexBufferPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void XGfxWorldVertexData::SetVertexBufferPtr(int ptr) {
|
|
||||||
mVertexBufferPtr = ptr;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#define XGFXWORLDVERTEXDATA_H
|
#define XGFXWORLDVERTEXDATA_H
|
||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
|
#include "xd3dvertexbuffer.h"
|
||||||
#include "xgfxworldvertex.h"
|
#include "xgfxworldvertex.h"
|
||||||
|
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
@ -10,20 +11,14 @@ class XGfxWorldVertexData : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XGfxWorldVertexData();
|
explicit XGfxWorldVertexData();
|
||||||
|
~XGfxWorldVertexData();
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
void Clear() override;
|
||||||
QVector<XGfxWorldVertex>& GetVertices();
|
|
||||||
const QVector<XGfxWorldVertex>& GetVertices() const;
|
|
||||||
void SetVertices(const QVector<XGfxWorldVertex>& vertices);
|
|
||||||
|
|
||||||
// Note: D3DVertexBuffer is a placeholder - we need to handle this appropriately
|
|
||||||
int GetVertexBufferPtr() const;
|
|
||||||
void SetVertexBufferPtr(int ptr);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector<XGfxWorldVertex> mVertices; // Using QVector for automatic memory management
|
QVector<XGfxWorldVertex> mVertices;
|
||||||
int mVertexBufferPtr = 0; // Placeholder for D3DVertexBuffer pointer
|
XD3DVertexBuffer mWorldVertexBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XGFXWORLDVERTEXDATA_H
|
#endif // XGFXWORLDVERTEXDATA_H
|
||||||
|
|||||||
@ -53,6 +53,11 @@ XItemDef::~XItemDef()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int XItemDef::GetType() const
|
||||||
|
{
|
||||||
|
return mType;
|
||||||
|
}
|
||||||
|
|
||||||
void XItemDef::Clear()
|
void XItemDef::Clear()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,8 @@ public:
|
|||||||
explicit XItemDef();
|
explicit XItemDef();
|
||||||
~XItemDef();
|
~XItemDef();
|
||||||
|
|
||||||
|
int GetType() const;
|
||||||
|
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
|||||||
@ -1,41 +1,78 @@
|
|||||||
#include "xglyph.h"
|
#include "xitemdefdata.h"
|
||||||
|
#include "xitemdef.h"
|
||||||
|
|
||||||
XGlyph::XGlyph()
|
XItemDefData::XItemDefData()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mLetter(0)
|
, mListBox()
|
||||||
, mX0(0)
|
, mEditField()
|
||||||
, mY0(0)
|
, mMulti()
|
||||||
, mDx(0)
|
, mEnumDvarName()
|
||||||
, mPixelWidth(0)
|
, mParent(nullptr)
|
||||||
, mPixelHeight(0)
|
|
||||||
, mS0(0)
|
|
||||||
, mT0(0)
|
|
||||||
, mS1(0)
|
|
||||||
, mT1(0)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XGlyph::~XGlyph()
|
XItemDefData::XItemDefData(XItemDef &aParent)
|
||||||
|
: XAsset()
|
||||||
|
, mListBox()
|
||||||
|
, mEditField()
|
||||||
|
, mMulti()
|
||||||
|
, mEnumDvarName()
|
||||||
|
, mParent(&aParent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGlyph::Clear()
|
XItemDefData::~XItemDefData()
|
||||||
{
|
{
|
||||||
mLetter = 0;
|
delete mParent;
|
||||||
mX0 = 0;
|
|
||||||
mY0 = 0;
|
|
||||||
mDx = 0;
|
|
||||||
mPixelWidth = 0;
|
|
||||||
mPixelHeight = 0;
|
|
||||||
mS0 = 0;
|
|
||||||
mT0 = 0;
|
|
||||||
mS1 = 0;
|
|
||||||
mT1 = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XGlyph::ParseData(QDataStream *aStream)
|
void XItemDefData::Clear()
|
||||||
{
|
{
|
||||||
|
mListBox.Clear();
|
||||||
|
mEditField.Clear();
|
||||||
|
mMulti.Clear();
|
||||||
|
mEnumDvarName.Clear();
|
||||||
|
mParent = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XItemDefData::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
if (!mParent)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mListBox.ParsePtr(aStream, false);
|
||||||
|
mEditField.ParsePtr(aStream, false);
|
||||||
|
mMulti.ParsePtr(aStream, false);
|
||||||
|
mEnumDvarName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
qint32 dataPtr;
|
||||||
|
*aStream >> dataPtr;
|
||||||
|
|
||||||
|
switch (mParent->GetType())
|
||||||
|
{
|
||||||
|
case 6:
|
||||||
|
mListBox.ParseData(aStream);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
case 4:
|
||||||
|
case 9:
|
||||||
|
case 10:
|
||||||
|
case 11:
|
||||||
|
case 14:
|
||||||
|
case 16:
|
||||||
|
case 17:
|
||||||
|
case 18:
|
||||||
|
mListBox.ParseData(aStream);
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
mMulti.ParseData(aStream);
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
mEnumDvarName.ParseData(aStream);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,21 +6,24 @@
|
|||||||
#include "xeditfielddefinition.h"
|
#include "xeditfielddefinition.h"
|
||||||
#include "xmultidef.h"
|
#include "xmultidef.h"
|
||||||
|
|
||||||
|
class XItemDef;
|
||||||
|
|
||||||
class XItemDefData : public XAsset
|
class XItemDefData : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XItemDefData();
|
explicit XItemDefData();
|
||||||
|
XItemDefData(XItemDef& aParent);
|
||||||
~XItemDefData();
|
~XItemDefData();
|
||||||
|
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XListBoxDef *listBox;
|
XListBoxDef mListBox;
|
||||||
XEditFieldDefinition *editField;
|
XEditFieldDefinition mEditField;
|
||||||
XMultiDef *multi;
|
XMultiDef mMulti;
|
||||||
const char *enumDvarName;
|
XString mEnumDvarName;
|
||||||
void *data;
|
XItemDef* mParent;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XITEMDEFDATA_H
|
#endif // XITEMDEFDATA_H
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
XItemKeyHandler::XItemKeyHandler()
|
XItemKeyHandler::XItemKeyHandler()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mKey(0)
|
, mKey(0)
|
||||||
, mAction("")
|
, mAction()
|
||||||
, mNext(new XItemKeyHandler())
|
, mNext(nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -16,13 +16,28 @@ XItemKeyHandler::~XItemKeyHandler()
|
|||||||
|
|
||||||
void XItemKeyHandler::ParseData(QDataStream *aStream)
|
void XItemKeyHandler::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
*aStream >> mKey;
|
||||||
|
|
||||||
|
mAction.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
qint32 nextPtr;
|
||||||
|
*aStream >> nextPtr;
|
||||||
|
|
||||||
|
mAction.ParseData(aStream);
|
||||||
|
|
||||||
|
if (nextPtr)
|
||||||
|
{
|
||||||
|
mNext = new XItemKeyHandler();
|
||||||
|
mNext->ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XItemKeyHandler::Clear()
|
void XItemKeyHandler::Clear()
|
||||||
{
|
{
|
||||||
mKey = 0;
|
mKey = 0;
|
||||||
mAction = "";
|
mAction.Clear();
|
||||||
delete mNext;
|
mNext = nullptr;
|
||||||
mNext = new XItemKeyHandler();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,7 @@
|
|||||||
#define XITEMKEYHANDLER_H
|
#define XITEMKEYHANDLER_H
|
||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
|
#include "xstring.h"
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
class XItemKeyHandler : public XAsset
|
class XItemKeyHandler : public XAsset
|
||||||
{
|
{
|
||||||
@ -16,7 +15,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int mKey;
|
int mKey;
|
||||||
QString mAction;
|
XString mAction;
|
||||||
XItemKeyHandler *mNext;
|
XItemKeyHandler *mNext;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -33,11 +33,14 @@ void XLocalizeEntry::Clear()
|
|||||||
|
|
||||||
void XLocalizeEntry::ParseData(QDataStream *aStream)
|
void XLocalizeEntry::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
mValue->ParsePtr(aStream, false);
|
if (GetPtr() == -1)
|
||||||
mName->ParsePtr(aStream, false);
|
{
|
||||||
|
mValue->ParsePtr(aStream, false);
|
||||||
|
mName->ParsePtr(aStream, false);
|
||||||
|
|
||||||
mValue->ParseData(aStream);
|
mValue->ParseData(aStream);
|
||||||
mName->ParseData(aStream);
|
mName->ParseData(aStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XLocalizeEntry::SetValue(XString* aValue)
|
void XLocalizeEntry::SetValue(XString* aValue)
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
XMapEnts::XMapEnts()
|
XMapEnts::XMapEnts()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
|
, mName()
|
||||||
|
, mEntityString()
|
||||||
|
, mNumEntityChars()
|
||||||
{
|
{
|
||||||
SetType(ASSET_TYPE_MAP_ENTS);
|
SetType(ASSET_TYPE_MAP_ENTS);
|
||||||
SetName("Map Ents");
|
SetName("Map Ents");
|
||||||
@ -14,10 +17,20 @@ XMapEnts::~XMapEnts()
|
|||||||
|
|
||||||
void XMapEnts::Clear()
|
void XMapEnts::Clear()
|
||||||
{
|
{
|
||||||
|
mName.Clear();
|
||||||
|
mEntityString.Clear();
|
||||||
|
mNumEntityChars = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMapEnts::ParseData(QDataStream *aStream)
|
void XMapEnts::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
mEntityString.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream >> mNumEntityChars;
|
||||||
|
|
||||||
|
mName.ParseData(aStream);
|
||||||
|
|
||||||
|
mEntityString.SetContentLength(mNumEntityChars);
|
||||||
|
mEntityString.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,15 +7,15 @@
|
|||||||
class XMapEnts : public XAsset
|
class XMapEnts : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XMapEnts();
|
explicit XMapEnts();
|
||||||
~XMapEnts();
|
~XMapEnts();
|
||||||
|
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
virtual void ParseData(QDataStream *aStream) override;
|
virtual void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XString* mName;
|
XString mName;
|
||||||
XString* mEntityString;
|
XString mEntityString;
|
||||||
int mNumEntityChars;
|
int mNumEntityChars;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
XMaterial::XMaterial()
|
XMaterial::XMaterial()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mInfo()
|
, mInfo()
|
||||||
, mStateBitsEntry()
|
, mStateBitsEntry(26)
|
||||||
, mTextureCount(0)
|
, mTextureCount(0)
|
||||||
, mConstantCount(0)
|
, mConstantCount(0)
|
||||||
, mStateBitsCount(0)
|
, mStateBitsCount(0)
|
||||||
@ -25,7 +25,31 @@ XMaterial::~XMaterial()
|
|||||||
|
|
||||||
void XMaterial::ParseData(QDataStream *aStream)
|
void XMaterial::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mInfo.ParseData(aStream);
|
||||||
|
|
||||||
|
for (int i = 0; i < 26; i++)
|
||||||
|
{
|
||||||
|
*aStream >> mStateBitsEntry[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mTextureCount
|
||||||
|
>> mConstantCount
|
||||||
|
>> mStateBitsCount
|
||||||
|
>> mStateFlags
|
||||||
|
>> mCameraRegion;
|
||||||
|
|
||||||
|
aStream->skipRawData(1);
|
||||||
|
|
||||||
|
mTechniqueSet.ParsePtr(aStream, false);
|
||||||
|
mTextureTable.ParsePtr(aStream, false);
|
||||||
|
mConstantTable.ParsePtr(aStream, false);
|
||||||
|
mStateBitsTable.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
mTechniqueSet.ParseData(aStream);
|
||||||
|
mTextureTable.ParseData(aStream);
|
||||||
|
mConstantTable.ParseData(aStream);
|
||||||
|
mStateBitsTable.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterial::Clear()
|
void XMaterial::Clear()
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
XMaterialConstantDef::XMaterialConstantDef()
|
XMaterialConstantDef::XMaterialConstantDef()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mNameHash(0)
|
, mNameHash(0)
|
||||||
, mName("")
|
, mName()
|
||||||
, mLiteral()
|
, mLiteral()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -16,12 +16,26 @@ XMaterialConstantDef::~XMaterialConstantDef()
|
|||||||
|
|
||||||
void XMaterialConstantDef::ParseData(QDataStream *aStream)
|
void XMaterialConstantDef::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
*aStream >> mNameHash;
|
||||||
|
|
||||||
|
QByteArray rawName(12, Qt::Uninitialized);
|
||||||
|
aStream->readRawData(rawName.data(), 12);
|
||||||
|
|
||||||
|
mName.SetString(QString::fromUtf8(rawName));
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mLiteral[0]
|
||||||
|
>> mLiteral[1]
|
||||||
|
>> mLiteral[2]
|
||||||
|
>> mLiteral[3];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialConstantDef::Clear()
|
void XMaterialConstantDef::Clear()
|
||||||
{
|
{
|
||||||
mNameHash = 0;
|
mNameHash = 0;
|
||||||
mName = "";
|
mName.Clear();
|
||||||
mLiteral.clear();
|
mLiteral.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,13 +2,14 @@
|
|||||||
#define XMATERIALCONSTANTDEF_H
|
#define XMATERIALCONSTANTDEF_H
|
||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
|
#include "xstring.h"
|
||||||
|
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
class XMaterialConstantDef : public XAsset
|
class XMaterialConstantDef : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XMaterialConstantDef();
|
explicit XMaterialConstantDef();
|
||||||
~XMaterialConstantDef();
|
~XMaterialConstantDef();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
@ -16,7 +17,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
quint32 mNameHash;
|
quint32 mNameHash;
|
||||||
QString mName;
|
XString mName;
|
||||||
QVector<float> mLiteral;
|
QVector<float> mLiteral;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
XMaterialInfo::XMaterialInfo()
|
XMaterialInfo::XMaterialInfo()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mName("")
|
, mName()
|
||||||
, mGameFlags(0)
|
, mGameFlags(0)
|
||||||
, mSortKey(0)
|
, mSortKey(0)
|
||||||
, mTextureAtlasRowCount(0)
|
, mTextureAtlasRowCount(0)
|
||||||
@ -20,7 +20,20 @@ XMaterialInfo::~XMaterialInfo()
|
|||||||
|
|
||||||
void XMaterialInfo::ParseData(QDataStream *aStream)
|
void XMaterialInfo::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mGameFlags
|
||||||
|
>> mSortKey
|
||||||
|
>> mTextureAtlasRowCount
|
||||||
|
>> mTextureAtlasColumnCount;
|
||||||
|
|
||||||
|
mDrawSurf.ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream >> mSurfaceTypeBits;
|
||||||
|
aStream->skipRawData(4);
|
||||||
|
|
||||||
|
mName.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialInfo::Clear()
|
void XMaterialInfo::Clear()
|
||||||
|
|||||||
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
#include "xgfxdrawsurf.h"
|
#include "xgfxdrawsurf.h"
|
||||||
|
#include "xstring.h"
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
class XMaterialInfo : public XAsset
|
class XMaterialInfo : public XAsset
|
||||||
{
|
{
|
||||||
@ -16,7 +15,7 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
XString mName;
|
||||||
quint8 mGameFlags;
|
quint8 mGameFlags;
|
||||||
quint8 mSortKey;
|
quint8 mSortKey;
|
||||||
quint8 mTextureAtlasRowCount;
|
quint8 mTextureAtlasRowCount;
|
||||||
|
|||||||
@ -18,40 +18,44 @@ XMaterialTechniqueSet::~XMaterialTechniqueSet()
|
|||||||
|
|
||||||
void XMaterialTechniqueSet::ParseData(QDataStream *aStream)
|
void XMaterialTechniqueSet::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
if (IsDebug())
|
if (GetPtr() == -1)
|
||||||
{
|
{
|
||||||
qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName());
|
if (IsDebug())
|
||||||
}
|
{
|
||||||
mName.ParsePtr(aStream, false);
|
qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName());
|
||||||
|
}
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
*aStream >> mWorldVertFormat;
|
*aStream >> mWorldVertFormat;
|
||||||
if (IsDebug())
|
if (IsDebug())
|
||||||
{
|
{
|
||||||
qDebug() << QString("[%1] mWorldVertFormat = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mWorldVertFormat);
|
qDebug() << QString("[%1] mWorldVertFormat = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mWorldVertFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
aStream->skipRawData(3);
|
aStream->skipRawData(3);
|
||||||
|
|
||||||
qint32 remappedPtr;
|
qint32 remappedPtr;
|
||||||
*aStream >> remappedPtr;
|
*aStream >> remappedPtr;
|
||||||
if (IsDebug())
|
if (IsDebug())
|
||||||
{
|
{
|
||||||
qDebug() << QString("[%1] remappedPtr = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(remappedPtr);
|
qDebug() << QString("[%1] remappedPtr = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(remappedPtr);
|
||||||
|
|
||||||
qDebug() << QString("Parsing techniques.");
|
qDebug() << QString("Parsing techniques.");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 26; i++)
|
for (int i = 0; i < 26; i++)
|
||||||
{
|
{
|
||||||
XMaterialTechnique newTechnique;
|
XMaterialTechnique newTechnique;
|
||||||
newTechnique.ParsePtr(aStream, false);
|
newTechnique.ParsePtr(aStream, false);
|
||||||
mTechniques.append(newTechnique);
|
mTechniques.append(newTechnique);
|
||||||
}
|
}
|
||||||
|
|
||||||
mName.ParseData(aStream, ",");
|
mName.SetRemoveString(",");
|
||||||
|
mName.ParseData(aStream);
|
||||||
|
|
||||||
for (int i = 0; i < 26; i++)
|
for (int i = 0; i < 26; i++)
|
||||||
{
|
{
|
||||||
mTechniques[i].ParseData(aStream);
|
mTechniques[i].ParseData(aStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ XMaterialTextureDef::XMaterialTextureDef()
|
|||||||
, mNameEnd(0)
|
, mNameEnd(0)
|
||||||
, mSamplerState(0)
|
, mSamplerState(0)
|
||||||
, mSemantic(0)
|
, mSemantic(0)
|
||||||
, mDefInfo()
|
, mDefInfo(*this)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -17,9 +17,33 @@ XMaterialTextureDef::~XMaterialTextureDef()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
quint8 XMaterialTextureDef::GetSemantic() const
|
||||||
|
{
|
||||||
|
return mSemantic;
|
||||||
|
}
|
||||||
|
|
||||||
void XMaterialTextureDef::ParseData(QDataStream *aStream)
|
void XMaterialTextureDef::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mNameHash
|
||||||
|
>> mNameStart
|
||||||
|
>> mNameEnd
|
||||||
|
>> mSamplerState
|
||||||
|
>> mSemantic;
|
||||||
|
|
||||||
|
mDefInfo.ParseData(aStream);
|
||||||
|
|
||||||
|
if (mSemantic == 11)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialTextureDef::Clear()
|
void XMaterialTextureDef::Clear()
|
||||||
|
|||||||
@ -10,6 +10,8 @@ public:
|
|||||||
XMaterialTextureDef();
|
XMaterialTextureDef();
|
||||||
~XMaterialTextureDef();
|
~XMaterialTextureDef();
|
||||||
|
|
||||||
|
quint8 GetSemantic() const;
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,20 @@
|
|||||||
#include "xmaterialtexturedefinfo.h"
|
#include "xmaterialtexturedefinfo.h"
|
||||||
|
#include "xmaterialtexturedef.h"
|
||||||
|
|
||||||
XMaterialTextureDefInfo::XMaterialTextureDefInfo()
|
XMaterialTextureDefInfo::XMaterialTextureDefInfo()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mImage()
|
, mImage()
|
||||||
, mWater()
|
, mWater()
|
||||||
|
, aParent(nullptr)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XMaterialTextureDefInfo::XMaterialTextureDefInfo(XMaterialTextureDef &aParent)
|
||||||
|
: XAsset()
|
||||||
|
, mImage()
|
||||||
|
, mWater()
|
||||||
|
, aParent(&aParent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -15,7 +26,18 @@ XMaterialTextureDefInfo::~XMaterialTextureDefInfo()
|
|||||||
|
|
||||||
void XMaterialTextureDefInfo::ParseData(QDataStream *aStream)
|
void XMaterialTextureDefInfo::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mImage.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
if (aParent->GetSemantic() == 11) {
|
||||||
|
if (mImage.GetPtr() == -1)
|
||||||
|
{
|
||||||
|
mWater.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mImage.ParseData(aStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialTextureDefInfo::Clear()
|
void XMaterialTextureDefInfo::Clear()
|
||||||
|
|||||||
@ -5,10 +5,13 @@
|
|||||||
#include "xgfximage.h"
|
#include "xgfximage.h"
|
||||||
#include "xwater.h"
|
#include "xwater.h"
|
||||||
|
|
||||||
|
class XMaterialTextureDef;
|
||||||
|
|
||||||
class XMaterialTextureDefInfo : public XAsset
|
class XMaterialTextureDefInfo : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XMaterialTextureDefInfo();
|
explicit XMaterialTextureDefInfo();
|
||||||
|
XMaterialTextureDefInfo(XMaterialTextureDef& aParent);
|
||||||
~XMaterialTextureDefInfo();
|
~XMaterialTextureDefInfo();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
@ -17,6 +20,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
XGfxImage mImage;
|
XGfxImage mImage;
|
||||||
XWater mWater;
|
XWater mWater;
|
||||||
|
XMaterialTextureDef* aParent;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XMATERIALTEXTUREDEFINFO_H
|
#endif // XMATERIALTEXTUREDEFINFO_H
|
||||||
|
|||||||
@ -5,15 +5,15 @@ XMenuDef::XMenuDef()
|
|||||||
: XAsset()
|
: XAsset()
|
||||||
, mWindow()
|
, mWindow()
|
||||||
, mFont()
|
, mFont()
|
||||||
, mFullScreen()
|
, mFullScreen(0)
|
||||||
, mItemCount()
|
, mItemCount(0)
|
||||||
, mFontIndex()
|
, mFontIndex(0)
|
||||||
, mCursorItem()
|
, mCursorItem(4)
|
||||||
, mFadeCycle()
|
, mFadeCycle(0)
|
||||||
, mFadeClamp()
|
, mFadeClamp(0.0f)
|
||||||
, mFadeAmount()
|
, mFadeAmount(0.0f)
|
||||||
, mFadeInAmount()
|
, mFadeInAmount(0.0f)
|
||||||
, mBlurRadius()
|
, mBlurRadius(0.0f)
|
||||||
, mOnOpen()
|
, mOnOpen()
|
||||||
, mOnClose()
|
, mOnClose()
|
||||||
, mOnESC()
|
, mOnESC()
|
||||||
@ -21,7 +21,7 @@ XMenuDef::XMenuDef()
|
|||||||
, mVisibleExp()
|
, mVisibleExp()
|
||||||
, mAllowedBinding()
|
, mAllowedBinding()
|
||||||
, mSoundName()
|
, mSoundName()
|
||||||
, mImageTrack()
|
, mImageTrack(0)
|
||||||
, mFocusColor()
|
, mFocusColor()
|
||||||
, mDisableColor()
|
, mDisableColor()
|
||||||
, mRectXExp()
|
, mRectXExp()
|
||||||
@ -44,5 +44,76 @@ void XMenuDef::Clear()
|
|||||||
|
|
||||||
void XMenuDef::ParseData(QDataStream *aStream)
|
void XMenuDef::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mWindow.ParseData(aStream);
|
||||||
|
|
||||||
|
mFont.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mFullScreen
|
||||||
|
>> mItemCount
|
||||||
|
>> mFontIndex;
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
*aStream >> mCursorItem[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mFadeCycle
|
||||||
|
>> mFadeClamp
|
||||||
|
>> mFadeAmount
|
||||||
|
>> mFadeInAmount
|
||||||
|
>> mBlurRadius;
|
||||||
|
|
||||||
|
mOnOpen.ParsePtr(aStream, false);
|
||||||
|
mOnClose.ParsePtr(aStream, false);
|
||||||
|
mOnESC.ParsePtr(aStream, false);
|
||||||
|
mOnKey.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
mVisibleExp.ParseData(aStream);
|
||||||
|
|
||||||
|
mAllowedBinding.ParsePtr(aStream, false);
|
||||||
|
mSoundName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream >> mImageTrack;
|
||||||
|
|
||||||
|
float focusR, focusG, focusB, focusA,
|
||||||
|
disableR, disableG, disableB, disableA;
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> focusR
|
||||||
|
>> focusG
|
||||||
|
>> focusB
|
||||||
|
>> focusA
|
||||||
|
>> disableR
|
||||||
|
>> disableG
|
||||||
|
>> disableB
|
||||||
|
>> disableA;
|
||||||
|
|
||||||
|
mRectXExp.ParseData(aStream);
|
||||||
|
mRectYExp.ParseData(aStream);
|
||||||
|
|
||||||
|
qint32 itemsPtr;
|
||||||
|
*aStream >> itemsPtr;
|
||||||
|
|
||||||
|
mFont.ParseData(aStream);
|
||||||
|
mOnOpen.ParseData(aStream);
|
||||||
|
mOnClose.ParseData(aStream);
|
||||||
|
mOnESC.ParseData(aStream);
|
||||||
|
mOnKey.ParseData(aStream);
|
||||||
|
mVisibleExp.ParseData(aStream);
|
||||||
|
mAllowedBinding.ParseData(aStream);
|
||||||
|
mSoundName.ParseData(aStream);
|
||||||
|
mRectXExp.ParseData(aStream);
|
||||||
|
mRectYExp.ParseData(aStream);
|
||||||
|
|
||||||
|
if (itemsPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mItemCount; i++)
|
||||||
|
{
|
||||||
|
XItemDef newItemDef;
|
||||||
|
newItemDef.ParsePtr(aStream);
|
||||||
|
mItems.append(newItemDef);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class XItemDef;
|
|||||||
class XMenuDef : public XAsset
|
class XMenuDef : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XMenuDef();
|
explicit XMenuDef();
|
||||||
~XMenuDef();
|
~XMenuDef();
|
||||||
|
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
@ -21,29 +21,29 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
XWindowDef mWindow;
|
XWindowDef mWindow;
|
||||||
XString* mFont;
|
XString mFont;
|
||||||
int mFullScreen;
|
qint32 mFullScreen;
|
||||||
int mItemCount;
|
qint32 mItemCount;
|
||||||
int mFontIndex;
|
qint32 mFontIndex;
|
||||||
int mCursorItem[4];
|
QVector<qint32> mCursorItem;
|
||||||
int mFadeCycle;
|
qint32 mFadeCycle;
|
||||||
float mFadeClamp;
|
float mFadeClamp;
|
||||||
float mFadeAmount;
|
float mFadeAmount;
|
||||||
float mFadeInAmount;
|
float mFadeInAmount;
|
||||||
float mBlurRadius;
|
float mBlurRadius;
|
||||||
XString* mOnOpen;
|
XString mOnOpen;
|
||||||
XString* mOnClose;
|
XString mOnClose;
|
||||||
XString* mOnESC;
|
XString mOnESC;
|
||||||
XItemKeyHandler *mOnKey;
|
XItemKeyHandler mOnKey;
|
||||||
XStatement mVisibleExp;
|
XStatement mVisibleExp;
|
||||||
XString* mAllowedBinding;
|
XString mAllowedBinding;
|
||||||
XString* mSoundName;
|
XString mSoundName;
|
||||||
int mImageTrack;
|
qint32 mImageTrack;
|
||||||
QColor mFocusColor;
|
QColor mFocusColor;
|
||||||
QColor mDisableColor;
|
QColor mDisableColor;
|
||||||
XStatement mRectXExp;
|
XStatement mRectXExp;
|
||||||
XStatement mRectYExp;
|
XStatement mRectYExp;
|
||||||
QVector<XItemDef*> mItems;
|
QVector<XItemDef> mItems;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XMENUDEF_H
|
#endif // XMENUDEF_H
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
XModel::XModel()
|
XModel::XModel()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mName("")
|
, mName()
|
||||||
, mNumBones(0)
|
, mNumBones(0)
|
||||||
, mNumRootBones(0)
|
, mNumRootBones(0)
|
||||||
, mNumSurfs(0)
|
, mNumSurfs(0)
|
||||||
@ -12,15 +12,15 @@ XModel::XModel()
|
|||||||
, mParentList()
|
, mParentList()
|
||||||
, mQuats()
|
, mQuats()
|
||||||
, mTrans(0)
|
, mTrans(0)
|
||||||
, mPartClassification(0)
|
, mPartClassification()
|
||||||
, mBaseMat(0)
|
, mBaseMat()
|
||||||
, mSurfs()
|
, mSurfs()
|
||||||
, mMaterialHandles()
|
, mMaterialHandles()
|
||||||
, mLodInfo()
|
, mLodInfo()
|
||||||
, mCollSurfs()
|
, mCollSurfs()
|
||||||
, mNumCollSurfs(0)
|
, mNumCollSurfs(0)
|
||||||
, mContents(0)
|
, mContents(0)
|
||||||
, mBoneInfo(new XBoneInfo())
|
, mBoneInfo()
|
||||||
, mRadius(0)
|
, mRadius(0)
|
||||||
, mMins()
|
, mMins()
|
||||||
, mMaxs()
|
, mMaxs()
|
||||||
@ -29,8 +29,8 @@ XModel::XModel()
|
|||||||
, mStreamInfo()
|
, mStreamInfo()
|
||||||
, mMemUsage(0)
|
, mMemUsage(0)
|
||||||
, mFlags(0)
|
, mFlags(0)
|
||||||
, mPhysPreset(new XPhysPreset)
|
, mPhysPreset()
|
||||||
, mPhysGeoms(new XPhysGeomList)
|
, mPhysGeoms()
|
||||||
{
|
{
|
||||||
SetType(ASSET_TYPE_XMODEL);
|
SetType(ASSET_TYPE_XMODEL);
|
||||||
}
|
}
|
||||||
@ -41,13 +41,142 @@ XModel::~XModel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void XModel::ParseData(QDataStream *aStream) {
|
void XModel::ParseData(QDataStream *aStream) {
|
||||||
qint32 namePtr, boneNamesPtr;
|
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
*aStream
|
*aStream
|
||||||
>> namePtr;
|
>> mNumBones
|
||||||
|
>> mNumRootBones
|
||||||
|
>> mNumSurfs
|
||||||
|
>> mLodRampType;
|
||||||
|
|
||||||
mName = XString::ParseCustom(aStream);
|
qint32 boneNamesPtr, parentListPtr, quatsPtr, transPtr, partClassPtr;
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> boneNamesPtr
|
||||||
|
>> parentListPtr
|
||||||
|
>> quatsPtr
|
||||||
|
>> transPtr
|
||||||
|
>> partClassPtr;
|
||||||
|
|
||||||
|
mBaseMat.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
qint32 surfsPtr, matHandlesPtr, lodInfoPtr, collSurfsPtr;
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> surfsPtr
|
||||||
|
>> matHandlesPtr
|
||||||
|
>> lodInfoPtr
|
||||||
|
>> collSurfsPtr
|
||||||
|
>> mNumCollSurfs
|
||||||
|
>> mContents;
|
||||||
|
|
||||||
|
mBoneInfo.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mRadius
|
||||||
|
>> mMins
|
||||||
|
>> mMaxs
|
||||||
|
>> mNumLods
|
||||||
|
>> mCollLod;
|
||||||
|
|
||||||
|
mStreamInfo.ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mMemUsage
|
||||||
|
>> mFlags;
|
||||||
|
aStream->skipRawData(3);
|
||||||
|
|
||||||
|
mPhysPreset.ParsePtr(aStream, false);
|
||||||
|
mPhysGeoms.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
mName.ParseData(aStream);
|
||||||
|
|
||||||
|
if (boneNamesPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mNumBones; i++)
|
||||||
|
{
|
||||||
|
quint16 bone;
|
||||||
|
*aStream >> bone;
|
||||||
|
mBoneNames.append(bone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parentListPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mNumBones - mNumRootBones; i++)
|
||||||
|
{
|
||||||
|
quint8 parent;
|
||||||
|
*aStream >> parent;
|
||||||
|
mParentList.append(parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quatsPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 8 * (mNumBones - mNumRootBones); i++)
|
||||||
|
{
|
||||||
|
quint8 quat;
|
||||||
|
*aStream >> quat;
|
||||||
|
mQuats.append(quat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 16 * (mNumBones - mNumRootBones); i++)
|
||||||
|
{
|
||||||
|
quint8 trans;
|
||||||
|
*aStream >> trans;
|
||||||
|
mTrans.append(trans);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (partClassPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mNumBones; i++)
|
||||||
|
{
|
||||||
|
quint8 partClass;
|
||||||
|
*aStream >> partClass;
|
||||||
|
mPartClassification.append(partClass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mBaseMat.ParseData(aStream);
|
||||||
|
|
||||||
|
if (surfsPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mNumSurfs; i++)
|
||||||
|
{
|
||||||
|
XSurface newSurf;
|
||||||
|
newSurf.ParseData(aStream);
|
||||||
|
mSurfs.append(newSurf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (matHandlesPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mNumSurfs; i++)
|
||||||
|
{
|
||||||
|
XMaterial newMaterial;
|
||||||
|
newMaterial.ParseData(aStream);
|
||||||
|
mMaterialHandles.append(newMaterial);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (collSurfsPtr == -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mNumCollSurfs; i++)
|
||||||
|
{
|
||||||
|
XModelCollSurf newCollSurf;
|
||||||
|
newCollSurf.ParseData(aStream);
|
||||||
|
mCollSurfs.append(newCollSurf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mBoneInfo.ParseData(aStream);
|
||||||
|
|
||||||
|
// TODO: Fill out rest of this
|
||||||
}
|
}
|
||||||
|
|
||||||
void XModel::Clear()
|
void XModel::Clear()
|
||||||
|
|||||||
@ -23,24 +23,24 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
XString mName;
|
||||||
quint8 mNumBones;
|
quint8 mNumBones;
|
||||||
quint8 mNumRootBones;
|
quint8 mNumRootBones;
|
||||||
quint8 mNumSurfs;
|
quint8 mNumSurfs;
|
||||||
quint8 mLodRampType;
|
quint8 mLodRampType;
|
||||||
XScriptStringList mBoneNames;
|
QVector<quint16> mBoneNames;
|
||||||
QVector<quint8> mParentList;
|
QVector<quint8> mParentList;
|
||||||
QVector<quint8> mQuats;
|
QVector<quint8> mQuats;
|
||||||
float *mTrans;
|
QVector<float> mTrans;
|
||||||
quint8 *mPartClassification;
|
QVector<quint8> mPartClassification;
|
||||||
XDObjAnimMat *mBaseMat;
|
XDObjAnimMat mBaseMat;
|
||||||
QVector<XSurface> mSurfs;
|
QVector<XSurface> mSurfs;
|
||||||
QVector<XMaterial*> mMaterialHandles;
|
QVector<XMaterial> mMaterialHandles;
|
||||||
QVector<XModelLodInfo> mLodInfo;
|
QVector<XModelLodInfo> mLodInfo;
|
||||||
QVector<XModelCollSurf> mCollSurfs;
|
QVector<XModelCollSurf> mCollSurfs;
|
||||||
int mNumCollSurfs;
|
int mNumCollSurfs;
|
||||||
int mContents;
|
int mContents;
|
||||||
XBoneInfo* mBoneInfo;
|
XBoneInfo mBoneInfo;
|
||||||
float mRadius;
|
float mRadius;
|
||||||
QVector3D mMins;
|
QVector3D mMins;
|
||||||
QVector3D mMaxs;
|
QVector3D mMaxs;
|
||||||
@ -49,8 +49,8 @@ private:
|
|||||||
XModelStreamInfo mStreamInfo;
|
XModelStreamInfo mStreamInfo;
|
||||||
int mMemUsage;
|
int mMemUsage;
|
||||||
quint8 mFlags;
|
quint8 mFlags;
|
||||||
XPhysPreset* mPhysPreset;
|
XPhysPreset mPhysPreset;
|
||||||
XPhysGeomList* mPhysGeoms;
|
XPhysGeomList mPhysGeoms;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XMODEL_H
|
#endif // XMODEL_H
|
||||||
|
|||||||
@ -18,7 +18,16 @@ XModelCollSurf::~XModelCollSurf()
|
|||||||
|
|
||||||
void XModelCollSurf::ParseData(QDataStream *aStream)
|
void XModelCollSurf::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream
|
||||||
|
>> mMins[0]
|
||||||
|
>> mMins[1]
|
||||||
|
>> mMins[2]
|
||||||
|
>> mMaxs[0]
|
||||||
|
>> mMaxs[1]
|
||||||
|
>> mMaxs[2]
|
||||||
|
>> mBoneIdx
|
||||||
|
>> mContents
|
||||||
|
>> mSurfFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XModelCollSurf::Clear()
|
void XModelCollSurf::Clear()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
XModelPiece::XModelPiece()
|
XModelPiece::XModelPiece()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mModel(new XModel())
|
, mModel()
|
||||||
, mOffset()
|
, mOffset()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -10,16 +10,23 @@ XModelPiece::XModelPiece()
|
|||||||
|
|
||||||
XModelPiece::~XModelPiece()
|
XModelPiece::~XModelPiece()
|
||||||
{
|
{
|
||||||
delete mModel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XModelPiece::ParseData(QDataStream *aStream)
|
void XModelPiece::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mModel.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mOffset[0]
|
||||||
|
>> mOffset[1]
|
||||||
|
>> mOffset[2];
|
||||||
|
|
||||||
|
mModel.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XModelPiece::Clear()
|
void XModelPiece::Clear()
|
||||||
{
|
{
|
||||||
mModel->Clear();
|
mModel.Clear();
|
||||||
mOffset = QVector3D();
|
mOffset = QVector3D();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XModel *mModel;
|
XModel mModel;
|
||||||
QVector3D mOffset;
|
QVector3D mOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
XModelPieces::XModelPieces()
|
XModelPieces::XModelPieces()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mName("")
|
, mName()
|
||||||
, mNumPieces(0)
|
, mNumPieces(0)
|
||||||
, mPieces()
|
, mPieces()
|
||||||
{
|
{
|
||||||
@ -17,12 +17,32 @@ XModelPieces::~XModelPieces()
|
|||||||
|
|
||||||
void XModelPieces::ParseData(QDataStream *aStream)
|
void XModelPieces::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
qint32 piecesPtr;
|
||||||
|
*aStream
|
||||||
|
>> mNumPieces
|
||||||
|
>> piecesPtr;
|
||||||
|
|
||||||
|
mName.ParseData(aStream);
|
||||||
|
|
||||||
|
if (piecesPtr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mNumPieces; i++)
|
||||||
|
{
|
||||||
|
XModelPiece newPiece;
|
||||||
|
newPiece.ParseData(aStream);
|
||||||
|
mPieces.append(newPiece);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XModelPieces::Clear()
|
void XModelPieces::Clear()
|
||||||
{
|
{
|
||||||
mName.clear();
|
mName.Clear();
|
||||||
mNumPieces = 0;
|
mNumPieces = 0;
|
||||||
mPieces.clear();
|
mPieces.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
XString mName;
|
||||||
int mNumPieces;
|
int mNumPieces;
|
||||||
QVector<XModelPiece> mPieces;
|
QVector<XModelPiece> mPieces;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -9,7 +9,7 @@ XPackedTexCoords::XPackedTexCoords()
|
|||||||
|
|
||||||
void XPackedTexCoords::ParseData(QDataStream *aStream)
|
void XPackedTexCoords::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream >> mPacked;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XPackedTexCoords::Clear()
|
void XPackedTexCoords::Clear()
|
||||||
|
|||||||
@ -9,7 +9,7 @@ XPackedUnitVec::XPackedUnitVec()
|
|||||||
|
|
||||||
void XPackedUnitVec::ParseData(QDataStream *aStream)
|
void XPackedUnitVec::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream >> mPacked;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XPackedUnitVec::Clear()
|
void XPackedUnitVec::Clear()
|
||||||
|
|||||||
@ -2,16 +2,14 @@
|
|||||||
|
|
||||||
XPhysPreset::XPhysPreset()
|
XPhysPreset::XPhysPreset()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mNamePtr(0)
|
, mName()
|
||||||
, mName("")
|
|
||||||
, mType(0)
|
, mType(0)
|
||||||
, mMass(0)
|
, mMass(0)
|
||||||
, mBounce(0)
|
, mBounce(0)
|
||||||
, mFriction(0)
|
, mFriction(0)
|
||||||
, mBulletForceScale(0)
|
, mBulletForceScale(0)
|
||||||
, mExplosiveForceScale(0)
|
, mExplosiveForceScale(0)
|
||||||
, mSndAliasPrefixPtr(0)
|
, mSndAliasPrefix()
|
||||||
, mSndAliasPrefix("")
|
|
||||||
, mPiecesSpreadFraction(0)
|
, mPiecesSpreadFraction(0)
|
||||||
, mPiecesUpwardVelocity(0)
|
, mPiecesUpwardVelocity(0)
|
||||||
, mTempDefaultToCylinder(false)
|
, mTempDefaultToCylinder(false)
|
||||||
@ -27,21 +25,40 @@ XPhysPreset::~XPhysPreset()
|
|||||||
|
|
||||||
void XPhysPreset::ParseData(QDataStream *aStream)
|
void XPhysPreset::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mType
|
||||||
|
>> mMass
|
||||||
|
>> mBounce
|
||||||
|
>> mFriction
|
||||||
|
>> mBulletForceScale
|
||||||
|
>> mExplosiveForceScale;
|
||||||
|
|
||||||
|
mSndAliasPrefix.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mPiecesSpreadFraction
|
||||||
|
>> mPiecesUpwardVelocity
|
||||||
|
>> mTempDefaultToCylinder;
|
||||||
|
|
||||||
|
mName.ParseData(aStream);
|
||||||
|
mSndAliasPrefix.ParseData(aStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XPhysPreset::Clear()
|
void XPhysPreset::Clear()
|
||||||
{
|
{
|
||||||
mNamePtr = 0;
|
mName.Clear();
|
||||||
mName.clear();
|
|
||||||
mType = 0;
|
mType = 0;
|
||||||
mMass = 0;
|
mMass = 0;
|
||||||
mBounce = 0;
|
mBounce = 0;
|
||||||
mFriction = 0;
|
mFriction = 0;
|
||||||
mBulletForceScale = 0;
|
mBulletForceScale = 0;
|
||||||
mExplosiveForceScale = 0;
|
mExplosiveForceScale = 0;
|
||||||
mSndAliasPrefixPtr = 0;
|
mSndAliasPrefix.Clear();
|
||||||
mSndAliasPrefix.clear();
|
|
||||||
mPiecesSpreadFraction = 0;
|
mPiecesSpreadFraction = 0;
|
||||||
mPiecesUpwardVelocity = 0;
|
mPiecesUpwardVelocity = 0;
|
||||||
mTempDefaultToCylinder = false;
|
mTempDefaultToCylinder = false;
|
||||||
|
|||||||
@ -2,36 +2,28 @@
|
|||||||
#define XPHYSPRESET_H
|
#define XPHYSPRESET_H
|
||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
|
#include "xstring.h"
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
class XPhysPreset : public XAsset
|
class XPhysPreset : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XPhysPreset();
|
explicit XPhysPreset();
|
||||||
~XPhysPreset();
|
~XPhysPreset();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
qint32 mNamePtr;
|
XString mName;
|
||||||
QString mName;
|
|
||||||
|
|
||||||
int mType;
|
int mType;
|
||||||
|
|
||||||
float mMass;
|
float mMass;
|
||||||
float mBounce;
|
float mBounce;
|
||||||
float mFriction;
|
float mFriction;
|
||||||
float mBulletForceScale;
|
float mBulletForceScale;
|
||||||
float mExplosiveForceScale;
|
float mExplosiveForceScale;
|
||||||
|
XString mSndAliasPrefix;
|
||||||
qint32 mSndAliasPrefixPtr;
|
|
||||||
QString mSndAliasPrefix;
|
|
||||||
|
|
||||||
float mPiecesSpreadFraction;
|
float mPiecesSpreadFraction;
|
||||||
float mPiecesUpwardVelocity;
|
float mPiecesUpwardVelocity;
|
||||||
|
|
||||||
bool mTempDefaultToCylinder;
|
bool mTempDefaultToCylinder;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
XString::XString()
|
XString::XString()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mString("")
|
, mString("")
|
||||||
|
, mRemoveString("")
|
||||||
|
, mContentLength(-1)
|
||||||
{
|
{
|
||||||
SetName("String");
|
SetName("String");
|
||||||
}
|
}
|
||||||
@ -13,6 +15,8 @@ XString::XString()
|
|||||||
XString::XString(const QString aString)
|
XString::XString(const QString aString)
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mString(aString)
|
, mString(aString)
|
||||||
|
, mRemoveString("")
|
||||||
|
, mContentLength(-1)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -27,6 +31,16 @@ QString XString::GetString() const
|
|||||||
return mString;
|
return mString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XString::SetRemoveString(const QString aRemoveString)
|
||||||
|
{
|
||||||
|
mRemoveString = aRemoveString;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XString::SetContentLength(int aContentLength)
|
||||||
|
{
|
||||||
|
mContentLength = aContentLength;
|
||||||
|
}
|
||||||
|
|
||||||
void XString::SetString(const QString& aString)
|
void XString::SetString(const QString& aString)
|
||||||
{
|
{
|
||||||
mString = aString;
|
mString = aString;
|
||||||
@ -68,23 +82,28 @@ void XString::Clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void XString::ParseData(QDataStream *aStream)
|
void XString::ParseData(QDataStream *aStream)
|
||||||
{
|
|
||||||
ParseData(aStream, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
void XString::ParseData(QDataStream *aStream, QString aRemoveStr)
|
|
||||||
{
|
{
|
||||||
if (GetPtr() == -1)
|
if (GetPtr() == -1)
|
||||||
{
|
{
|
||||||
mString = ParseCustom(aStream);
|
if (mContentLength == -1)
|
||||||
if (!aRemoveStr.isEmpty())
|
|
||||||
{
|
{
|
||||||
mString = mString.replace(aRemoveStr, "");
|
mString = ParseCustom(aStream);
|
||||||
}
|
}
|
||||||
|
else if (mContentLength != 0)
|
||||||
|
{
|
||||||
|
QByteArray rawString(mContentLength, Qt::Uninitialized);
|
||||||
|
aStream->readRawData(rawString.data(), mContentLength);
|
||||||
|
mString = QString::fromUtf8(rawString);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mRemoveString.isEmpty())
|
||||||
|
{
|
||||||
|
mString = mString.replace(mRemoveString, "");
|
||||||
|
}
|
||||||
|
|
||||||
if (IsDebug())
|
if (IsDebug())
|
||||||
{
|
{
|
||||||
qDebug() << QString("[%1] mString = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mString);
|
qDebug() << QString("[%1] mString = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,15 +17,19 @@ public:
|
|||||||
void SetString(const QString& aString);
|
void SetString(const QString& aString);
|
||||||
QString GetString() const;
|
QString GetString() const;
|
||||||
|
|
||||||
|
void SetRemoveString(const QString aRemoveString);
|
||||||
|
void SetContentLength(int aContentLength);
|
||||||
|
|
||||||
static QString ParseCustom(QDataStream* aStream);
|
static QString ParseCustom(QDataStream* aStream);
|
||||||
static XStringArray* ParseArray(QDataStream* aStream, int aCount);
|
static XStringArray* ParseArray(QDataStream* aStream, int aCount);
|
||||||
|
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
virtual void ParseData(QDataStream* aStream, QString aRemoveStr);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mString;
|
QString mString;
|
||||||
|
QString mRemoveString;
|
||||||
|
int mContentLength;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XSTRING_H
|
#endif // XSTRING_H
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
#include "xsunflare.h"
|
#include "xsunflare.h"
|
||||||
|
|
||||||
XSunflare::XSunflare()
|
XSunFlare::XSunFlare()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mHasValidData(false)
|
, mHasValidData(false)
|
||||||
, mSpriteMaterial(new XMaterial())
|
, mSpriteMaterial()
|
||||||
, mFlareMaterial(new XMaterial())
|
, mFlareMaterial()
|
||||||
, mSpriteSize(0.0f)
|
, mSpriteSize(0.0f)
|
||||||
, mFlareMinSize(0.0f)
|
, mFlareMinSize(0.0f)
|
||||||
, mFlareMinDot(0.0f)
|
, mFlareMinDot(0.0f)
|
||||||
@ -28,17 +28,70 @@ XSunflare::XSunflare()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XSunflare::~XSunflare()
|
XSunFlare::~XSunFlare()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XSunflare::ParseData(QDataStream *aStream)
|
void XSunFlare::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream
|
||||||
|
>> mHasValidData;
|
||||||
|
|
||||||
|
aStream->skipRawData(3);
|
||||||
|
|
||||||
|
mSpriteMaterial.ParsePtr(aStream, false);
|
||||||
|
mFlareMaterial.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mSpriteSize
|
||||||
|
>> mFlareMinSize
|
||||||
|
>> mFlareMinDot
|
||||||
|
>> mFlareMaxSize
|
||||||
|
>> mFlareMaxDot
|
||||||
|
>> mFlareMaxAlpha
|
||||||
|
>> mFlareFadeInTime
|
||||||
|
>> mFlareFadeOutTime
|
||||||
|
>> mBlindMinDot
|
||||||
|
>> mBlindMaxDot
|
||||||
|
>> mBlindMaxDarken
|
||||||
|
>> mBlindFadeInTime
|
||||||
|
>> mBlindFadeOutTime
|
||||||
|
>> mGlareMinDot
|
||||||
|
>> mGlareMaxDot
|
||||||
|
>> mGlareMaxLighten
|
||||||
|
>> mGlareFadeInTime
|
||||||
|
>> mGlareFadeOutTime
|
||||||
|
>> mSunFxPosition[0]
|
||||||
|
>> mSunFxPosition[1]
|
||||||
|
>> mSunFxPosition[2];
|
||||||
|
|
||||||
|
mSpriteMaterial.ParseData(aStream);
|
||||||
|
mFlareMaterial.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XSunflare::Clear()
|
void XSunFlare::Clear()
|
||||||
{
|
{
|
||||||
|
mHasValidData = false;
|
||||||
|
mSpriteMaterial.Clear();
|
||||||
|
mFlareMaterial.Clear();
|
||||||
|
mSpriteSize = 0.0f;
|
||||||
|
mFlareMinSize = 0.0f;
|
||||||
|
mFlareMinDot = 0.0f;
|
||||||
|
mFlareMaxSize = 0.0f;
|
||||||
|
mFlareMaxDot = 0.0f;
|
||||||
|
mFlareMaxAlpha = 0.0f;
|
||||||
|
mFlareFadeInTime = 0;
|
||||||
|
mFlareFadeOutTime = 0;
|
||||||
|
mBlindMinDot = 0.0f;
|
||||||
|
mBlindMaxDot = 0.0f;
|
||||||
|
mBlindMaxDarken = 0.0f;
|
||||||
|
mBlindFadeInTime = 0;
|
||||||
|
mBlindFadeOutTime = 0;
|
||||||
|
mGlareMinDot = 0.0f;
|
||||||
|
mGlareMaxDot = 0.0f;
|
||||||
|
mGlareMaxLighten = 0.0f;
|
||||||
|
mGlareFadeInTime = 0;
|
||||||
|
mGlareFadeOutTime = 0;
|
||||||
|
mSunFxPosition = QVector3D();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,19 +6,19 @@
|
|||||||
|
|
||||||
#include <QVector3D>
|
#include <QVector3D>
|
||||||
|
|
||||||
class XSunflare : public XAsset
|
class XSunFlare : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XSunflare();
|
explicit XSunFlare();
|
||||||
~XSunflare();
|
~XSunFlare();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool mHasValidData;
|
bool mHasValidData;
|
||||||
XMaterial *mSpriteMaterial;
|
XMaterial mSpriteMaterial;
|
||||||
XMaterial *mFlareMaterial;
|
XMaterial mFlareMaterial;
|
||||||
float mSpriteSize;
|
float mSpriteSize;
|
||||||
float mFlareMinSize;
|
float mFlareMinSize;
|
||||||
float mFlareMinDot;
|
float mFlareMinDot;
|
||||||
|
|||||||
@ -8,8 +8,8 @@ XSurface::XSurface()
|
|||||||
, mTriCount(0)
|
, mTriCount(0)
|
||||||
, mTriIndices(0)
|
, mTriIndices(0)
|
||||||
, mVertInfo()
|
, mVertInfo()
|
||||||
, mVerts0(new XGfxPackedVertex())
|
, mVert()
|
||||||
, mVb0()
|
, mVertBuffer()
|
||||||
, mVertListCount(0)
|
, mVertListCount(0)
|
||||||
, mVertList()
|
, mVertList()
|
||||||
, mIndexBuffer()
|
, mIndexBuffer()
|
||||||
@ -18,11 +18,48 @@ XSurface::XSurface()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XSurface::ParseData(QDataStream *aStream)
|
XSurface::~XSurface()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XSurface::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mTileMode
|
||||||
|
>> mDeformed
|
||||||
|
>> mVertCount
|
||||||
|
>> mTriCount;
|
||||||
|
|
||||||
|
aStream->skipRawData(2);
|
||||||
|
|
||||||
|
qint32 triIndicesPtr;
|
||||||
|
*aStream
|
||||||
|
>> triIndicesPtr;
|
||||||
|
|
||||||
|
mVertInfo.ParsePtr(aStream, false);
|
||||||
|
mVert.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
qint32 vertBuffersPtr, vertListPtr;
|
||||||
|
*aStream
|
||||||
|
>> vertBuffersPtr
|
||||||
|
>> mVertListCount
|
||||||
|
>> vertListPtr;
|
||||||
|
|
||||||
|
mIndexBuffer.ParseData(aStream);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mPartBits[0]
|
||||||
|
>> mPartBits[1]
|
||||||
|
>> mPartBits[2]
|
||||||
|
>> mPartBits[3];
|
||||||
|
|
||||||
|
mVertInfo.ParseData(aStream);
|
||||||
|
mVert.ParseData(aStream);
|
||||||
|
|
||||||
|
// TODO: Fill out the rest of this
|
||||||
|
}
|
||||||
|
|
||||||
void XSurface::Clear()
|
void XSurface::Clear()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ class XSurface : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XSurface();
|
explicit XSurface();
|
||||||
|
~XSurface();
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
@ -21,14 +22,14 @@ private:
|
|||||||
bool mDeformed;
|
bool mDeformed;
|
||||||
quint32 mVertCount;
|
quint32 mVertCount;
|
||||||
quint32 mTriCount;
|
quint32 mTriCount;
|
||||||
quint32 *mTriIndices;
|
QVector<quint32> mTriIndices;
|
||||||
XSurfaceVertexInfo mVertInfo;
|
XSurfaceVertexInfo mVertInfo;
|
||||||
XGfxPackedVertex *mVerts0;
|
XGfxPackedVertex mVert;
|
||||||
XD3DVertexBuffer mVb0;
|
XD3DVertexBuffer mVertBuffer;
|
||||||
quint32 mVertListCount;
|
quint32 mVertListCount;
|
||||||
QVector<XRigidVertList> mVertList;
|
QVector<XRigidVertList> mVertList;
|
||||||
XD3DIndexBuffer mIndexBuffer;
|
XD3DIndexBuffer mIndexBuffer;
|
||||||
int mPartBits[4];
|
QVector<int> mPartBits;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XSURFACE_H
|
#endif // XSURFACE_H
|
||||||
|
|||||||
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
XSurfaceVertexInfo::XSurfaceVertexInfo()
|
XSurfaceVertexInfo::XSurfaceVertexInfo()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mVertCount()
|
, mVertCount(4)
|
||||||
, mVertsBlendPtr()
|
|
||||||
, mVertsBlend()
|
, mVertsBlend()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -11,7 +10,21 @@ XSurfaceVertexInfo::XSurfaceVertexInfo()
|
|||||||
|
|
||||||
void XSurfaceVertexInfo::ParseData(QDataStream *aStream)
|
void XSurfaceVertexInfo::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
qint32 vertBlendPtr;
|
||||||
|
*aStream
|
||||||
|
>> mVertCount[0]
|
||||||
|
>> mVertCount[1]
|
||||||
|
>> mVertCount[2]
|
||||||
|
>> mVertCount[3]
|
||||||
|
>> vertBlendPtr;
|
||||||
|
|
||||||
|
if (vertBlendPtr == -1)
|
||||||
|
{
|
||||||
|
aStream->readRawData(mVertsBlend.data(), 2 * (mVertCount[0] + 3 * mVertCount[1] + 5 * mVertCount[2] + 7 * mVertCount[3]));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XSurfaceVertexInfo::Clear()
|
void XSurfaceVertexInfo::Clear()
|
||||||
|
|||||||
@ -12,9 +12,8 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
qint16 mVertCount[4];
|
QVector<qint16> mVertCount;
|
||||||
qint32 mVertsBlendPtr;
|
QByteArray mVertsBlend;
|
||||||
quint32 mVertsBlend;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XSURFACEVERTEXINFO_H
|
#endif // XSURFACEVERTEXINFO_H
|
||||||
|
|||||||
@ -3,19 +3,19 @@
|
|||||||
XWater::XWater()
|
XWater::XWater()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mWritable()
|
, mWritable()
|
||||||
, mH0X(0)
|
, mH0X()
|
||||||
, mH0Y(0)
|
, mH0Y()
|
||||||
, mWTerm(0)
|
, mWTerm()
|
||||||
, mM(0)
|
, mM(0)
|
||||||
, mN(0)
|
, mN(0)
|
||||||
, mLx(0)
|
, mLx(0)
|
||||||
, mLz(0)
|
, mLz(0)
|
||||||
, mGravity(0)
|
, mGravity(0)
|
||||||
, mWindvel(0)
|
, mWindVel(0)
|
||||||
, mWinddir({ 0, 0 })
|
, mWindDir(1)
|
||||||
, mAmplitude(0)
|
, mAmplitude(0)
|
||||||
, mCodeConstant({ 0, 0, 0, 0 })
|
, mCodeConstant(4)
|
||||||
, mImage(new XGfxImage())
|
, mImage()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -27,12 +27,48 @@ XWater::~XWater()
|
|||||||
|
|
||||||
void XWater::ParseData(QDataStream *aStream)
|
void XWater::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mWritable.ParseData(aStream);
|
||||||
|
|
||||||
|
qint32 h0xPtr, h0yPtr, wTermPtr;
|
||||||
|
*aStream
|
||||||
|
>> h0xPtr
|
||||||
|
>> h0yPtr
|
||||||
|
>> wTermPtr
|
||||||
|
>> mM
|
||||||
|
>> mN
|
||||||
|
>> mLx
|
||||||
|
>> mLz
|
||||||
|
>> mGravity
|
||||||
|
>> mWindVel
|
||||||
|
>> mWindDir[0]
|
||||||
|
>> mWindDir[1]
|
||||||
|
>> mAmplitude
|
||||||
|
>> mWindDir[0]
|
||||||
|
>> mWindDir[1]
|
||||||
|
>> mWindDir[2]
|
||||||
|
>> mWindDir[3];
|
||||||
|
|
||||||
|
mImage.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
if (h0xPtr)
|
||||||
|
{
|
||||||
|
aStream->readRawData(mH0X.data(), 4 * mM * mN);
|
||||||
|
}
|
||||||
|
if (h0yPtr)
|
||||||
|
{
|
||||||
|
aStream->readRawData(mH0X.data(), 4 * mM * mN);
|
||||||
|
}
|
||||||
|
if (wTermPtr)
|
||||||
|
{
|
||||||
|
aStream->readRawData(mWTerm.data(), 4 * mM * mN);
|
||||||
|
}
|
||||||
|
|
||||||
|
mImage.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XWater::Clear()
|
void XWater::Clear()
|
||||||
{
|
{
|
||||||
mWritable = XWaterWritable();
|
mWritable.Clear();
|
||||||
mH0X = 0;
|
mH0X = 0;
|
||||||
mH0Y = 0;
|
mH0Y = 0;
|
||||||
mWTerm = 0;
|
mWTerm = 0;
|
||||||
@ -41,9 +77,9 @@ void XWater::Clear()
|
|||||||
mLx = 0;
|
mLx = 0;
|
||||||
mLz = 0;
|
mLz = 0;
|
||||||
mGravity = 0;
|
mGravity = 0;
|
||||||
mWindvel = 0;
|
mWindVel = 0;
|
||||||
mWinddir = { 0, 0 };
|
mWindDir.clear();
|
||||||
mAmplitude = 0;
|
mAmplitude = 0;
|
||||||
mCodeConstant = { 0, 0, 0, 0 };
|
mCodeConstant.clear();
|
||||||
mImage = new XGfxImage();
|
mImage.Clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,19 +18,19 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
XWaterWritable mWritable;
|
XWaterWritable mWritable;
|
||||||
float *mH0X;
|
QByteArray mH0X;
|
||||||
float *mH0Y;
|
QByteArray mH0Y;
|
||||||
float *mWTerm;
|
QByteArray mWTerm;
|
||||||
int mM;
|
int mM;
|
||||||
int mN;
|
int mN;
|
||||||
float mLx;
|
float mLx;
|
||||||
float mLz;
|
float mLz;
|
||||||
float mGravity;
|
float mGravity;
|
||||||
float mWindvel;
|
float mWindVel;
|
||||||
QVector<float> mWinddir;
|
QVector<float> mWindDir;
|
||||||
float mAmplitude;
|
float mAmplitude;
|
||||||
QVector<float> mCodeConstant;
|
QVector<float> mCodeConstant;
|
||||||
XGfxImage *mImage;
|
XGfxImage mImage;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XWATER_H
|
#endif // XWATER_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user