Remove deprecated and unused asset-related files
This commit is contained in:
parent
0ea4a7ad6f
commit
f149b66322
@ -1,648 +0,0 @@
|
||||
#include "animparts.h"
|
||||
|
||||
#include <QIODevice>
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDynamicFrames &aAnimDynamicFramesIn)
|
||||
{
|
||||
aDataStream << aAnimDynamicFramesIn.framesPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDynamicFrames &aAnimDynamicFramesOut)
|
||||
{
|
||||
aDataStream >> aAnimDynamicFramesOut.framesPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDynamicFramesToString(const XAnimDynamicFrames &aAnimDynamicFrames) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDynamicFrames(");
|
||||
|
||||
debug.append(QString("\n framesPtr: %1").arg(aAnimDynamicFrames.framesPtr));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
debug.append(QString("\n frames %1: %2").arg(i).arg(aAnimDynamicFrames.frames[i]));
|
||||
}
|
||||
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDynamicIndices &aAnimDynamicIndicesIn)
|
||||
{
|
||||
aDataStream << aAnimDynamicIndicesIn.indices[0];
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDynamicIndices &aAnimDynamicIndicesOut)
|
||||
{
|
||||
aDataStream >> aAnimDynamicIndicesOut.indices[0];
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDynamicIndicesToString(const XAnimDynamicIndices &aAnimDynamicIndices) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDynamicIndices(");
|
||||
|
||||
debug.append(QString("\n indices: %1").arg(aAnimDynamicIndices.indices[0]));
|
||||
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTransFrames &aAnimPartTransFramesIn)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream << aAnimPartTransFramesIn.mins[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream << aAnimPartTransFramesIn.size[i];
|
||||
}
|
||||
|
||||
aDataStream
|
||||
<< aAnimPartTransFramesIn.frames
|
||||
<< aAnimPartTransFramesIn.indices;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTransFrames &aAnimPartTransFramesOut)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream >> aAnimPartTransFramesOut.mins[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream >> aAnimPartTransFramesOut.size[i];
|
||||
}
|
||||
|
||||
aDataStream
|
||||
>> aAnimPartTransFramesOut.frames
|
||||
>> aAnimPartTransFramesOut.indices;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimPartTransFramesToString(const XAnimPartTransFrames &aAnimPartTransFrames) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimPartTransFrames(");
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
debug.append(QString("\n mins %1: %2").arg(i).arg(aAnimPartTransFrames.mins[i]));
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
debug.append(QString("\n size %1: %2").arg(i).arg(aAnimPartTransFrames.size[i]));
|
||||
}
|
||||
debug.append(QString("\n frames: %1").arg(XAnimDynamicFramesToString(aAnimPartTransFrames.frames)));
|
||||
debug.append(QString("\n frames: %1").arg(XAnimDynamicIndicesToString(aAnimPartTransFrames.indices)));
|
||||
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTransData &aAnimPartTransDataIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimPartTransDataIn.frames;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream << aAnimPartTransDataIn.frame0[i];
|
||||
}
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTransData &aAnimPartTransDataOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimPartTransDataOut.frames;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream >> aAnimPartTransDataOut.frame0[i];
|
||||
}
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimPartTransDataToString(const XAnimPartTransData &aAnimPartTransData) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimPartTransData(");
|
||||
|
||||
debug.append(QString("\n frames: %1").arg(XAnimPartTransFramesToString(aAnimPartTransData.frames)));
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
debug.append(QString("\n smallTrans: %1").arg(aAnimPartTransData.frame0[i]));
|
||||
}
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTrans &aAnimPartTransIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimPartTransIn.size
|
||||
<< aAnimPartTransIn.smallTrans
|
||||
<< aAnimPartTransIn.data;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTrans &aAnimPartTransOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimPartTransOut.size
|
||||
>> aAnimPartTransOut.smallTrans
|
||||
>> aAnimPartTransOut.data;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimPartTransToString(const XAnimPartTrans &aAnimPartTrans) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimPartTrans(");
|
||||
|
||||
debug.append(QString("\n size: %1").arg(aAnimPartTrans.size));
|
||||
debug.append(QString("\n smallTrans: %1").arg(aAnimPartTrans.smallTrans));
|
||||
debug.append(QString("\n data: %1").arg(XAnimPartTransDataToString(aAnimPartTrans.data)));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFramesIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimDeltaPartQuatDataFramesIn.framesPtr
|
||||
<< aAnimDeltaPartQuatDataFramesIn.indices;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFramesOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimDeltaPartQuatDataFramesOut.framesPtr
|
||||
>> aAnimDeltaPartQuatDataFramesOut.indices;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDeltaPartQuatDataFramesToString(const XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFrames) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDeltaPartQuatDataFrames(");
|
||||
|
||||
debug.append(QString("\n framesPtr: %1").arg(aAnimDeltaPartQuatDataFrames.framesPtr));
|
||||
for (int i = 0; i < 2; i++) {
|
||||
debug.append(QString("\n frames %1: %2").arg(i).arg(aAnimDeltaPartQuatDataFrames.frames[i]));
|
||||
}
|
||||
debug.append(QString("\n indices: %1").arg(XAnimDynamicIndicesToString(aAnimDeltaPartQuatDataFrames.indices)));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuatData &aAnimDeltaPartQuatDataIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimDeltaPartQuatDataIn.frames;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
aDataStream << aAnimDeltaPartQuatDataIn.frame0[i];
|
||||
}
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuatData &aAnimDeltaPartQuatDataOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimDeltaPartQuatDataOut.frames;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
aDataStream >> aAnimDeltaPartQuatDataOut.frame0[i];
|
||||
}
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDeltaPartQuatDataToString(const XAnimDeltaPartQuatData &aAnimDeltaPartQuatData) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDeltaPartQuatData(");
|
||||
|
||||
debug.append(QString("\n frames: %1").arg(XAnimDeltaPartQuatDataFramesToString(aAnimDeltaPartQuatData.frames)));
|
||||
for (int i = 0; i < 2; i++) {
|
||||
debug.append(QString("\n frame0 %1: %2").arg(i).arg(aAnimDeltaPartQuatData.frame0[i]));
|
||||
}
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuat &aAnimDeltaPartQuatIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimDeltaPartQuatIn.size
|
||||
<< aAnimDeltaPartQuatIn.data;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuat &aAnimDeltaPartQuatOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimDeltaPartQuatOut.size
|
||||
>> aAnimDeltaPartQuatOut.data;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDeltaPartQuatToString(const XAnimDeltaPartQuat &aAnimDeltaPartQuat) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDeltaPartQuat(");
|
||||
|
||||
debug.append(QString("\n size: %1").arg(aAnimDeltaPartQuat.size));
|
||||
debug.append(QString("\n data: %1").arg(XAnimDeltaPartQuatDataToString(aAnimDeltaPartQuat.data)));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPart &aAnimDeltaPartIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimDeltaPartIn.transPtr
|
||||
<< aAnimDeltaPartIn.quatPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPart &aAnimDeltaPartOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimDeltaPartOut.transPtr
|
||||
>> aAnimDeltaPartOut.quatPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDeltaPartToString(const XAnimDeltaPart &aAnimDeltaPart) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDeltaPart(");
|
||||
|
||||
debug.append(QString("\n transPtr: %1").arg(aAnimDeltaPart.transPtr));
|
||||
debug.append(QString("\n trans: %1").arg(XAnimPartTransToString(aAnimDeltaPart.trans)));
|
||||
debug.append(QString("\n quatPtr: %1").arg(aAnimDeltaPart.quatPtr));
|
||||
debug.append(QString("\n quat: %1").arg(XAnimDeltaPartQuatToString(aAnimDeltaPart.quat)));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimNotifyInfo &aAnimNotifyInfoIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimNotifyInfoIn.name
|
||||
<< aAnimNotifyInfoIn.time;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QDebug operator<<(QDebug debug, const XAnimNotifyInfo &aAnimNotifyInfo) {
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.noquote().nospace();
|
||||
|
||||
debug << "XAnimNotifyInfo(";
|
||||
|
||||
debug << "\n name: " << aAnimNotifyInfo.name;
|
||||
debug << "\n time: " << aAnimNotifyInfo.time;
|
||||
debug << "\n)";
|
||||
|
||||
return debug;
|
||||
}
|
||||
QString XAnimNotifyInfoToString(const XAnimNotifyInfo &aAnimNotifyInfo) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimNotifyInfo(");
|
||||
|
||||
debug.append(QString("\n name: %1").arg(aAnimNotifyInfo.name));
|
||||
debug.append(QString("\n time: %1").arg(aAnimNotifyInfo.time));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimNotifyInfo &aAnimNotifyInfoOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimNotifyInfoOut.name
|
||||
>> aAnimNotifyInfoOut.time;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimIndices &aAnimIndicesIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimIndicesIn.indexPtr
|
||||
<< aAnimIndicesIn.index;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QDebug operator<<(QDebug debug, const XAnimIndices &aAnimIndices) {
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.noquote().nospace();
|
||||
|
||||
debug << "XAnimIndices(";
|
||||
|
||||
debug << "\n name: " << aAnimIndices.indexPtr;
|
||||
debug << "\n namePtr: " << aAnimIndices.index;
|
||||
debug << "\n)";
|
||||
|
||||
return debug;
|
||||
}
|
||||
QString XAnimIndicesToString(const XAnimIndices &aAnimIndices) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimIndices(");
|
||||
|
||||
debug.append(QString("\n name: %1").arg(aAnimIndices.indexPtr));
|
||||
debug.append(QString("\n namePtr: %1").arg(aAnimIndices.index));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimIndices &aAnimIndicesOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimIndicesOut.indexPtr
|
||||
>> aAnimIndicesOut.index;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimParts &aAnimPartIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimPartIn.name
|
||||
<< aAnimPartIn.dataByteCount
|
||||
<< aAnimPartIn.dataShortCount
|
||||
<< aAnimPartIn.dataIntCount
|
||||
<< aAnimPartIn.randomDataByteCount
|
||||
<< aAnimPartIn.randomDataIntCount
|
||||
<< aAnimPartIn.numframes
|
||||
<< aAnimPartIn.bLoop
|
||||
<< aAnimPartIn.bDelta;
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
aDataStream << aAnimPartIn.boneCount[i];
|
||||
}
|
||||
|
||||
aDataStream
|
||||
<< aAnimPartIn.notifyCount
|
||||
<< aAnimPartIn.pad
|
||||
<< aAnimPartIn.randomDataShortCount
|
||||
<< aAnimPartIn.indexCount
|
||||
<< aAnimPartIn.framerate
|
||||
<< aAnimPartIn.frequency
|
||||
<< aAnimPartIn.namesPtr
|
||||
<< aAnimPartIn.dataBytePtr
|
||||
<< aAnimPartIn.dataShortPtr
|
||||
<< aAnimPartIn.dataIntPtr
|
||||
<< aAnimPartIn.randomDataShortPtr
|
||||
<< aAnimPartIn.randomDataBytePtr
|
||||
<< aAnimPartIn.randomDataIntPtr
|
||||
<< aAnimPartIn.indices
|
||||
<< aAnimPartIn.notifyPtr
|
||||
<< aAnimPartIn.deltaPartPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
quint32 ROL4(quint32 value, int positions) {
|
||||
return (value << positions) | (value >> (32 - positions));
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimParts &aAnimPartOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimPartOut.namePtr
|
||||
>> aAnimPartOut.dataByteCount
|
||||
>> aAnimPartOut.dataShortCount
|
||||
>> aAnimPartOut.dataIntCount
|
||||
>> aAnimPartOut.randomDataByteCount
|
||||
>> aAnimPartOut.randomDataIntCount
|
||||
>> aAnimPartOut.numframes
|
||||
>> aAnimPartOut.bLoop
|
||||
>> aAnimPartOut.bDelta;
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
aDataStream >> aAnimPartOut.boneCount[i];
|
||||
}
|
||||
|
||||
aDataStream
|
||||
>> aAnimPartOut.notifyCount
|
||||
>> aAnimPartOut.assetType
|
||||
>> aAnimPartOut.pad;
|
||||
|
||||
aDataStream.skipRawData(3);
|
||||
|
||||
aDataStream
|
||||
>> aAnimPartOut.randomDataShortCount
|
||||
>> aAnimPartOut.indexCount;
|
||||
|
||||
quint32 framerateInt, frequencyInt;
|
||||
aDataStream
|
||||
>> framerateInt
|
||||
>> frequencyInt
|
||||
>> aAnimPartOut.namesPtr
|
||||
>> aAnimPartOut.dataBytePtr
|
||||
>> aAnimPartOut.dataShortPtr
|
||||
>> aAnimPartOut.dataIntPtr
|
||||
>> aAnimPartOut.randomDataShortPtr
|
||||
>> aAnimPartOut.randomDataBytePtr
|
||||
>> aAnimPartOut.randomDataIntPtr
|
||||
>> aAnimPartOut.indices
|
||||
>> aAnimPartOut.notifyPtr
|
||||
>> aAnimPartOut.deltaPartPtr;
|
||||
|
||||
aAnimPartOut.framerate = *reinterpret_cast<float*>(&framerateInt);
|
||||
aAnimPartOut.frequency = *reinterpret_cast<float*>(&frequencyInt);
|
||||
|
||||
if (aAnimPartOut.namePtr) {
|
||||
aAnimPartOut.name = "";
|
||||
|
||||
char animNameChar;
|
||||
aDataStream >> animNameChar;
|
||||
while (animNameChar != '\0') {
|
||||
aAnimPartOut.name += animNameChar;
|
||||
|
||||
aDataStream >> animNameChar;
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.namesPtr) {
|
||||
int nameCount = aAnimPartOut.boneCount[11];
|
||||
aDataStream.skipRawData(2 * nameCount);
|
||||
|
||||
for (int i = 0; i < nameCount; i++) {
|
||||
aDataStream.skipRawData(2);
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.notifyPtr) {
|
||||
int notifyCount = aAnimPartOut.notifyCount;
|
||||
aDataStream.skipRawData(8 * notifyCount);
|
||||
|
||||
for (int i = 0; i < notifyCount; i++) {
|
||||
aDataStream.skipRawData(8);
|
||||
aDataStream >> aAnimPartOut.notify;
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.deltaPartPtr) {
|
||||
aDataStream >> aAnimPartOut.deltaPart;
|
||||
if (aAnimPartOut.deltaPart.transPtr) {
|
||||
aDataStream >> aAnimPartOut.deltaPart.trans;
|
||||
|
||||
if (aAnimPartOut.deltaPart.trans.size) {
|
||||
aDataStream >> aAnimPartOut.deltaPart.trans.data.frames;
|
||||
quint32 size = aAnimPartOut.deltaPart.trans.size;
|
||||
quint32 readSize;
|
||||
if (aAnimPartOut.numframes >= 0x100) {
|
||||
readSize = 2 * (size + 1);
|
||||
} else {
|
||||
readSize = size + 1;
|
||||
}
|
||||
aDataStream >> aAnimPartOut.deltaPart.trans.data.frames.indices;
|
||||
|
||||
if (aAnimPartOut.deltaPart.trans.smallTrans) {
|
||||
if (aAnimPartOut.deltaPart.trans.data.frames.frames.framesPtr) {
|
||||
aDataStream.skipRawData(3 * (aAnimPartOut.deltaPart.trans.size + 1));
|
||||
}
|
||||
} else if (aAnimPartOut.deltaPart.trans.data.frames.frames.framesPtr) {
|
||||
aDataStream.skipRawData(6 * (aAnimPartOut.deltaPart.trans.size + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.deltaPart.quatPtr) {
|
||||
aDataStream >> aAnimPartOut.deltaPart.quat;
|
||||
|
||||
if (aAnimPartOut.deltaPart.quat.size) {
|
||||
aDataStream >> aAnimPartOut.deltaPart.quat.data.frames;
|
||||
aDataStream >> aAnimPartOut.deltaPart.quat.data.frames.indices;
|
||||
|
||||
if (aAnimPartOut.deltaPart.quat.data.frames.framesPtr) {
|
||||
aDataStream.skipRawData(4 * (aAnimPartOut.deltaPart.quat.size + 1));
|
||||
}
|
||||
} else {
|
||||
aDataStream >> aAnimPartOut.deltaPart.quat.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.dataBytePtr) {
|
||||
aDataStream.skipRawData(aAnimPartOut.dataByteCount);
|
||||
}
|
||||
if (aAnimPartOut.dataShortPtr) {
|
||||
aDataStream.skipRawData(ROL4(aAnimPartOut.dataShortCount, 1));
|
||||
}
|
||||
if (aAnimPartOut.dataIntPtr) {
|
||||
aDataStream.skipRawData(ROL4(aAnimPartOut.dataIntCount, 2));
|
||||
}
|
||||
if (aAnimPartOut.randomDataShortPtr) {
|
||||
aDataStream.skipRawData(2 * aAnimPartOut.randomDataShortCount);
|
||||
}
|
||||
if (aAnimPartOut.randomDataBytePtr) {
|
||||
aDataStream.skipRawData(2 * aAnimPartOut.randomDataByteCount);
|
||||
}
|
||||
if (aAnimPartOut.randomDataIntPtr) {
|
||||
aDataStream.skipRawData(ROL4(aAnimPartOut.randomDataIntCount, 2));
|
||||
}
|
||||
|
||||
qDebug() << aDataStream.device()->pos();
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QString XAnimPartsToString(const XAnimParts &xAnimParts) {
|
||||
QString debug = "";
|
||||
|
||||
debug.append(QString("XAnimParts("));
|
||||
|
||||
debug.append(QString("\n name: %1").arg(xAnimParts.name));
|
||||
debug.append(QString("\n namePtr: %1").arg(QString::number(xAnimParts.namePtr, 16)));
|
||||
|
||||
debug.append(QString("\n dataByteCount: %1").arg(xAnimParts.dataByteCount));
|
||||
debug.append(QString("\n dataShortCount: %1").arg(xAnimParts.dataShortCount));
|
||||
debug.append(QString("\n dataIntCount: %1").arg(xAnimParts.dataIntCount));
|
||||
debug.append(QString("\n randomDataByteCount: %1").arg(xAnimParts.randomDataByteCount));
|
||||
debug.append(QString("\n randomDataIntCount: %1").arg(xAnimParts.randomDataIntCount));
|
||||
debug.append(QString("\n numframes: %1").arg(xAnimParts.numframes));
|
||||
|
||||
debug.append(QString("\n bLoop: %1").arg(xAnimParts.bLoop));
|
||||
debug.append(QString("\n bDelta: %1").arg(xAnimParts.bDelta));
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
debug.append(QString("\n boneCount %1: %2").arg(i).arg(xAnimParts.boneCount[i]));
|
||||
}
|
||||
|
||||
debug.append(QString("\n notifyCount: %1").arg(xAnimParts.notifyCount));
|
||||
debug.append(QString("\n assetType: %1").arg(xAnimParts.assetType));
|
||||
|
||||
debug.append(QString("\n pad: %1").arg(xAnimParts.pad));
|
||||
|
||||
debug.append(QString("\n randomDataShortCount: %1").arg(xAnimParts.randomDataShortCount));
|
||||
debug.append(QString("\n indexCount: %1").arg(xAnimParts.indexCount));
|
||||
|
||||
debug.append(QString("\n framerate: %1").arg(xAnimParts.framerate));
|
||||
debug.append(QString("\n frequency: %1").arg(xAnimParts.frequency));
|
||||
|
||||
debug.append(QString("\n namesPtr: %1").arg(QString::number(xAnimParts.namesPtr, 16)));
|
||||
debug.append(QString("\n names: %1").arg(xAnimParts.names));
|
||||
|
||||
debug.append(QString("\n dataBytePtr: %1").arg(QString::number(xAnimParts.dataBytePtr, 16)));
|
||||
debug.append(QString("\n dataByte: %1").arg(xAnimParts.dataByte));
|
||||
|
||||
debug.append(QString("\n dataShortPtr: %1").arg(QString::number(xAnimParts.dataShortPtr, 16)));
|
||||
debug.append(QString("\n dataShort: %1").arg(xAnimParts.dataShort));
|
||||
|
||||
debug.append(QString("\n dataIntPtr: %1").arg(QString::number(xAnimParts.dataIntPtr, 16)));
|
||||
debug.append(QString("\n dataInt: %1").arg(xAnimParts.dataInt));
|
||||
|
||||
debug.append(QString("\n randomDataShortPtr: %1").arg(QString::number(xAnimParts.randomDataShortPtr, 16)));
|
||||
debug.append(QString("\n randomDataShort: %1").arg(xAnimParts.randomDataShort));
|
||||
|
||||
debug.append(QString("\n randomDataBytePtr: %1").arg(QString::number(xAnimParts.randomDataBytePtr, 16)));
|
||||
debug.append(QString("\n randomDataByte: %1").arg(xAnimParts.randomDataByte));
|
||||
|
||||
debug.append(QString("\n randomDataIntPtr: %1").arg(QString::number(xAnimParts.randomDataIntPtr, 16)));
|
||||
debug.append(QString("\n randomDataInt: %1").arg(xAnimParts.randomDataInt));
|
||||
|
||||
debug.append(QString("\n indices: %1").arg(XAnimIndicesToString(xAnimParts.indices)));
|
||||
|
||||
debug.append(QString("\n notifyPtr: %1").arg(QString::number(xAnimParts.notifyPtr, 16)));
|
||||
debug.append(QString("\n notify: %1").arg(XAnimNotifyInfoToString(xAnimParts.notify)));
|
||||
|
||||
debug.append(QString("\n deltaPartPtr: %1").arg(QString::number(xAnimParts.deltaPartPtr, 16)));
|
||||
debug.append(QString("\n deltaPart: %1").arg(XAnimDeltaPartToString(xAnimParts.deltaPart)));
|
||||
|
||||
debug.append(QString("\n)"));
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug debug, const XAnimParts &xanimParts) {
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.noquote().nospace();
|
||||
|
||||
debug << XAnimPartsToString(xanimParts);
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,173 +0,0 @@
|
||||
#ifndef ANIMPARTS_H
|
||||
#define ANIMPARTS_H
|
||||
|
||||
#include <QString>
|
||||
#include <QDataStream>
|
||||
#include <QDebug>
|
||||
|
||||
struct XAnimDynamicFrames
|
||||
{
|
||||
quint32 framesPtr;
|
||||
quint8 frames[3];
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDynamicFrames &aAnimDynamicFramesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDynamicFrames &aAnimDynamicFramesOut);
|
||||
|
||||
struct XAnimDynamicIndices
|
||||
{
|
||||
quint8 indices[1];
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDynamicIndices &aAnimDynamicIndicesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDynamicIndices &aAnimDynamicIndicesOut);
|
||||
|
||||
struct XAnimPartTransFrames
|
||||
{
|
||||
float mins[3];
|
||||
float size[3];
|
||||
XAnimDynamicFrames frames;
|
||||
XAnimDynamicIndices indices;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTransFrames &aAnimPartTransFramesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTransFrames &aAnimPartTransFramesOut);
|
||||
|
||||
union XAnimPartTransData
|
||||
{
|
||||
XAnimPartTransFrames frames;
|
||||
float frame0[3];
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTransData &aAnimPartTransDataIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTransData &aAnimPartTransDataOut);
|
||||
|
||||
struct XAnimPartTrans
|
||||
{
|
||||
quint16 size;
|
||||
quint8 smallTrans;
|
||||
XAnimPartTransData data;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTrans &aAnimPartTransIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTrans &aAnimPartTransOut);
|
||||
|
||||
struct XAnimDeltaPartQuatDataFrames
|
||||
{
|
||||
quint32 framesPtr;
|
||||
qint16 frames[2];
|
||||
|
||||
XAnimDynamicIndices indices;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFramesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFramesOut);
|
||||
|
||||
struct XAnimDeltaPartQuatData
|
||||
{
|
||||
XAnimDeltaPartQuatDataFrames frames;
|
||||
qint16 frame0[2];
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuatData &aAnimDeltaPartQuatDataIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuatData &aAnimDeltaPartQuatDataOut);
|
||||
|
||||
struct XAnimDeltaPartQuat
|
||||
{
|
||||
quint16 size;
|
||||
XAnimDeltaPartQuatData data;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuat &aAnimDeltaPartQuatIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuat &aAnimDeltaPartQuatOut);
|
||||
|
||||
struct XAnimDeltaPart
|
||||
{
|
||||
quint32 transPtr;
|
||||
XAnimPartTrans trans;
|
||||
|
||||
quint32 quatPtr;
|
||||
XAnimDeltaPartQuat quat;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPart &aAnimDeltaPartIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPart &aAnimDeltaPartOut);
|
||||
|
||||
struct XAnimNotifyInfo
|
||||
{
|
||||
quint16 name;
|
||||
float time;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimNotifyInfo &aAnimNotifyInfoIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimNotifyInfo &aAnimNotifyInfoOut);
|
||||
QDebug operator<<(QDebug debug, const XAnimNotifyInfo &aAnimNotifyInfo);
|
||||
QString XAnimNotifyInfoToString(const XAnimNotifyInfo &aAnimNotifyInfo);
|
||||
|
||||
struct XAnimIndices
|
||||
{
|
||||
quint32 indexPtr;
|
||||
quint16 index;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimIndices &aAnimIndicesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimIndices &aAnimIndicesOut);
|
||||
QDebug operator<<(QDebug debug, const XAnimIndices &aAnimIndices);
|
||||
QString XAnimIndicesToString(const XAnimIndices &aAnimIndices);
|
||||
|
||||
struct XAnimParts
|
||||
{
|
||||
QString name;
|
||||
quint32 namePtr;
|
||||
|
||||
quint16 dataByteCount;
|
||||
quint16 dataShortCount;
|
||||
quint16 dataIntCount;
|
||||
quint16 randomDataByteCount;
|
||||
quint16 randomDataIntCount;
|
||||
quint16 numframes;
|
||||
|
||||
bool bLoop;
|
||||
bool bDelta;
|
||||
|
||||
quint8 boneCount[12];
|
||||
quint8 notifyCount;
|
||||
quint8 assetType;
|
||||
|
||||
bool pad;
|
||||
|
||||
quint16 randomDataShortCount;
|
||||
quint16 indexCount;
|
||||
|
||||
float framerate;
|
||||
float frequency;
|
||||
|
||||
quint32 namesPtr;
|
||||
quint16 names;
|
||||
|
||||
quint32 dataBytePtr;
|
||||
quint8 dataByte;
|
||||
|
||||
quint32 dataShortPtr;
|
||||
qint16 dataShort;
|
||||
|
||||
quint32 dataIntPtr;
|
||||
int dataInt;
|
||||
|
||||
quint32 randomDataShortPtr;
|
||||
qint16 randomDataShort;
|
||||
|
||||
quint32 randomDataBytePtr;
|
||||
quint8 randomDataByte;
|
||||
|
||||
quint32 randomDataIntPtr;
|
||||
int randomDataInt;
|
||||
|
||||
XAnimIndices indices;
|
||||
|
||||
qint32 notifyPtr;
|
||||
XAnimNotifyInfo notify;
|
||||
|
||||
qint32 deltaPartPtr;
|
||||
XAnimDeltaPart deltaPart;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimParts &aAnimPartIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimParts &aAnimPartOut);
|
||||
QDebug operator<<(QDebug debug, const XAnimParts &xanimParts);
|
||||
QString XAnimPartsToString(const XAnimParts &xAnimParts);
|
||||
|
||||
struct Animation {
|
||||
QString name;
|
||||
XAnimParts animParts;
|
||||
};
|
||||
|
||||
#endif // ANIMPARTS_H
|
||||
@ -1 +0,0 @@
|
||||
#include "clipmap.h"
|
||||
@ -1,233 +0,0 @@
|
||||
#ifndef CLIPMAP_H
|
||||
#define CLIPMAP_H
|
||||
|
||||
#include "xmodel.h"
|
||||
#include "mapent.h"
|
||||
#include "effectdef.h"
|
||||
|
||||
struct cStaticModelWritable
|
||||
{
|
||||
unsigned __int16 nextModelInWorldSector;
|
||||
};
|
||||
|
||||
struct cStaticModel_s
|
||||
{
|
||||
cStaticModelWritable writable;
|
||||
Model *xmodel;
|
||||
float origin[3];
|
||||
float invScaledAxis[3][3];
|
||||
float absmin[3];
|
||||
float absmax[3];
|
||||
};
|
||||
|
||||
struct dmaterial_t
|
||||
{
|
||||
char material[64];
|
||||
int surfaceFlags;
|
||||
int contentFlags;
|
||||
};
|
||||
|
||||
struct cNode_t
|
||||
{
|
||||
CPlane *plane;
|
||||
__int16 children[2];
|
||||
};
|
||||
|
||||
struct CLeaf
|
||||
{
|
||||
unsigned __int16 firstCollAabbIndex;
|
||||
unsigned __int16 collAabbCount;
|
||||
int brushContents;
|
||||
int terrainContents;
|
||||
float mins[3];
|
||||
float maxs[3];
|
||||
int leafBrushNode;
|
||||
__int16 cluster;
|
||||
};
|
||||
|
||||
struct CLeafBrushNodeLeaf
|
||||
{
|
||||
unsigned __int16 *brushes;
|
||||
};
|
||||
|
||||
struct CLeafBrushNodeChildren
|
||||
{
|
||||
float dist;
|
||||
float range;
|
||||
unsigned __int16 childOffset[2];
|
||||
};
|
||||
|
||||
union CLeafBrushNodeData
|
||||
{
|
||||
CLeafBrushNodeLeaf leaf;
|
||||
CLeafBrushNodeChildren children;
|
||||
};
|
||||
|
||||
struct CLeafBrushNode
|
||||
{
|
||||
unsigned __int8 axis;
|
||||
__int16 leafBrushCount;
|
||||
int contents;
|
||||
CLeafBrushNodeData data;
|
||||
};
|
||||
|
||||
struct CollisionBorder
|
||||
{
|
||||
float distEq[3];
|
||||
float zBase;
|
||||
float zSlope;
|
||||
float start;
|
||||
float length;
|
||||
};
|
||||
|
||||
struct CollisionPartition
|
||||
{
|
||||
unsigned __int8 triCount;
|
||||
unsigned __int8 borderCount;
|
||||
int firstTri;
|
||||
CollisionBorder *borders;
|
||||
};
|
||||
|
||||
union CollisionAabbTreeIndex
|
||||
{
|
||||
int firstChildIndex;
|
||||
int partitionIndex;
|
||||
};
|
||||
|
||||
struct CollisionAabbTree
|
||||
{
|
||||
float origin[3];
|
||||
float halfSize[3];
|
||||
unsigned __int16 materialIndex;
|
||||
unsigned __int16 childCount;
|
||||
CollisionAabbTreeIndex u;
|
||||
};
|
||||
|
||||
struct CModel
|
||||
{
|
||||
float mins[3];
|
||||
float maxs[3];
|
||||
float radius;
|
||||
CLeaf leaf;
|
||||
};
|
||||
|
||||
struct __declspec(align(16)) CBrush
|
||||
{
|
||||
float mins[3];
|
||||
int contents;
|
||||
float maxs[3];
|
||||
unsigned int numsides;
|
||||
CBrushSide *sides;
|
||||
__int16 axialMaterialNum[2][3];
|
||||
unsigned __int8 *baseAdjacentSide;
|
||||
__int16 firstAdjacentSideOffsets[2][3];
|
||||
unsigned __int8 edgeCount[2][3];
|
||||
};
|
||||
|
||||
enum DynEntityType : __int32
|
||||
{
|
||||
DYNENT_TYPE_INVALID = 0x0,
|
||||
DYNENT_TYPE_CLUTTER = 0x1,
|
||||
DYNENT_TYPE_DESTRUCT = 0x2,
|
||||
DYNENT_TYPE_COUNT = 0x3,
|
||||
};
|
||||
|
||||
struct GfxPlacement
|
||||
{
|
||||
float quat[4];
|
||||
float origin[3];
|
||||
};
|
||||
|
||||
struct XModelPieces;
|
||||
struct DynEntityDef
|
||||
{
|
||||
DynEntityType type;
|
||||
GfxPlacement pose;
|
||||
Model *xModel;
|
||||
unsigned __int16 brushModel;
|
||||
unsigned __int16 physicsBrushModel;
|
||||
const EffectDef *destroyFx;
|
||||
XModelPieces *destroyPieces;
|
||||
PhysPreset *physPreset;
|
||||
int health;
|
||||
PhysMass mass;
|
||||
int contents;
|
||||
};
|
||||
|
||||
struct DynEntityPose
|
||||
{
|
||||
GfxPlacement pose;
|
||||
float radius;
|
||||
};
|
||||
|
||||
struct DynEntityClient
|
||||
{
|
||||
int physObjId;
|
||||
unsigned __int16 flags;
|
||||
unsigned __int16 lightingHandle;
|
||||
int health;
|
||||
};
|
||||
|
||||
struct DynEntityColl
|
||||
{
|
||||
unsigned __int16 sector;
|
||||
unsigned __int16 nextEntInSector;
|
||||
float linkMins[2];
|
||||
float linkMaxs[2];
|
||||
};
|
||||
|
||||
struct ClipMap
|
||||
{
|
||||
const char *name;
|
||||
int isInUse;
|
||||
int planeCount;
|
||||
CPlane *planes;
|
||||
unsigned int numStaticModels;
|
||||
cStaticModel_s *staticModelList;
|
||||
unsigned int numMaterials;
|
||||
dmaterial_t *materials;
|
||||
unsigned int numBrushSides;
|
||||
CBrushSide *brushsides;
|
||||
unsigned int numBrushEdges;
|
||||
unsigned __int8 *brushEdges;
|
||||
unsigned int numNodes;
|
||||
cNode_t *nodes;
|
||||
unsigned int numLeafs;
|
||||
CLeaf *leafs;
|
||||
unsigned int leafbrushNodesCount;
|
||||
CLeafBrushNode *leafbrushNodes;
|
||||
unsigned int numLeafBrushes;
|
||||
unsigned __int16 *leafbrushes;
|
||||
unsigned int numLeafSurfaces;
|
||||
unsigned int *leafsurfaces;
|
||||
unsigned int vertCount;
|
||||
float (*verts)[3];
|
||||
int triCount;
|
||||
unsigned __int16 *triIndices;
|
||||
unsigned __int8 *triEdgeIsWalkable;
|
||||
int borderCount;
|
||||
CollisionBorder *borders;
|
||||
int partitionCount;
|
||||
CollisionPartition *partitions;
|
||||
int aabbTreeCount;
|
||||
CollisionAabbTree *aabbTrees;
|
||||
unsigned int numSubModels;
|
||||
CModel *cmodels;
|
||||
unsigned __int16 numBrushes;
|
||||
CBrush *brushes;
|
||||
int numClusters;
|
||||
int clusterBytes;
|
||||
unsigned __int8 *visibility;
|
||||
int vised;
|
||||
MapEnts *mapEnts;
|
||||
CBrush *box_brush;
|
||||
CModel box_model;
|
||||
unsigned __int16 dynEntCount[2];
|
||||
DynEntityDef *dynEntDefList[2];
|
||||
DynEntityPose *dynEntPoseList[2];
|
||||
DynEntityClient *dynEntClientList[2];
|
||||
DynEntityColl *dynEntCollList[2];
|
||||
unsigned int checksum;
|
||||
};
|
||||
|
||||
#endif // CLIPMAP_H
|
||||
@ -1 +0,0 @@
|
||||
#include "effectdef.h"
|
||||
@ -1,203 +0,0 @@
|
||||
#ifndef EFFECTDEF_H
|
||||
#define EFFECTDEF_H
|
||||
|
||||
#include "material.h"
|
||||
#include "xmodel.h"
|
||||
|
||||
struct FxSpawnDefLooping
|
||||
{
|
||||
int intervalMsec;
|
||||
int count;
|
||||
};
|
||||
|
||||
struct FxIntRange
|
||||
{
|
||||
int base;
|
||||
int amplitude;
|
||||
};
|
||||
|
||||
struct FxSpawnDefOneShot
|
||||
{
|
||||
FxIntRange count;
|
||||
};
|
||||
|
||||
union FxSpawnDef
|
||||
{
|
||||
FxSpawnDefLooping looping;
|
||||
FxSpawnDefOneShot oneShot;
|
||||
};
|
||||
|
||||
struct FxFloatRange
|
||||
{
|
||||
float base;
|
||||
float amplitude;
|
||||
};
|
||||
|
||||
struct FxElemAtlas
|
||||
{
|
||||
unsigned __int8 behavior;
|
||||
unsigned __int8 index;
|
||||
unsigned __int8 fps;
|
||||
unsigned __int8 loopCount;
|
||||
unsigned __int8 colIndexBits;
|
||||
unsigned __int8 rowIndexBits;
|
||||
__int16 entryCount;
|
||||
};
|
||||
|
||||
struct FxElemVec3Range
|
||||
{
|
||||
float base[3];
|
||||
float amplitude[3];
|
||||
};
|
||||
|
||||
struct FxElemVelStateInFrame
|
||||
{
|
||||
FxElemVec3Range velocity;
|
||||
FxElemVec3Range totalDelta;
|
||||
};
|
||||
|
||||
struct FxElemVelStateSample
|
||||
{
|
||||
FxElemVelStateInFrame local;
|
||||
FxElemVelStateInFrame world;
|
||||
};
|
||||
|
||||
struct FxElemVisualState
|
||||
{
|
||||
unsigned __int8 color[4];
|
||||
float rotationDelta;
|
||||
float rotationTotal;
|
||||
float size[2];
|
||||
float scale;
|
||||
};
|
||||
|
||||
struct FxElemVisStateSample
|
||||
{
|
||||
FxElemVisualState base;
|
||||
FxElemVisualState amplitude;
|
||||
};
|
||||
|
||||
struct FxElemMarkVisuals
|
||||
{
|
||||
qint32 materialPtrs[2];
|
||||
QVector<Material> materials;
|
||||
};
|
||||
|
||||
struct EffectDef;
|
||||
union EffectDefRef
|
||||
{
|
||||
qint32 handlePtr;
|
||||
const EffectDef *handle;
|
||||
|
||||
qint32 namePtr;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
union FxElemVisuals
|
||||
{
|
||||
qint32 anonymousPtr;
|
||||
const void *anonymous;
|
||||
|
||||
qint32 materialPtr;
|
||||
Material *material;
|
||||
|
||||
qint32 modelPtr;
|
||||
Model *model;
|
||||
|
||||
EffectDefRef effectDef;
|
||||
|
||||
qint32 soundNamePtr;
|
||||
const char *soundName;
|
||||
};
|
||||
|
||||
struct FxElemDefVisuals
|
||||
{
|
||||
qint32 markArrayPtr;
|
||||
QVector<FxElemMarkVisuals> markArray;
|
||||
|
||||
qint32 arrayPtr;
|
||||
QVector<FxElemVisuals> array;
|
||||
|
||||
FxElemVisuals instance;
|
||||
};
|
||||
|
||||
struct FxTrailVertex
|
||||
{
|
||||
float pos[2];
|
||||
float normal[2];
|
||||
float texCoord;
|
||||
};
|
||||
|
||||
struct FxTrailDef
|
||||
{
|
||||
int scrollTimeMsec;
|
||||
int repeatDist;
|
||||
int splitDist;
|
||||
int vertCount;
|
||||
FxTrailVertex *verts;
|
||||
int indCount;
|
||||
unsigned __int16 *inds;
|
||||
};
|
||||
|
||||
struct FxElemDef
|
||||
{
|
||||
int flags;
|
||||
FxSpawnDef spawn;
|
||||
FxFloatRange spawnRange;
|
||||
FxFloatRange fadeInRange;
|
||||
FxFloatRange fadeOutRange;
|
||||
float spawnFrustumCullRadius;
|
||||
FxIntRange spawnDelayMsec;
|
||||
FxIntRange lifeSpanMsec;
|
||||
FxFloatRange spawnOrigin[3];
|
||||
FxFloatRange spawnOffsetRadius;
|
||||
FxFloatRange spawnOffsetHeight;
|
||||
FxFloatRange spawnAngles[3];
|
||||
FxFloatRange angularVelocity[3];
|
||||
FxFloatRange initialRotation;
|
||||
FxFloatRange gravity;
|
||||
FxFloatRange reflectionFactor;
|
||||
FxElemAtlas atlas;
|
||||
unsigned __int8 elemType;
|
||||
unsigned __int8 visualCount;
|
||||
unsigned __int8 velIntervalCount;
|
||||
unsigned __int8 visStateIntervalCount;
|
||||
qint32 velSamplesPtr;
|
||||
QVector<FxElemVelStateSample> velSamples;
|
||||
qint32 visSamplesPtr;
|
||||
QVector<FxElemVisStateSample> visSamples;
|
||||
FxElemDefVisuals visuals;
|
||||
float collMins[3];
|
||||
float collMaxs[3];
|
||||
EffectDefRef effectOnImpact;
|
||||
EffectDefRef effectOnDeath;
|
||||
EffectDefRef effectEmitted;
|
||||
FxFloatRange emitDist;
|
||||
FxFloatRange emitDistVariance;
|
||||
|
||||
qint32 trailDefPtr;
|
||||
FxTrailDef *trailDef;
|
||||
|
||||
unsigned __int8 sortOrder;
|
||||
unsigned __int8 lightingFrac;
|
||||
unsigned __int8 useItemClip;
|
||||
unsigned __int8 unused[1];
|
||||
};
|
||||
|
||||
struct EffectDef
|
||||
{
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
|
||||
int flags;
|
||||
int totalSize;
|
||||
int msecLoopingLife;
|
||||
int elemDefCountLooping;
|
||||
int elemDefCountOneShot;
|
||||
int elemDefCountEmission;
|
||||
|
||||
qint32 elemDefsPtr;
|
||||
QVector<FxElemDef> elemDefs;
|
||||
};
|
||||
|
||||
#endif // EFFECTDEF_H
|
||||
@ -1 +0,0 @@
|
||||
#include "effecttable.h"
|
||||
@ -1,24 +0,0 @@
|
||||
#ifndef EFFECTTABLE_H
|
||||
#define EFFECTTABLE_H
|
||||
|
||||
#include "effectdef.h"
|
||||
|
||||
struct FxImpactEntry
|
||||
{
|
||||
QVector<qint32> nonFleshPtrs;
|
||||
QVector<EffectDef> nonFlesh;
|
||||
|
||||
QVector<qint32> fleshPtrs;
|
||||
QVector<EffectDef> flesh;
|
||||
};
|
||||
|
||||
struct ImpactTable
|
||||
{
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
|
||||
qint32 tablePtr;
|
||||
QVector<FxImpactEntry> table;
|
||||
};
|
||||
|
||||
#endif // EFFECTTABLE_H
|
||||
@ -1 +0,0 @@
|
||||
#include "file.h"
|
||||
@ -1,13 +0,0 @@
|
||||
#ifndef FILE_H
|
||||
#define FILE_H
|
||||
|
||||
#include <QtTypes>
|
||||
|
||||
struct XFile
|
||||
{
|
||||
quint32 size;
|
||||
quint32 externalSize;
|
||||
quint32 blockSize[7];
|
||||
};
|
||||
|
||||
#endif // FILE_H
|
||||
@ -1 +0,0 @@
|
||||
#include "material.h"
|
||||
@ -1,283 +0,0 @@
|
||||
#ifndef MATERIAL_H
|
||||
#define MATERIAL_H
|
||||
|
||||
#include "materialtechset.h"
|
||||
|
||||
struct GfxDrawSurfFields
|
||||
{
|
||||
quint64 objectId : 16;
|
||||
quint64 reflectionProbeIndex : 8;
|
||||
quint64 customIndex : 5;
|
||||
quint64 materialSortedIndex : 11;
|
||||
quint64 prepass : 2;
|
||||
quint64 primaryLightIndex : 8;
|
||||
quint64 surfType : 4;
|
||||
quint64 primarySortKey : 6;
|
||||
quint64 unused : 4;
|
||||
};
|
||||
|
||||
struct MaterialInfo
|
||||
{
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
|
||||
quint8 gameFlags;
|
||||
quint8 sortKey;
|
||||
quint8 textureAtlasRowCount;
|
||||
quint8 textureAtlasColumnCount;
|
||||
GfxDrawSurfFields drawSurf;
|
||||
unsigned int surfaceTypeBits;
|
||||
};
|
||||
|
||||
enum MapType : qint32
|
||||
{
|
||||
MAPTYPE_NONE = 0x0,
|
||||
MAPTYPE_INVALID1 = 0x1,
|
||||
MAPTYPE_INVALID2 = 0x2,
|
||||
MAPTYPE_2D = 0x3,
|
||||
MAPTYPE_3D = 0x4,
|
||||
MAPTYPE_CUBE = 0x5,
|
||||
MAPTYPE_COUNT = 0x6,
|
||||
};
|
||||
|
||||
struct GPUTEXTURESIZE_1D
|
||||
{
|
||||
quint32 Width : 24;
|
||||
};
|
||||
|
||||
struct GPUTEXTURESIZE_2D
|
||||
{
|
||||
quint32 Width : 13;
|
||||
quint32 Height : 13;
|
||||
};
|
||||
|
||||
struct GPUTEXTURESIZE_3D
|
||||
{
|
||||
quint32 Width : 11;
|
||||
quint32 Height : 11;
|
||||
quint32 Depth : 10;
|
||||
};
|
||||
|
||||
struct GPUTEXTURESIZE_STACK
|
||||
{
|
||||
quint32 Width : 13;
|
||||
quint32 Height : 13;
|
||||
quint32 Depth : 6;
|
||||
};
|
||||
|
||||
struct GPUTEXTURE_FETCH_CONSTANT
|
||||
{
|
||||
quint32 Type : 2;
|
||||
quint32 SignX : 2;
|
||||
quint32 SignY : 2;
|
||||
quint32 SignZ : 2;
|
||||
quint32 SignW : 2;
|
||||
quint32 ClampX : 3;
|
||||
quint32 ClampY : 3;
|
||||
quint32 ClampZ : 3;
|
||||
quint32 : 3;
|
||||
quint32 Pitch : 9;
|
||||
quint32 Tiled : 1;
|
||||
|
||||
quint32 DataFormat : 6;
|
||||
quint32 Endian : 2;
|
||||
quint32 RequestSize : 2;
|
||||
quint32 Stacked : 1;
|
||||
quint32 ClampPolicy : 1;
|
||||
quint32 BaseAddress : 20;
|
||||
union
|
||||
{
|
||||
GPUTEXTURESIZE_1D OneD;
|
||||
GPUTEXTURESIZE_2D TwoD;
|
||||
GPUTEXTURESIZE_3D ThreeD;
|
||||
GPUTEXTURESIZE_STACK Stack;
|
||||
} Size;
|
||||
|
||||
quint32 NumFormat : 1;
|
||||
quint32 SwizzleX : 3;
|
||||
quint32 SwizzleY : 3;
|
||||
quint32 SwizzleZ : 3;
|
||||
quint32 SwizzleW : 3;
|
||||
qint32 ExpAdjust : 6;
|
||||
quint32 MagFilter : 2;
|
||||
quint32 MinFilter : 2;
|
||||
quint32 MipFilter : 2;
|
||||
quint32 AnisoFilter : 3;
|
||||
quint32 : 3;
|
||||
quint32 BorderSize : 1;
|
||||
|
||||
quint32 VolMagFilter : 1;
|
||||
quint32 VolMinFilter : 1;
|
||||
quint32 MinMipLevel : 4;
|
||||
quint32 MaxMipLevel : 4;
|
||||
quint32 MagAnisoWalk : 1;
|
||||
quint32 MinAnisoWalk : 1;
|
||||
qint32 LODBias : 10;
|
||||
qint32 GradExpAdjustH : 5;
|
||||
qint32 GradExpAdjustV : 5;
|
||||
|
||||
quint32 BorderColor : 2;
|
||||
quint32 ForceBCWToMax : 1;
|
||||
quint32 TriClamp : 2;
|
||||
qint32 AnisoBias : 4;
|
||||
quint32 Dimension : 2;
|
||||
quint32 PackedMips : 1;
|
||||
quint32 MipAddress : 20;
|
||||
};
|
||||
|
||||
// QDataStream &operator>>(QDataStream &in, GPUTEXTURE_FETCH_CONSTANT &s)
|
||||
// {
|
||||
// quint32 raw1, raw2, raw3, raw4, raw5;
|
||||
// in >> raw1 >> raw2 >> raw3 >> raw4 >> raw5;
|
||||
|
||||
// s.Type = raw1 & 0b000000000000000000000011;
|
||||
// s.SignX = (raw1 >> 2) & 0b000000000000000000000011;
|
||||
// s.SignY = (raw1 >> 4) & 0b000000000000000000000011;
|
||||
// s.SignZ = (raw1 >> 6) & 0b000000000000000000000011;
|
||||
// s.SignW = (raw1 >> 8) & 0b000000000000000000000011;
|
||||
// s.ClampX = (raw1 >> 10) & 0b000000000000000000000111;
|
||||
// s.ClampY = (raw1 >> 13) & 0b000000000000000000000111;
|
||||
// s.ClampZ = (raw1 >> 16) & 0b000000000000000000000111;
|
||||
// s.Pitch = (raw1 >> 22) & 0b000000000000000111111111;
|
||||
// s.Tiled = (raw1 >> 31) & 0b000000000000000000000001;
|
||||
|
||||
// s.DataFormat = raw2 & 0b000000000000000000111111;
|
||||
// s.Endian = (raw2 >> 6) & 0b000000000000000000000011;
|
||||
// s.RequestSize = (raw2 >> 8) & 0b000000000000000000000011;
|
||||
// s.Stacked = (raw2 >> 10) & 0b000000000000000000000001;
|
||||
// s.ClampPolicy = (raw2 >> 11) & 0b000000000000000000000001;
|
||||
// s.BaseAddress = (raw2 >> 12) & 0b000011111111111111111111;
|
||||
// s.Size = (raw2 >> 32) & 0b000000000000000000001111;
|
||||
|
||||
// s.NumFormat = raw3 & 0b000000000000000000000001;
|
||||
// s.SwizzleX = (raw3 >> 32) & 0b000000000000000000000111;
|
||||
// s.SwizzleY = (raw3 >> 32) & 0b000000000000000000000111;
|
||||
// s.SwizzleZ = (raw3 >> 32) & 0b000000000000000000000111;
|
||||
// s.SwizzleW = (raw3 >> 32) & 0b000000000000000000000111;
|
||||
// s.ExpAdjust = (raw3 >> 32) & 0b000000000000000000111111;
|
||||
// s.MagFilter = (raw3 >> 32) & 0b000000000000000000001111;
|
||||
// s.MinFilter = (raw3 >> 32) & 0b000000000000000000001111;
|
||||
// s.MipFilter = (raw3 >> 32) & 0b000000000000000000001111;
|
||||
// s.AnisoFilter = (raw3 >> 32) & 0b000000000000000000001111;
|
||||
// s.: 3;
|
||||
// s.BorderSize =
|
||||
// s.VolMagFilter =
|
||||
// s.VolMinFilter =
|
||||
// s.MinMipLevel =
|
||||
// s.MaxMipLevel =
|
||||
// s.MagAnisoWalk =
|
||||
// s.MinAnisoWalk =
|
||||
// s.LODBias =
|
||||
// s.GradExpAdjustH =
|
||||
// s.GradExpAdjustV =
|
||||
// s.BorderColor =
|
||||
// s.ForceBCWToMax =
|
||||
// s.TriClamp =
|
||||
// s.AnisoBias =
|
||||
// s.Dimension =
|
||||
// s.PackedMips =
|
||||
// s.MipAddress =
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// return in;
|
||||
// }
|
||||
|
||||
struct D3DBaseTexture : D3DResource
|
||||
{
|
||||
unsigned int MipFlush;
|
||||
GPUTEXTURE_FETCH_CONSTANT Format;
|
||||
};
|
||||
|
||||
struct D3DTexture : D3DBaseTexture
|
||||
{
|
||||
};
|
||||
|
||||
struct D3DVolumeTexture : D3DBaseTexture
|
||||
{
|
||||
};
|
||||
|
||||
struct D3DCubeTexture : D3DBaseTexture
|
||||
{
|
||||
};
|
||||
|
||||
struct WaterWritable
|
||||
{
|
||||
float floatTime;
|
||||
};
|
||||
|
||||
struct GfxImage;
|
||||
struct water_t
|
||||
{
|
||||
WaterWritable writable;
|
||||
float *H0X;
|
||||
float *H0Y;
|
||||
float *wTerm;
|
||||
int M;
|
||||
int N;
|
||||
float Lx;
|
||||
float Lz;
|
||||
float gravity;
|
||||
float windvel;
|
||||
float winddir[2];
|
||||
float amplitude;
|
||||
float codeConstant[4];
|
||||
GfxImage *image;
|
||||
};
|
||||
|
||||
union MaterialTextureDefInfo
|
||||
{
|
||||
GfxImage *image;
|
||||
water_t *water;
|
||||
};
|
||||
|
||||
struct MaterialTextureDef
|
||||
{
|
||||
unsigned int nameHash;
|
||||
char nameStart;
|
||||
char nameEnd;
|
||||
quint8 samplerState;
|
||||
quint8 semantic;
|
||||
MaterialTextureDefInfo u;
|
||||
};
|
||||
|
||||
struct MaterialConstantDef
|
||||
{
|
||||
unsigned int nameHash;
|
||||
char name[12];
|
||||
float literal[4];
|
||||
};
|
||||
|
||||
struct GfxStateBits
|
||||
{
|
||||
unsigned int loadBits[2];
|
||||
};
|
||||
|
||||
struct Material
|
||||
{
|
||||
MaterialInfo info;
|
||||
|
||||
quint8 stateBitsEntry[26];
|
||||
quint8 textureCount;
|
||||
quint8 constantCount;
|
||||
quint8 stateBitsCount;
|
||||
quint8 stateFlags;
|
||||
quint8 cameraRegion;
|
||||
|
||||
qint32 techSetPtr;
|
||||
MaterialTechSet *techniqueSet;
|
||||
|
||||
qint32 textureTablePtr;
|
||||
MaterialTextureDef *textureTable;
|
||||
|
||||
qint32 constantTablePtr;
|
||||
MaterialConstantDef *constantTable;
|
||||
|
||||
qint32 stateBitsTablePtr;
|
||||
GfxStateBits *stateBitsTable;
|
||||
};
|
||||
|
||||
#endif // MATERIAL_H
|
||||
@ -1 +0,0 @@
|
||||
#include "materialpixelshader.h"
|
||||
@ -1,34 +0,0 @@
|
||||
#ifndef MATERIAL_PIXERHSHADER_H
|
||||
#define MATERIAL_PIXERHSHADER_H
|
||||
|
||||
#include "xd3dresource.h"
|
||||
#include <QVector>
|
||||
#include <QtTypes>
|
||||
|
||||
struct GfxPixelShaderLoadDef
|
||||
{
|
||||
quint16 cachedPartPtr;
|
||||
QVector<quint8> cachedPart;
|
||||
quint16 physicalPartPtr;
|
||||
QVector<quint8> physicalPart;
|
||||
quint16 cachedPartSize;
|
||||
quint16 physicalPartSize;
|
||||
};
|
||||
|
||||
struct D3DPixelShader : D3DResource
|
||||
{
|
||||
};
|
||||
|
||||
union Material_PixelShaderProgram
|
||||
{
|
||||
D3DPixelShader *ps;
|
||||
GfxPixelShaderLoadDef loadDef;
|
||||
};
|
||||
|
||||
struct MaterialPixelShader
|
||||
{
|
||||
const char *name;
|
||||
Material_PixelShaderProgram prog;
|
||||
};
|
||||
|
||||
#endif // MATERIAL_PIXERHSHADER_H
|
||||
@ -1 +0,0 @@
|
||||
#include "scriptstringlist.h"
|
||||
@ -1,13 +0,0 @@
|
||||
#ifndef SCRIPTSTRINGLIST_H
|
||||
#define SCRIPTSTRINGLIST_H
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
struct ScriptStringList
|
||||
{
|
||||
int count;
|
||||
QVector<qint32> stringPtrs;
|
||||
QStringList scriptStrings;
|
||||
};
|
||||
|
||||
#endif // SCRIPTSTRINGLIST_H
|
||||
Loading…
x
Reference in New Issue
Block a user