Added a tonnn of new classes.
This commit is contained in:
parent
729a6bac7c
commit
0ea4a7ad6f
@ -6,7 +6,7 @@
|
|||||||
#include "material.h"
|
#include "material.h"
|
||||||
#include "materialpixelshader.h"
|
#include "materialpixelshader.h"
|
||||||
#include "materialtechset.h"
|
#include "materialtechset.h"
|
||||||
#include "gfximage.h"
|
#include "xgfximage.h"
|
||||||
#include "soundalias.h"
|
#include "soundalias.h"
|
||||||
#include "soundcurve.h"
|
#include "soundcurve.h"
|
||||||
#include "loadedsound.h"
|
#include "loadedsound.h"
|
||||||
@ -16,10 +16,10 @@
|
|||||||
#include "mapent.h"
|
#include "mapent.h"
|
||||||
#include "gfxworld.h"
|
#include "gfxworld.h"
|
||||||
#include "gfxlightdef.h"
|
#include "gfxlightdef.h"
|
||||||
#include "gfximage.h"
|
#include "xgfximage.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "menulist.h"
|
#include "xmenulist.h"
|
||||||
#include "menudef.h"
|
#include "xmenudef.h"
|
||||||
#include "xlocalizeentry.h"
|
#include "xlocalizeentry.h"
|
||||||
#include "weapondef.h"
|
#include "weapondef.h"
|
||||||
#include "xsounddriverglobals.h"
|
#include "xsounddriverglobals.h"
|
||||||
|
|||||||
@ -243,9 +243,9 @@ QVector<GfxStaticModelInst> Assets::Load_GfxStaticModelInstArray(QDataStream *aS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ?Load_ItemKeyHandler@@YAX_N@Z at 0x822a5f68
|
// ?Load_ItemKeyHandler@@YAX_N@Z at 0x822a5f68
|
||||||
ItemKeyHandler Assets::Load_ItemKeyHandler(QDataStream *aStream)
|
XItemKeyHandler Assets::Load_ItemKeyHandler(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
ItemKeyHandler result;
|
XItemKeyHandler result;
|
||||||
|
|
||||||
*aStream
|
*aStream
|
||||||
>> result.key
|
>> result.key
|
||||||
@ -265,18 +265,18 @@ ItemKeyHandler Assets::Load_ItemKeyHandler(QDataStream *aStream)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef ItemKeyHandler ItemKeyHandlerNext;
|
typedef XItemKeyHandler ItemKeyHandlerNext;
|
||||||
|
|
||||||
// ?Load_ItemKeyHandlerNext@@YAX_N@Z at 0x822a4aa0
|
// ?Load_ItemKeyHandlerNext@@YAX_N@Z at 0x822a4aa0
|
||||||
ItemKeyHandler Assets::Load_ItemKeyHandlerNext(QDataStream *aStream)
|
XItemKeyHandler Assets::Load_ItemKeyHandlerNext(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
return Load_ItemKeyHandler(aStream);
|
return Load_ItemKeyHandler(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?Load_EditFieldDef@@YAX_N@Z at 0x822a4af0
|
// ?Load_EditFieldDef@@YAX_N@Z at 0x822a4af0
|
||||||
EditFieldDef Assets::Load_EditFieldDef(QDataStream *aStream)
|
XEditFieldDef Assets::Load_EditFieldDef(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
EditFieldDef result;
|
XEditFieldDef result;
|
||||||
|
|
||||||
*aStream
|
*aStream
|
||||||
>> result.minVal
|
>> result.minVal
|
||||||
@ -2514,7 +2514,7 @@ XLocalizeEntry Assets::Load_LocalizeEntry(QDataStream *aStream)
|
|||||||
// ?Load_operandInternalDataUnion@@YAX_N@Z at 0x822a6058
|
// ?Load_operandInternalDataUnion@@YAX_N@Z at 0x822a6058
|
||||||
void Assets::Load_operandInternalDataUnion(QDataStream *aStream)
|
void Assets::Load_operandInternalDataUnion(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
Operand *varOperand = new Operand;
|
XOperand *varOperand = new XOperand;
|
||||||
QString varXString;
|
QString varXString;
|
||||||
if ( varOperand->dataType == VAL_STRING )
|
if ( varOperand->dataType == VAL_STRING )
|
||||||
{
|
{
|
||||||
@ -3572,9 +3572,9 @@ XLocalizeEntry Assets::Load_LocalizeEntryPtr(QDataStream *aStream)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ?Load_MultiDef@@YAX_N@Z at 0x822a78b8
|
// ?Load_MultiDef@@YAX_N@Z at 0x822a78b8
|
||||||
MultiDef Assets::Load_MultiDef(QDataStream *aStream)
|
XMultiDef Assets::Load_MultiDef(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
MultiDef result;
|
XMultiDef result;
|
||||||
|
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
*aStream >> result.dvarListPtrs[i];
|
*aStream >> result.dvarListPtrs[i];
|
||||||
@ -3606,9 +3606,9 @@ MultiDef Assets::Load_MultiDef(QDataStream *aStream)
|
|||||||
|
|
||||||
|
|
||||||
// ?Load_Operand@@YAX_N@Z at 0x822a7958
|
// ?Load_Operand@@YAX_N@Z at 0x822a7958
|
||||||
Operand Assets::Load_Operand(QDataStream *aStream)
|
XOperand Assets::Load_Operand(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
Operand result;
|
XOperand result;
|
||||||
|
|
||||||
*aStream >> result.dataType;
|
*aStream >> result.dataType;
|
||||||
|
|
||||||
@ -5597,7 +5597,7 @@ void Assets::Load_GfxReflectionProbeArray(QDataStream *aStream, int count)
|
|||||||
// ?Load_expressionEntry_ptrArray@@YAX_NH@Z at 0x822aa790
|
// ?Load_expressionEntry_ptrArray@@YAX_NH@Z at 0x822aa790
|
||||||
void Assets::Load_expressionEntry_ptrArray(QDataStream *aStream, int count)
|
void Assets::Load_expressionEntry_ptrArray(QDataStream *aStream, int count)
|
||||||
{
|
{
|
||||||
expressionEntry **v3; // r28
|
XExpressionEntry **v3; // r28
|
||||||
int v4; // r26
|
int v4; // r26
|
||||||
unsigned __int8 *v5; // r4
|
unsigned __int8 *v5; // r4
|
||||||
int type; // r10
|
int type; // r10
|
||||||
@ -5998,7 +5998,7 @@ void Assets::Load_GfxLightDefPtr(QDataStream *aStream)
|
|||||||
bool v2; // cr58
|
bool v2; // cr58
|
||||||
unsigned __int8 *v3; // r11
|
unsigned __int8 *v3; // r11
|
||||||
const void **inserted; // r30
|
const void **inserted; // r30
|
||||||
GfxLightDef **v5; // r31
|
XGfxLightDef **v5; // r31
|
||||||
XAssetHeader *v6; // r5
|
XAssetHeader *v6; // r5
|
||||||
|
|
||||||
Load_Stream(0, varGfxLightDefPtr, 4u);
|
Load_Stream(0, varGfxLightDefPtr, 4u);
|
||||||
@ -7153,8 +7153,8 @@ void Assets::Load_itemDef_t(QDataStream *aStream)
|
|||||||
{
|
{
|
||||||
v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC);
|
v2 = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC);
|
||||||
g_streamPos = v2;
|
g_streamPos = v2;
|
||||||
varitemDef_t->onKey = (ItemKeyHandler *)v2;
|
varitemDef_t->onKey = (XItemKeyHandler *)v2;
|
||||||
varItemKeyHandler = (ItemKeyHandler *)v2;
|
varItemKeyHandler = (XItemKeyHandler *)v2;
|
||||||
Load_ItemKeyHandler(1);
|
Load_ItemKeyHandler(1);
|
||||||
v1 = varitemDef_t;
|
v1 = varitemDef_t;
|
||||||
}
|
}
|
||||||
@ -7976,8 +7976,8 @@ void Assets::Load_menuDef_t(QDataStream *aStream)
|
|||||||
if ( varmenuDef_t->onKey )
|
if ( varmenuDef_t->onKey )
|
||||||
{
|
{
|
||||||
g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC);
|
g_streamPos = (unsigned __int8 *)((unsigned int)(g_streamPos + 3) & 0xFFFFFFFC);
|
||||||
varItemKeyHandler = (ItemKeyHandler *)g_streamPos;
|
varItemKeyHandler = (XItemKeyHandler *)g_streamPos;
|
||||||
varmenuDef_t->onKey = (ItemKeyHandler *)g_streamPos;
|
varmenuDef_t->onKey = (XItemKeyHandler *)g_streamPos;
|
||||||
Load_ItemKeyHandler(1);
|
Load_ItemKeyHandler(1);
|
||||||
v1 = varmenuDef_t;
|
v1 = varmenuDef_t;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1352,16 +1352,16 @@ struct SunLightParseParams
|
|||||||
float angles[3];
|
float angles[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct __declspec(align(4)) GfxLightImage
|
struct __declspec(align(4)) XGfxLightImage
|
||||||
{
|
{
|
||||||
GfxImage *image;
|
GfxImage *image;
|
||||||
quint8 samplerState;
|
quint8 samplerState;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GfxLightDef
|
struct XGfxLightDef
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
GfxLightImage attenuation;
|
XGfxLightImage attenuation;
|
||||||
int lmapLookupStart;
|
int lmapLookupStart;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1378,7 +1378,7 @@ struct GfxLight
|
|||||||
float cosHalfFovInner;
|
float cosHalfFovInner;
|
||||||
int exponent;
|
int exponent;
|
||||||
uint spotShadowIndex;
|
uint spotShadowIndex;
|
||||||
GfxLightDef *def;
|
XGfxLightDef *def;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GfxReflectionProbe
|
struct GfxReflectionProbe
|
||||||
@ -1786,7 +1786,7 @@ struct Font_s
|
|||||||
Glyph *glyphs;
|
Glyph *glyphs;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rectDef_s
|
struct XRectDef
|
||||||
{
|
{
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
@ -1796,11 +1796,11 @@ struct rectDef_s
|
|||||||
int vertAlign;
|
int vertAlign;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct windowDef_t
|
struct XWindowDef
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
rectDef_s rect;
|
XRectDef rect;
|
||||||
rectDef_s rectClient;
|
XRectDef rectClient;
|
||||||
const char *group;
|
const char *group;
|
||||||
int style;
|
int style;
|
||||||
int border;
|
int border;
|
||||||
@ -1817,13 +1817,13 @@ struct windowDef_t
|
|||||||
Material *background;
|
Material *background;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ItemKeyHandler
|
struct XItemKeyHandler
|
||||||
{
|
{
|
||||||
int key;
|
int key;
|
||||||
qint32 actionPtr;
|
qint32 actionPtr;
|
||||||
QString action;
|
QString action;
|
||||||
qint32 nextPtr;
|
qint32 nextPtr;
|
||||||
ItemKeyHandler *next;
|
XItemKeyHandler *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OperationEnum : qint32
|
enum OperationEnum : qint32
|
||||||
@ -1912,16 +1912,16 @@ enum OperationEnum : qint32
|
|||||||
NUM_OPERATORS = 0x50,
|
NUM_OPERATORS = 0x50,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum expDataType : __int32
|
enum XExpDataType : __int32
|
||||||
{
|
{
|
||||||
VAL_INT = 0x0,
|
VAL_INT = 0x0,
|
||||||
VAL_FLOAT = 0x1,
|
VAL_FLOAT = 0x1,
|
||||||
VAL_STRING = 0x2,
|
VAL_STRING = 0x2,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Operand
|
struct XOperand
|
||||||
{
|
{
|
||||||
expDataType dataType;
|
XExpDataType dataType;
|
||||||
int intVal;
|
int intVal;
|
||||||
float floatVal;
|
float floatVal;
|
||||||
QString stringVal;
|
QString stringVal;
|
||||||
@ -1930,26 +1930,26 @@ struct Operand
|
|||||||
union entryInternalData
|
union entryInternalData
|
||||||
{
|
{
|
||||||
OperationEnum op;
|
OperationEnum op;
|
||||||
Operand operand;
|
XOperand operand;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct expressionEntry
|
struct XExpressionEntry
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
entryInternalData data;
|
entryInternalData data;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct statement_s
|
struct XStatement
|
||||||
{
|
{
|
||||||
int numEntries;
|
int numEntries;
|
||||||
expressionEntry **entries;
|
XExpressionEntry **entries;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ItemDef;
|
struct ItemDef;
|
||||||
|
|
||||||
struct menuDef_t
|
struct menuDef_t
|
||||||
{
|
{
|
||||||
windowDef_t window;
|
XWindowDef window;
|
||||||
const char *font;
|
const char *font;
|
||||||
int fullScreen;
|
int fullScreen;
|
||||||
int itemCount;
|
int itemCount;
|
||||||
@ -1963,19 +1963,19 @@ struct menuDef_t
|
|||||||
const char *onOpen;
|
const char *onOpen;
|
||||||
const char *onClose;
|
const char *onClose;
|
||||||
const char *onESC;
|
const char *onESC;
|
||||||
ItemKeyHandler *onKey;
|
XItemKeyHandler *onKey;
|
||||||
statement_s visibleExp;
|
XStatement visibleExp;
|
||||||
const char *allowedBinding;
|
const char *allowedBinding;
|
||||||
const char *soundName;
|
const char *soundName;
|
||||||
int imageTrack;
|
int imageTrack;
|
||||||
float focusColor[4];
|
float focusColor[4];
|
||||||
float disableColor[4];
|
float disableColor[4];
|
||||||
statement_s rectXExp;
|
XStatement rectXExp;
|
||||||
statement_s rectYExp;
|
XStatement rectYExp;
|
||||||
ItemDef **items;
|
ItemDef **items;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct columnInfo_s
|
struct XColumnInfo
|
||||||
{
|
{
|
||||||
int pos;
|
int pos;
|
||||||
int width;
|
int width;
|
||||||
@ -1983,7 +1983,7 @@ struct columnInfo_s
|
|||||||
int alignment;
|
int alignment;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct listBoxDef_s
|
struct XListBoxDef
|
||||||
{
|
{
|
||||||
int startPos[4];
|
int startPos[4];
|
||||||
int endPos[4];
|
int endPos[4];
|
||||||
@ -1992,7 +1992,7 @@ struct listBoxDef_s
|
|||||||
float elementHeight;
|
float elementHeight;
|
||||||
int elementStyle;
|
int elementStyle;
|
||||||
int numColumns;
|
int numColumns;
|
||||||
columnInfo_s columnInfo[16];
|
XColumnInfo columnInfo[16];
|
||||||
const char *doubleClick;
|
const char *doubleClick;
|
||||||
int notselectable;
|
int notselectable;
|
||||||
int noScrollBars;
|
int noScrollBars;
|
||||||
@ -2002,7 +2002,7 @@ struct listBoxDef_s
|
|||||||
Material *selectIcon;
|
Material *selectIcon;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EditFieldDef
|
struct XEditFieldDef
|
||||||
{
|
{
|
||||||
float minVal;
|
float minVal;
|
||||||
float maxVal;
|
float maxVal;
|
||||||
@ -2014,7 +2014,7 @@ struct EditFieldDef
|
|||||||
int paintOffset;
|
int paintOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MultiDef
|
struct XMultiDef
|
||||||
{
|
{
|
||||||
QVector<qint32> dvarListPtrs;
|
QVector<qint32> dvarListPtrs;
|
||||||
QStringList dvarList;
|
QStringList dvarList;
|
||||||
@ -2025,19 +2025,19 @@ struct MultiDef
|
|||||||
int strDef;
|
int strDef;
|
||||||
};
|
};
|
||||||
|
|
||||||
union ItemDefData
|
union XItemDefData
|
||||||
{
|
{
|
||||||
listBoxDef_s *listBox;
|
XListBoxDef *listBox;
|
||||||
EditFieldDef *editField;
|
XEditFieldDef *editField;
|
||||||
MultiDef *multi;
|
XMultiDef *multi;
|
||||||
const char *enumDvarName;
|
const char *enumDvarName;
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ItemDef
|
struct ItemDef
|
||||||
{
|
{
|
||||||
windowDef_t window;
|
XWindowDef window;
|
||||||
rectDef_s textRect[4];
|
XRectDef textRect[4];
|
||||||
int type;
|
int type;
|
||||||
int dataType;
|
int dataType;
|
||||||
int alignment;
|
int alignment;
|
||||||
@ -2062,22 +2062,22 @@ struct ItemDef
|
|||||||
const char *leaveFocus;
|
const char *leaveFocus;
|
||||||
const char *dvar;
|
const char *dvar;
|
||||||
const char *dvarTest;
|
const char *dvarTest;
|
||||||
ItemKeyHandler *onKey;
|
XItemKeyHandler *onKey;
|
||||||
const char *enableDvar;
|
const char *enableDvar;
|
||||||
int dvarFlags;
|
int dvarFlags;
|
||||||
SoundAliasList *focusSound;
|
SoundAliasList *focusSound;
|
||||||
float special;
|
float special;
|
||||||
int cursorPos[4];
|
int cursorPos[4];
|
||||||
ItemDefData typeData;
|
XItemDefData typeData;
|
||||||
int imageTrack;
|
int imageTrack;
|
||||||
statement_s visibleExp;
|
XStatement visibleExp;
|
||||||
statement_s textExp;
|
XStatement textExp;
|
||||||
statement_s materialExp;
|
XStatement materialExp;
|
||||||
statement_s rectXExp;
|
XStatement rectXExp;
|
||||||
statement_s rectYExp;
|
XStatement rectYExp;
|
||||||
statement_s rectWExp;
|
XStatement rectWExp;
|
||||||
statement_s rectHExp;
|
XStatement rectHExp;
|
||||||
statement_s forecolorAExp;
|
XStatement forecolorAExp;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MenuList
|
struct MenuList
|
||||||
@ -2911,7 +2911,7 @@ union XAssetHeader
|
|||||||
GameWorldMp *gameWorldMp;
|
GameWorldMp *gameWorldMp;
|
||||||
MapEnts *mapEnts;
|
MapEnts *mapEnts;
|
||||||
GfxWorld *gfxWorld;
|
GfxWorld *gfxWorld;
|
||||||
GfxLightDef *lightDef;
|
XGfxLightDef *lightDef;
|
||||||
Font_s *font;
|
Font_s *font;
|
||||||
MenuList *menuList;
|
MenuList *menuList;
|
||||||
menuDef_t *menu;
|
menuDef_t *menu;
|
||||||
@ -2951,9 +2951,9 @@ private:
|
|||||||
QVector<GfxCullGroup> Load_GfxCullGroupArray(QDataStream *aStream, int count);
|
QVector<GfxCullGroup> Load_GfxCullGroupArray(QDataStream *aStream, int count);
|
||||||
QVector<quint16> Load_StaticModelIndexArray(QDataStream *aStream, int count);
|
QVector<quint16> Load_StaticModelIndexArray(QDataStream *aStream, int count);
|
||||||
QVector<GfxStaticModelInst> Load_GfxStaticModelInstArray(QDataStream *aStream, int count);
|
QVector<GfxStaticModelInst> Load_GfxStaticModelInstArray(QDataStream *aStream, int count);
|
||||||
ItemKeyHandler Load_ItemKeyHandler(QDataStream *aStream);
|
XItemKeyHandler Load_ItemKeyHandler(QDataStream *aStream);
|
||||||
ItemKeyHandler Load_ItemKeyHandlerNext(QDataStream *aStream);
|
XItemKeyHandler Load_ItemKeyHandlerNext(QDataStream *aStream);
|
||||||
EditFieldDef Load_EditFieldDef(QDataStream *aStream);
|
XEditFieldDef Load_EditFieldDef(QDataStream *aStream);
|
||||||
OperationEnum Load_Operator(QDataStream *aStream);
|
OperationEnum Load_Operator(QDataStream *aStream);
|
||||||
QVector<quint16> Load_LeafBrushArray(QDataStream *aStream, int count);
|
QVector<quint16> Load_LeafBrushArray(QDataStream *aStream, int count);
|
||||||
CLeaf Load_CLeaf(QDataStream *aStream);
|
CLeaf Load_CLeaf(QDataStream *aStream);
|
||||||
@ -3090,8 +3090,8 @@ private:
|
|||||||
StringTable Load_StringTable(QDataStream *aStream);
|
StringTable Load_StringTable(QDataStream *aStream);
|
||||||
RawFile Load_RawFilePtr(QDataStream *aStream);
|
RawFile Load_RawFilePtr(QDataStream *aStream);
|
||||||
void Load_LocalizeEntryPtr(QDataStream *aStream);
|
void Load_LocalizeEntryPtr(QDataStream *aStream);
|
||||||
MultiDef Load_MultiDef(QDataStream *aStream);
|
XMultiDef Load_MultiDef(QDataStream *aStream);
|
||||||
Operand Load_Operand(QDataStream *aStream);
|
XOperand Load_Operand(QDataStream *aStream);
|
||||||
QVector<XComPrimaryLight> Load_ComPrimaryLightArray(QDataStream *aStream, int count);
|
QVector<XComPrimaryLight> Load_ComPrimaryLightArray(QDataStream *aStream, int count);
|
||||||
CBrushSide Load_cbrushside_t(QDataStream *aStream);
|
CBrushSide Load_cbrushside_t(QDataStream *aStream);
|
||||||
CBrush Load_CBrush(QDataStream *aStream);
|
CBrush Load_CBrush(QDataStream *aStream);
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
#include "d3dresource.h"
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
#ifndef D3DRESOURCE_H
|
|
||||||
#define D3DRESOURCE_H
|
|
||||||
|
|
||||||
struct D3DResource
|
|
||||||
{
|
|
||||||
unsigned int Common;
|
|
||||||
unsigned int ReferenceCount;
|
|
||||||
unsigned int Fence;
|
|
||||||
unsigned int ReadFence;
|
|
||||||
unsigned int Identifier;
|
|
||||||
unsigned int BaseFlush;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // D3DRESOURCE_H
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef FONT_H
|
#ifndef FONT_H
|
||||||
#define FONT_H
|
#define FONT_H
|
||||||
|
|
||||||
#include "material.h"
|
#include "xmaterial.h"
|
||||||
|
|
||||||
struct Glyph
|
struct Glyph
|
||||||
{
|
{
|
||||||
@ -22,9 +22,9 @@ struct GameFont
|
|||||||
const char *fontName;
|
const char *fontName;
|
||||||
int pixelHeight;
|
int pixelHeight;
|
||||||
int glyphCount;
|
int glyphCount;
|
||||||
Material *material;
|
XMaterial *material;
|
||||||
Material *glowMaterial;
|
XMaterial *glowMaterial;
|
||||||
Glyph *glyphs;
|
XGlyph *glyphs;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FONT_H
|
#endif // FONT_H
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
#include "gameworld.h"
|
|
||||||
@ -1,144 +0,0 @@
|
|||||||
#ifndef GAMEWORLD_H
|
|
||||||
#define GAMEWORLD_H
|
|
||||||
|
|
||||||
enum nodeType : __int32
|
|
||||||
{
|
|
||||||
NODE_BADNODE = 0x0,
|
|
||||||
NODE_PATHNODE = 0x1,
|
|
||||||
NODE_COVER_STAND = 0x2,
|
|
||||||
NODE_COVER_CROUCH = 0x3,
|
|
||||||
NODE_COVER_CROUCH_WINDOW = 0x4,
|
|
||||||
NODE_COVER_PRONE = 0x5,
|
|
||||||
NODE_COVER_RIGHT = 0x6,
|
|
||||||
NODE_COVER_LEFT = 0x7,
|
|
||||||
NODE_COVER_WIDE_RIGHT = 0x8,
|
|
||||||
NODE_COVER_WIDE_LEFT = 0x9,
|
|
||||||
NODE_CONCEALMENT_STAND = 0xA,
|
|
||||||
NODE_CONCEALMENT_CROUCH = 0xB,
|
|
||||||
NODE_CONCEALMENT_PRONE = 0xC,
|
|
||||||
NODE_REACQUIRE = 0xD,
|
|
||||||
NODE_BALCONY = 0xE,
|
|
||||||
NODE_SCRIPTED = 0xF,
|
|
||||||
NODE_NEGOTIATION_BEGIN = 0x10,
|
|
||||||
NODE_NEGOTIATION_END = 0x11,
|
|
||||||
NODE_TURRET = 0x12,
|
|
||||||
NODE_GUARD = 0x13,
|
|
||||||
NODE_NUMTYPES = 0x14,
|
|
||||||
NODE_DONTLINK = 0x14,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PathLink
|
|
||||||
{
|
|
||||||
float fDist;
|
|
||||||
unsigned __int16 nodeNum;
|
|
||||||
unsigned __int8 disconnectCount;
|
|
||||||
unsigned __int8 negotiationLink;
|
|
||||||
unsigned __int8 ubBadPlaceCount[4];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PathNodeConstant
|
|
||||||
{
|
|
||||||
nodeType type;
|
|
||||||
unsigned __int16 spawnflags;
|
|
||||||
unsigned __int16 targetname;
|
|
||||||
unsigned __int16 script_linkName;
|
|
||||||
unsigned __int16 script_noteworthy;
|
|
||||||
unsigned __int16 target;
|
|
||||||
unsigned __int16 animscript;
|
|
||||||
int animscriptfunc;
|
|
||||||
float vOrigin[3];
|
|
||||||
float fAngle;
|
|
||||||
float forward[2];
|
|
||||||
float fRadius;
|
|
||||||
float minUseDistSq;
|
|
||||||
__int16 wOverlapNode[2];
|
|
||||||
__int16 wChainId;
|
|
||||||
__int16 wChainDepth;
|
|
||||||
__int16 wChainParent;
|
|
||||||
unsigned __int16 totalLinkCount;
|
|
||||||
PathLink *Links;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct pathnode_dynamic_t
|
|
||||||
{
|
|
||||||
void *pOwner;
|
|
||||||
int iFreeTime;
|
|
||||||
int iValidTime[3];
|
|
||||||
int inPlayerLOSTime;
|
|
||||||
__int16 wLinkCount;
|
|
||||||
__int16 wOverlapCount;
|
|
||||||
__int16 turretEntNumber;
|
|
||||||
__int16 userCount;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct pathnode_t;
|
|
||||||
struct pathnode_transient_t
|
|
||||||
{
|
|
||||||
int iSearchFrame;
|
|
||||||
pathnode_t *pNextOpen;
|
|
||||||
pathnode_t *pPrevOpen;
|
|
||||||
pathnode_t *pParent;
|
|
||||||
float fCost;
|
|
||||||
float fHeuristic;
|
|
||||||
float costFactor;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct pathnode_t
|
|
||||||
{
|
|
||||||
PathNodeConstant constant;
|
|
||||||
pathnode_dynamic_t dynamic;
|
|
||||||
pathnode_transient_t transient;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PathBaseNode
|
|
||||||
{
|
|
||||||
float vOrigin[3];
|
|
||||||
unsigned int type;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PathNodeTreeNodes
|
|
||||||
{
|
|
||||||
int nodeCount;
|
|
||||||
unsigned __int16 *nodes;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PathNodeTree;
|
|
||||||
union PathNodeTreeInfo
|
|
||||||
{
|
|
||||||
PathNodeTree *child[2];
|
|
||||||
PathNodeTreeNodes s;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PathNodeTree
|
|
||||||
{
|
|
||||||
int axis;
|
|
||||||
float dist;
|
|
||||||
PathNodeTreeInfo u;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PathData
|
|
||||||
{
|
|
||||||
unsigned int nodeCount;
|
|
||||||
pathnode_t *nodes;
|
|
||||||
PathBaseNode *basenodes;
|
|
||||||
unsigned int chainNodeCount;
|
|
||||||
unsigned __int16 *chainNodeForNode;
|
|
||||||
unsigned __int16 *nodeForChainNode;
|
|
||||||
int visBytes;
|
|
||||||
unsigned __int8 *pathVis;
|
|
||||||
int nodeTreeCount;
|
|
||||||
PathNodeTree *nodeTree;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct GameWorldSp
|
|
||||||
{
|
|
||||||
const char *name;
|
|
||||||
PathData path;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct GameWorldMp
|
|
||||||
{
|
|
||||||
const char *name;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // GAMEWORLD_H
|
|
||||||
@ -1 +0,0 @@
|
|||||||
#include "gfximage.h"
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
#ifndef GFXIMAGE_H
|
|
||||||
#define GFXIMAGE_H
|
|
||||||
|
|
||||||
#include "material.h"
|
|
||||||
|
|
||||||
struct GfxImageLoadDef;
|
|
||||||
struct GfxTexture
|
|
||||||
{
|
|
||||||
qint32 baseMapPtr;
|
|
||||||
D3DBaseTexture *baseMap;
|
|
||||||
|
|
||||||
qint32 mapPtr;
|
|
||||||
D3DTexture *map;
|
|
||||||
|
|
||||||
qint32 volMapPtr;
|
|
||||||
D3DVolumeTexture *volMap;
|
|
||||||
|
|
||||||
qint32 cubeMapPtr;
|
|
||||||
D3DCubeTexture *cubeMap;
|
|
||||||
|
|
||||||
qint32 loadDefPtr;
|
|
||||||
GfxImageLoadDef *loadDef;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct GfxImageLoadDef
|
|
||||||
{
|
|
||||||
quint8 levelCount;
|
|
||||||
quint8 flags;
|
|
||||||
quint16 dimensions[3];
|
|
||||||
int format;
|
|
||||||
GfxTexture texture;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CardMemory
|
|
||||||
{
|
|
||||||
int platform[1];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct GfxImage
|
|
||||||
{
|
|
||||||
MapType mapType;
|
|
||||||
GfxTexture texture;
|
|
||||||
quint8 semantic;
|
|
||||||
CardMemory cardMemory;
|
|
||||||
quint16 width;
|
|
||||||
quint16 height;
|
|
||||||
quint16 depth;
|
|
||||||
quint8 category;
|
|
||||||
bool delayLoadPixels;
|
|
||||||
|
|
||||||
qint32 pixelsPtr;
|
|
||||||
quint8 *pixels;
|
|
||||||
|
|
||||||
unsigned int baseSize;
|
|
||||||
quint16 streamSlot;
|
|
||||||
bool streaming;
|
|
||||||
|
|
||||||
qint32 namePtr;
|
|
||||||
QString name;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // GFXIMAGE_H
|
|
||||||
@ -1 +0,0 @@
|
|||||||
#include "gfxlightdef.h"
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
#ifndef GFXLIGHTDEF_H
|
|
||||||
#define GFXLIGHTDEF_H
|
|
||||||
#include "gfximage.h"
|
|
||||||
|
|
||||||
struct GfxLightImage
|
|
||||||
{
|
|
||||||
GfxImage *image;
|
|
||||||
unsigned __int8 samplerState;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct GfxLightDef
|
|
||||||
{
|
|
||||||
const char *name;
|
|
||||||
GfxLightImage attenuation;
|
|
||||||
int lmapLookupStart;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // GFXLIGHTDEF_H
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef GFXWORLD_H
|
#ifndef GFXWORLD_H
|
||||||
#define GFXWORLD_H
|
#define GFXWORLD_H
|
||||||
|
|
||||||
#include "gfximage.h"
|
#include "xgfximage.h"
|
||||||
#include "gfxlightdef.h"
|
#include "gfxlightdef.h"
|
||||||
#include "xmodel.h"
|
#include "xmodel.h"
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ struct GfxLight
|
|||||||
float cosHalfFovInner;
|
float cosHalfFovInner;
|
||||||
int exponent;
|
int exponent;
|
||||||
unsigned int spotShadowIndex;
|
unsigned int spotShadowIndex;
|
||||||
GfxLightDef *def;
|
XGfxLightDef *def;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GfxReflectionProbe
|
struct GfxReflectionProbe
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
#include "loadedsound.h"
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
#ifndef LOADEDSOUND_H
|
|
||||||
#define LOADEDSOUND_H
|
|
||||||
|
|
||||||
struct XMALOOPREGION
|
|
||||||
{
|
|
||||||
unsigned int LoopStart;
|
|
||||||
unsigned int LoopEnd;
|
|
||||||
unsigned __int8 LoopSubframeEnd;
|
|
||||||
unsigned __int8 LoopSubframeSkip;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct XAUDIOPACKET_ALIGNED
|
|
||||||
{
|
|
||||||
char *pBuffer;
|
|
||||||
unsigned int BufferSize;
|
|
||||||
unsigned int LoopCount;
|
|
||||||
XMALOOPREGION XMALoop[6];
|
|
||||||
char *pContext;
|
|
||||||
};
|
|
||||||
|
|
||||||
union $A914CD29B804E77ACE08D070A31DB5AB
|
|
||||||
{
|
|
||||||
unsigned __int8 NumStreams;
|
|
||||||
unsigned __int8 ChannelCount;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct XAUDIOXMAFORMAT
|
|
||||||
{
|
|
||||||
unsigned int SampleRate;
|
|
||||||
unsigned __int8 ChannelCount;
|
|
||||||
unsigned __int8 DecodeBufferSize;
|
|
||||||
};
|
|
||||||
|
|
||||||
union $9C5A25260C9CC66355FE8A35CC8403E0
|
|
||||||
{
|
|
||||||
XAUDIOXMAFORMAT Stream[6];
|
|
||||||
unsigned int SampleRate;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct XAUDIOSOURCEFORMAT
|
|
||||||
{
|
|
||||||
unsigned __int8 SampleType;
|
|
||||||
$A914CD29B804E77ACE08D070A31DB5AB ___u1;
|
|
||||||
$9C5A25260C9CC66355FE8A35CC8403E0 ___u2;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct XaIwXmaDataInfo
|
|
||||||
{
|
|
||||||
int totalMsec;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct XaSeekTable
|
|
||||||
{
|
|
||||||
int size;
|
|
||||||
unsigned int *data;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct XaSound
|
|
||||||
{
|
|
||||||
XAUDIOPACKET_ALIGNED packet;
|
|
||||||
XAUDIOSOURCEFORMAT format;
|
|
||||||
XaIwXmaDataInfo xaIwXmaDataInfo;
|
|
||||||
XaSeekTable seekTable;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct LoadedSound
|
|
||||||
{
|
|
||||||
const char *name;
|
|
||||||
XaSound sound;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LOADEDSOUND_H
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef MATERIAL_PIXERHSHADER_H
|
#ifndef MATERIAL_PIXERHSHADER_H
|
||||||
#define MATERIAL_PIXERHSHADER_H
|
#define MATERIAL_PIXERHSHADER_H
|
||||||
|
|
||||||
#include "d3dresource.h"
|
#include "xd3dresource.h"
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QtTypes>
|
#include <QtTypes>
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef MATERIALTECHSET_H
|
#ifndef MATERIALTECHSET_H
|
||||||
#define MATERIALTECHSET_H
|
#define MATERIALTECHSET_H
|
||||||
|
|
||||||
#include "d3dresource.h"
|
#include "xd3dresource.h"
|
||||||
#include "materialpixelshader.h"
|
#include "materialpixelshader.h"
|
||||||
|
|
||||||
#include "QString"
|
#include "QString"
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
#include "menudef.h"
|
|
||||||
@ -1 +0,0 @@
|
|||||||
#include "menulist.h"
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
#ifndef MENULIST_H
|
|
||||||
#define MENULIST_H
|
|
||||||
|
|
||||||
#include "menudef.h"
|
|
||||||
|
|
||||||
struct MenuList
|
|
||||||
{
|
|
||||||
const char *name;
|
|
||||||
int menuCount;
|
|
||||||
MenuDef **menus;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // MENULIST_H
|
|
||||||
58
libs/xassets/xanimdeltapart.cpp
Normal file
58
libs/xassets/xanimdeltapart.cpp
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimdeltapart.h"
|
||||||
|
|
||||||
|
XAnimDeltaPart::XAnimDeltaPart()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPart::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mTransPtr, sizeof(quint32));
|
||||||
|
mTrans.ParseData(aStream);
|
||||||
|
|
||||||
|
aStream->read((char*)&mQuatPtr, sizeof(quint32));
|
||||||
|
mQuat.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimDeltaPart::GetTransPtr() const {
|
||||||
|
return mTransPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPart::SetTransPtr(quint32 ptr) {
|
||||||
|
mTransPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimPartTrans& XAnimDeltaPart::GetTrans() const {
|
||||||
|
return mTrans;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPart::SetTrans(const XAnimPartTrans& trans) {
|
||||||
|
mTrans = trans;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimDeltaPart::GetQuatPtr() const {
|
||||||
|
return mQuatPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPart::SetQuatPtr(quint32 ptr) {
|
||||||
|
mQuatPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimDeltaPartQuat& XAnimDeltaPart::GetQuat() const {
|
||||||
|
return mQuat;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPart::SetQuat(const XAnimDeltaPartQuat& quat) {
|
||||||
|
mQuat = quat;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
46
libs/xassets/xanimdeltapart.h
Normal file
46
libs/xassets/xanimdeltapart.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMDELTAPART_H
|
||||||
|
#define XANIMDELTAPART_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xanimparttrans.h"
|
||||||
|
#include "xanimdeltapartquat.h"
|
||||||
|
|
||||||
|
class XAnimDeltaPart : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimDeltaPart();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint32 GetTransPtr() const;
|
||||||
|
void SetTransPtr(quint32 ptr);
|
||||||
|
|
||||||
|
const XAnimPartTrans& GetTrans() const;
|
||||||
|
void SetTrans(const XAnimPartTrans& trans);
|
||||||
|
|
||||||
|
quint32 GetQuatPtr() const;
|
||||||
|
void SetQuatPtr(quint32 ptr);
|
||||||
|
|
||||||
|
const XAnimDeltaPartQuat& GetQuat() const;
|
||||||
|
void SetQuat(const XAnimDeltaPartQuat& quat);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint32 mTransPtr = 0;
|
||||||
|
XAnimPartTrans mTrans;
|
||||||
|
|
||||||
|
quint32 mQuatPtr = 0;
|
||||||
|
XAnimDeltaPartQuat mQuat;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMDELTAPART_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
39
libs/xassets/xanimdeltapartquat.cpp
Normal file
39
libs/xassets/xanimdeltapartquat.cpp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimdeltapartquat.h"
|
||||||
|
|
||||||
|
XAnimDeltaPartQuat::XAnimDeltaPartQuat()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuat::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mSize, sizeof(quint16));
|
||||||
|
|
||||||
|
// Parse data
|
||||||
|
mData.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimDeltaPartQuat::GetSize() const {
|
||||||
|
return mSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuat::SetSize(quint16 size) {
|
||||||
|
mSize = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimDeltaPartQuatData& XAnimDeltaPartQuat::GetData() const {
|
||||||
|
return mData;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuat::SetData(const XAnimDeltaPartQuatData& data) {
|
||||||
|
mData = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
36
libs/xassets/xanimdeltapartquat.h
Normal file
36
libs/xassets/xanimdeltapartquat.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMDELTAPARTQUAT_H
|
||||||
|
#define XANIMDELTAPARTQUAT_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xanimdeltapartquatdata.h"
|
||||||
|
|
||||||
|
class XAnimDeltaPartQuat : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimDeltaPartQuat();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint16 GetSize() const;
|
||||||
|
void SetSize(quint16 size);
|
||||||
|
|
||||||
|
const XAnimDeltaPartQuatData& GetData() const;
|
||||||
|
void SetData(const XAnimDeltaPartQuatData& data);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint16 mSize = 0;
|
||||||
|
XAnimDeltaPartQuatData mData;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMDELTAPARTQUAT_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
43
libs/xassets/xanimdeltapartquatdata.cpp
Normal file
43
libs/xassets/xanimdeltapartquatdata.cpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimdeltapartquatdata.h"
|
||||||
|
|
||||||
|
XAnimDeltaPartQuatData::XAnimDeltaPartQuatData()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuatData::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
// Parse frames
|
||||||
|
mFrames.ParseData(aStream);
|
||||||
|
|
||||||
|
// Parse frame0
|
||||||
|
aStream->read((char*)mFrame0, 2 * sizeof(qint16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimDeltaPartQuatDataFrames& XAnimDeltaPartQuatData::GetFrames() const {
|
||||||
|
return mFrames;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuatData::SetFrames(const XAnimDeltaPartQuatDataFrames& frames) {
|
||||||
|
mFrames = frames;
|
||||||
|
}
|
||||||
|
|
||||||
|
const qint16* XAnimDeltaPartQuatData::GetFrame0() const {
|
||||||
|
return mFrame0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuatData::SetFrame0(const qint16* frame0, size_t count) {
|
||||||
|
if (count <= 2) {
|
||||||
|
memcpy(mFrame0, frame0, count * sizeof(qint16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
36
libs/xassets/xanimdeltapartquatdata.h
Normal file
36
libs/xassets/xanimdeltapartquatdata.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMDELTAPARTQUATDATA_H
|
||||||
|
#define XANIMDELTAPARTQUATDATA_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xanimdeltapartquatdataframes.h"
|
||||||
|
|
||||||
|
class XAnimDeltaPartQuatData : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimDeltaPartQuatData();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const XAnimDeltaPartQuatDataFrames& GetFrames() const;
|
||||||
|
void SetFrames(const XAnimDeltaPartQuatDataFrames& frames);
|
||||||
|
|
||||||
|
const qint16* GetFrame0() const;
|
||||||
|
void SetFrame0(const qint16* frame0, size_t count = 2);
|
||||||
|
|
||||||
|
private:
|
||||||
|
XAnimDeltaPartQuatDataFrames mFrames;
|
||||||
|
qint16 mFrame0[2] = {0};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMDELTAPARTQUATDATA_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
55
libs/xassets/xanimdeltapartquatdataframes.cpp
Normal file
55
libs/xassets/xanimdeltapartquatdataframes.cpp
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimdeltapartquatdataframes.h"
|
||||||
|
|
||||||
|
XAnimDeltaPartQuatDataFrames::XAnimDeltaPartQuatDataFrames()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuatDataFrames::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mFramesPtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)mFrames, 2 * sizeof(qint16));
|
||||||
|
|
||||||
|
// Parse indices
|
||||||
|
mIndices.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimDeltaPartQuatDataFrames::GetFramesPtr() const {
|
||||||
|
return mFramesPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuatDataFrames::SetFramesPtr(quint32 ptr) {
|
||||||
|
mFramesPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
const qint16* XAnimDeltaPartQuatDataFrames::GetFrames() const {
|
||||||
|
return mFrames;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuatDataFrames::SetFrames(const qint16* frames, size_t count) {
|
||||||
|
if (count <= 2) {
|
||||||
|
memcpy(mFrames, frames, count * sizeof(qint16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
XAnimDynamicIndices& XAnimDeltaPartQuatDataFrames::GetIndices() {
|
||||||
|
return mIndices;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimDynamicIndices& XAnimDeltaPartQuatDataFrames::GetIndices() const {
|
||||||
|
return mIndices;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDeltaPartQuatDataFrames::SetIndices(const XAnimDynamicIndices& indices) {
|
||||||
|
mIndices = indices;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
41
libs/xassets/xanimdeltapartquatdataframes.h
Normal file
41
libs/xassets/xanimdeltapartquatdataframes.h
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMDELTAPARTQUATDATAFRAMES_H
|
||||||
|
#define XANIMDELTAPARTQUATDATAFRAMES_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xanimdynamicindices.h"
|
||||||
|
|
||||||
|
class XAnimDeltaPartQuatDataFrames : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimDeltaPartQuatDataFrames();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint32 GetFramesPtr() const;
|
||||||
|
void SetFramesPtr(quint32 ptr);
|
||||||
|
|
||||||
|
const qint16* GetFrames() const;
|
||||||
|
void SetFrames(const qint16* frames, size_t count = 2);
|
||||||
|
|
||||||
|
XAnimDynamicIndices& GetIndices();
|
||||||
|
const XAnimDynamicIndices& GetIndices() const;
|
||||||
|
void SetIndices(const XAnimDynamicIndices& indices);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint32 mFramesPtr = 0;
|
||||||
|
qint16 mFrames[2] = {0};
|
||||||
|
XAnimDynamicIndices mIndices;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMDELTAPARTQUATDATAFRAMES_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
33
libs/xassets/xanimdynamicframes.cpp
Normal file
33
libs/xassets/xanimdynamicframes.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include "xanimdynamicframes.h"
|
||||||
|
|
||||||
|
XAnimDynamicFrames::XAnimDynamicFrames()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDynamicFrames::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mFramesPtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)mFrames, 3 * sizeof(quint8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimDynamicFrames::GetFramesPtr() const {
|
||||||
|
return mFramesPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDynamicFrames::SetFramesPtr(quint32 ptr) {
|
||||||
|
mFramesPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
const quint8* XAnimDynamicFrames::GetFrames() const {
|
||||||
|
return mFrames;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDynamicFrames::SetFrames(const quint8* frames, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mFrames, frames, count * sizeof(quint8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
27
libs/xassets/xanimdynamicframes.h
Normal file
27
libs/xassets/xanimdynamicframes.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMDYNAMICFRAMES_H
|
||||||
|
#define XANIMDYNAMICFRAMES_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XAnimDynamicFrames : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimDynamicFrames();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint32 GetFramesPtr() const;
|
||||||
|
void SetFramesPtr(quint32 ptr);
|
||||||
|
|
||||||
|
const quint8* GetFrames() const;
|
||||||
|
void SetFrames(const quint8* frames, size_t count = 3);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint32 mFramesPtr = 0;
|
||||||
|
quint8 mFrames[3] = {0};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMDYNAMICFRAMES_H
|
||||||
|
|
||||||
28
libs/xassets/xanimdynamicindices.cpp
Normal file
28
libs/xassets/xanimdynamicindices.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimdynamicindices.h"
|
||||||
|
|
||||||
|
XAnimDynamicIndices::XAnimDynamicIndices()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDynamicIndices::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)mIndices, sizeof(quint8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const quint8* XAnimDynamicIndices::GetIndices() const {
|
||||||
|
return mIndices;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimDynamicIndices::SetIndices(const quint8* indices, size_t count) {
|
||||||
|
if (count <= 1) {
|
||||||
|
memcpy(mIndices, indices, count * sizeof(quint8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
25
libs/xassets/xanimdynamicindices.h
Normal file
25
libs/xassets/xanimdynamicindices.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMDYNAMICINDICES_H
|
||||||
|
#define XANIMDYNAMICINDICES_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XAnimDynamicIndices : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimDynamicIndices();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const quint8* GetIndices() const;
|
||||||
|
void SetIndices(const quint8* indices, size_t count = 1);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint8 mIndices[1] = {0};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMDYNAMICINDICES_H
|
||||||
|
|
||||||
|
|
||||||
38
libs/xassets/xanimindices.cpp
Normal file
38
libs/xassets/xanimindices.cpp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimindices.h"
|
||||||
|
|
||||||
|
XAnimIndices::XAnimIndices()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimIndices::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mIndexPtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)&mIndex, sizeof(quint16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimIndices::GetIndexPtr() const {
|
||||||
|
return mIndexPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimIndices::SetIndexPtr(quint32 ptr) {
|
||||||
|
mIndexPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimIndices::GetIndex() const {
|
||||||
|
return mIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimIndices::SetIndex(quint16 index) {
|
||||||
|
mIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
37
libs/xassets/xanimindices.h
Normal file
37
libs/xassets/xanimindices.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMINDICES_H
|
||||||
|
#define XANIMINDICES_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XAnimIndices : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimIndices();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint32 GetIndexPtr() const;
|
||||||
|
void SetIndexPtr(quint32 ptr);
|
||||||
|
|
||||||
|
quint16 GetIndex() const;
|
||||||
|
void SetIndex(quint16 index);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint32 mIndexPtr = 0;
|
||||||
|
quint16 mIndex = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMINDICES_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
38
libs/xassets/xanimnotifyinfo.cpp
Normal file
38
libs/xassets/xanimnotifyinfo.cpp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimnotifyinfo.h"
|
||||||
|
|
||||||
|
XAnimNotifyInfo::XAnimNotifyInfo()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimNotifyInfo::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mName, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mTime, sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimNotifyInfo::GetName() const {
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimNotifyInfo::SetName(quint16 name) {
|
||||||
|
mName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XAnimNotifyInfo::GetTime() const {
|
||||||
|
return mTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimNotifyInfo::SetTime(float time) {
|
||||||
|
mTime = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
35
libs/xassets/xanimnotifyinfo.h
Normal file
35
libs/xassets/xanimnotifyinfo.h
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMNOTIFYINFO_H
|
||||||
|
#define XANIMNOTIFYINFO_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XAnimNotifyInfo : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimNotifyInfo();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint16 GetName() const;
|
||||||
|
void SetName(quint16 name);
|
||||||
|
|
||||||
|
float GetTime() const;
|
||||||
|
void SetTime(float time);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint16 mName = 0;
|
||||||
|
float mTime = 0.0f;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMNOTIFYINFO_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
382
libs/xassets/xanimparts.cpp
Normal file
382
libs/xassets/xanimparts.cpp
Normal file
@ -0,0 +1,382 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include "xanimparts.h"
|
||||||
|
|
||||||
|
XAnimParts::XAnimParts()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
// Parse all fields
|
||||||
|
aStream->read((char*)&mNamePtr, sizeof(quint32));
|
||||||
|
mName = ""; // We'll need to resolve this pointer later
|
||||||
|
|
||||||
|
aStream->read((char*)&mDataByteCount, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mDataShortCount, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mDataIntCount, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mRandomDataByteCount, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mRandomDataIntCount, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mNumFrames, sizeof(quint16));
|
||||||
|
|
||||||
|
quint8 loopDelta;
|
||||||
|
aStream->read((char*)&loopDelta, sizeof(quint8));
|
||||||
|
mIsLoop = (loopDelta & 0x1) != 0;
|
||||||
|
mIsDelta = (loopDelta & 0x2) != 0;
|
||||||
|
|
||||||
|
aStream->read((char*)mBoneCount, sizeof(mBoneCount));
|
||||||
|
aStream->read((char*)&mNotifyCount, sizeof(quint8));
|
||||||
|
aStream->read((char*)&mAssetType, sizeof(quint8));
|
||||||
|
|
||||||
|
quint8 pad;
|
||||||
|
aStream->read((char*)&pad, sizeof(quint8));
|
||||||
|
mPad = (pad != 0);
|
||||||
|
|
||||||
|
aStream->read((char*)&mRandomDataShortCount, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mIndexCount, sizeof(quint16));
|
||||||
|
|
||||||
|
aStream->read((char*)&mFramerate, sizeof(float));
|
||||||
|
aStream->read((char*)&mFrequency, sizeof(float));
|
||||||
|
|
||||||
|
aStream->read((char*)&mNamesPtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)&mNames, sizeof(quint16));
|
||||||
|
|
||||||
|
aStream->read((char*)&mDataBytePtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)&mDataByte, sizeof(quint8));
|
||||||
|
|
||||||
|
aStream->read((char*)&mDataShortPtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)&mDataShort, sizeof(qint16));
|
||||||
|
|
||||||
|
aStream->read((char*)&mDataIntPtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)&mDataInt, sizeof(int));
|
||||||
|
|
||||||
|
aStream->read((char*)&mRandomDataShortPtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)&mRandomDataShort, sizeof(qint16));
|
||||||
|
|
||||||
|
aStream->read((char*)&mRandomDataBytePtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)&mRandomDataByte, sizeof(quint8));
|
||||||
|
|
||||||
|
aStream->read((char*)&mRandomDataIntPtr, sizeof(quint32));
|
||||||
|
aStream->read((char*)&mRandomDataInt, sizeof(int));
|
||||||
|
|
||||||
|
// Parse indices
|
||||||
|
mIndices.ParseData(aStream);
|
||||||
|
|
||||||
|
aStream->read((char*)&mNotifyPtr, sizeof(qint32));
|
||||||
|
mNotify.ParseData(aStream);
|
||||||
|
|
||||||
|
aStream->read((char*)&mDeltaPartPtr, sizeof(qint32));
|
||||||
|
mDeltaPart.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString& XAnimParts::GetName() const {
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetName(const QString& name) {
|
||||||
|
mName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimParts::GetNamePtr() const {
|
||||||
|
return mNamePtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetNamePtr(quint32 ptr) {
|
||||||
|
mNamePtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimParts::GetDataByteCount() const {
|
||||||
|
return mDataByteCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDataByteCount(quint16 count) {
|
||||||
|
mDataByteCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimParts::GetDataShortCount() const {
|
||||||
|
return mDataShortCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDataShortCount(quint16 count) {
|
||||||
|
mDataShortCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimParts::GetDataIntCount() const {
|
||||||
|
return mDataIntCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDataIntCount(quint16 count) {
|
||||||
|
mDataIntCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimParts::GetRandomDataByteCount() const {
|
||||||
|
return mRandomDataByteCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetRandomDataByteCount(quint16 count) {
|
||||||
|
mRandomDataByteCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimParts::GetRandomDataIntCount() const {
|
||||||
|
return mRandomDataIntCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetRandomDataIntCount(quint16 count) {
|
||||||
|
mRandomDataIntCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimParts::GetNumFrames() const {
|
||||||
|
return mNumFrames;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetNumFrames(quint16 frames) {
|
||||||
|
mNumFrames = frames;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool XAnimParts::IsLoop() const {
|
||||||
|
return mIsLoop;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetIsLoop(bool loop) {
|
||||||
|
mIsLoop = loop;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool XAnimParts::IsDelta() const {
|
||||||
|
return mIsDelta;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetIsDelta(bool delta) {
|
||||||
|
mIsDelta = delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
const quint8* XAnimParts::GetBoneCount() const {
|
||||||
|
return mBoneCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetBoneCount(const quint8* count, size_t boneCount) {
|
||||||
|
if (boneCount <= 12) {
|
||||||
|
memcpy(mBoneCount, count, boneCount * sizeof(quint8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XAnimParts::GetNotifyCount() const {
|
||||||
|
return mNotifyCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetNotifyCount(quint8 count) {
|
||||||
|
mNotifyCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XAnimParts::GetAssetType() const {
|
||||||
|
return mAssetType;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetAssetType(quint8 type) {
|
||||||
|
mAssetType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool XAnimParts::IsPad() const {
|
||||||
|
return mPad;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetIsPad(bool pad) {
|
||||||
|
mPad = pad;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimParts::GetRandomDataShortCount() const {
|
||||||
|
return mRandomDataShortCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetRandomDataShortCount(quint16 count) {
|
||||||
|
mRandomDataShortCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimParts::GetIndexCount() const {
|
||||||
|
return mIndexCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetIndexCount(quint16 count) {
|
||||||
|
mIndexCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XAnimParts::GetFramerate() const {
|
||||||
|
return mFramerate;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetFramerate(float rate) {
|
||||||
|
mFramerate = rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XAnimParts::GetFrequency() const {
|
||||||
|
return mFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetFrequency(float frequency) {
|
||||||
|
mFrequency = frequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimParts::GetNamesPtr() const {
|
||||||
|
return mNamesPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetNamesPtr(quint32 ptr) {
|
||||||
|
mNamesPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimParts::GetNames() const {
|
||||||
|
return mNames;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetNames(quint16 names) {
|
||||||
|
mNames = names;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimParts::GetDataBytePtr() const {
|
||||||
|
return mDataBytePtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDataBytePtr(quint32 ptr) {
|
||||||
|
mDataBytePtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XAnimParts::GetDataByte() const {
|
||||||
|
return mDataByte;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDataByte(quint8 byte) {
|
||||||
|
mDataByte = byte;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimParts::GetDataShortPtr() const {
|
||||||
|
return mDataShortPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDataShortPtr(quint32 ptr) {
|
||||||
|
mDataShortPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint16 XAnimParts::GetDataShort() const {
|
||||||
|
return mDataShort;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDataShort(qint16 shortValue) {
|
||||||
|
mDataShort = shortValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimParts::GetDataIntPtr() const {
|
||||||
|
return mDataIntPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDataIntPtr(quint32 ptr) {
|
||||||
|
mDataIntPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XAnimParts::GetDataInt() const {
|
||||||
|
return mDataInt;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDataInt(int value) {
|
||||||
|
mDataInt = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimParts::GetRandomDataShortPtr() const {
|
||||||
|
return mRandomDataShortPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetRandomDataShortPtr(quint32 ptr) {
|
||||||
|
mRandomDataShortPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint16 XAnimParts::GetRandomDataShort() const {
|
||||||
|
return mRandomDataShort;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetRandomDataShort(qint16 shortValue) {
|
||||||
|
mRandomDataShort = shortValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimParts::GetRandomDataBytePtr() const {
|
||||||
|
return mRandomDataBytePtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetRandomDataBytePtr(quint32 ptr) {
|
||||||
|
mRandomDataBytePtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XAnimParts::GetRandomDataByte() const {
|
||||||
|
return mRandomDataByte;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetRandomDataByte(quint8 byte) {
|
||||||
|
mRandomDataByte = byte;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XAnimParts::GetRandomDataIntPtr() const {
|
||||||
|
return mRandomDataIntPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetRandomDataIntPtr(quint32 ptr) {
|
||||||
|
mRandomDataIntPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XAnimParts::GetRandomDataInt() const {
|
||||||
|
return mRandomDataInt;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetRandomDataInt(int value) {
|
||||||
|
mRandomDataInt = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
XAnimIndices& XAnimParts::GetIndices() {
|
||||||
|
return mIndices;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimIndices& XAnimParts::GetIndices() const {
|
||||||
|
return mIndices;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetIndices(const XAnimIndices& indices) {
|
||||||
|
mIndices = indices;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32 XAnimParts::GetNotifyPtr() const {
|
||||||
|
return mNotifyPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetNotifyPtr(qint32 ptr) {
|
||||||
|
mNotifyPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
XAnimNotifyInfo& XAnimParts::GetNotify() {
|
||||||
|
return mNotify;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimNotifyInfo& XAnimParts::GetNotify() const {
|
||||||
|
return mNotify;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetNotify(const XAnimNotifyInfo& notify) {
|
||||||
|
mNotify = notify;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32 XAnimParts::GetDeltaPartPtr() const {
|
||||||
|
return mDeltaPartPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDeltaPartPtr(qint32 ptr) {
|
||||||
|
mDeltaPartPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
XAnimDeltaPart& XAnimParts::GetDeltaPart() {
|
||||||
|
return mDeltaPart;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimDeltaPart& XAnimParts::GetDeltaPart() const {
|
||||||
|
return mDeltaPart;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimParts::SetDeltaPart(const XAnimDeltaPart& deltaPart) {
|
||||||
|
mDeltaPart = deltaPart;
|
||||||
|
}
|
||||||
|
|
||||||
204
libs/xassets/xanimparts.h
Normal file
204
libs/xassets/xanimparts.h
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMPARTS_H
|
||||||
|
#define XANIMPARTS_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include <QString>
|
||||||
|
#include "xanimindices.h"
|
||||||
|
#include "xanimnotifyinfo.h"
|
||||||
|
#include "xanimdeltapart.h"
|
||||||
|
|
||||||
|
class XAnimParts : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimParts();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const QString& GetName() const;
|
||||||
|
void SetName(const QString& name);
|
||||||
|
|
||||||
|
quint32 GetNamePtr() const;
|
||||||
|
void SetNamePtr(quint32 ptr);
|
||||||
|
|
||||||
|
quint16 GetDataByteCount() const;
|
||||||
|
void SetDataByteCount(quint16 count);
|
||||||
|
|
||||||
|
quint16 GetDataShortCount() const;
|
||||||
|
void SetDataShortCount(quint16 count);
|
||||||
|
|
||||||
|
quint16 GetDataIntCount() const;
|
||||||
|
void SetDataIntCount(quint16 count);
|
||||||
|
|
||||||
|
quint16 GetRandomDataByteCount() const;
|
||||||
|
void SetRandomDataByteCount(quint16 count);
|
||||||
|
|
||||||
|
quint16 GetRandomDataIntCount() const;
|
||||||
|
void SetRandomDataIntCount(quint16 count);
|
||||||
|
|
||||||
|
quint16 GetNumFrames() const;
|
||||||
|
void SetNumFrames(quint16 frames);
|
||||||
|
|
||||||
|
bool IsLoop() const;
|
||||||
|
void SetIsLoop(bool loop);
|
||||||
|
|
||||||
|
bool IsDelta() const;
|
||||||
|
void SetIsDelta(bool delta);
|
||||||
|
|
||||||
|
const quint8* GetBoneCount() const;
|
||||||
|
void SetBoneCount(const quint8* count, size_t boneCount = 12);
|
||||||
|
|
||||||
|
quint8 GetNotifyCount() const;
|
||||||
|
void SetNotifyCount(quint8 count);
|
||||||
|
|
||||||
|
quint8 GetAssetType() const;
|
||||||
|
void SetAssetType(quint8 type);
|
||||||
|
|
||||||
|
bool IsPad() const;
|
||||||
|
void SetIsPad(bool pad);
|
||||||
|
|
||||||
|
quint16 GetRandomDataShortCount() const;
|
||||||
|
void SetRandomDataShortCount(quint16 count);
|
||||||
|
|
||||||
|
quint16 GetIndexCount() const;
|
||||||
|
void SetIndexCount(quint16 count);
|
||||||
|
|
||||||
|
float GetFramerate() const;
|
||||||
|
void SetFramerate(float rate);
|
||||||
|
|
||||||
|
float GetFrequency() const;
|
||||||
|
void SetFrequency(float frequency);
|
||||||
|
|
||||||
|
quint32 GetNamesPtr() const;
|
||||||
|
void SetNamesPtr(quint32 ptr);
|
||||||
|
|
||||||
|
quint16 GetNames() const;
|
||||||
|
void SetNames(quint16 names);
|
||||||
|
|
||||||
|
quint32 GetDataBytePtr() const;
|
||||||
|
void SetDataBytePtr(quint32 ptr);
|
||||||
|
|
||||||
|
quint8 GetDataByte() const;
|
||||||
|
void SetDataByte(quint8 byte);
|
||||||
|
|
||||||
|
quint32 GetDataShortPtr() const;
|
||||||
|
void SetDataShortPtr(quint32 ptr);
|
||||||
|
|
||||||
|
qint16 GetDataShort() const;
|
||||||
|
void SetDataShort(qint16 shortValue);
|
||||||
|
|
||||||
|
quint32 GetDataIntPtr() const;
|
||||||
|
void SetDataIntPtr(quint32 ptr);
|
||||||
|
|
||||||
|
int GetDataInt() const;
|
||||||
|
void SetDataInt(int value);
|
||||||
|
|
||||||
|
quint32 GetRandomDataShortPtr() const;
|
||||||
|
void SetRandomDataShortPtr(quint32 ptr);
|
||||||
|
|
||||||
|
qint16 GetRandomDataShort() const;
|
||||||
|
void SetRandomDataShort(qint16 shortValue);
|
||||||
|
|
||||||
|
quint32 GetRandomDataBytePtr() const;
|
||||||
|
void SetRandomDataBytePtr(quint32 ptr);
|
||||||
|
|
||||||
|
quint8 GetRandomDataByte() const;
|
||||||
|
void SetRandomDataByte(quint8 byte);
|
||||||
|
|
||||||
|
quint32 GetRandomDataIntPtr() const;
|
||||||
|
void SetRandomDataIntPtr(quint32 ptr);
|
||||||
|
|
||||||
|
int GetRandomDataInt() const;
|
||||||
|
void SetRandomDataInt(int value);
|
||||||
|
|
||||||
|
XAnimIndices& GetIndices();
|
||||||
|
const XAnimIndices& GetIndices() const;
|
||||||
|
void SetIndices(const XAnimIndices& indices);
|
||||||
|
|
||||||
|
qint32 GetNotifyPtr() const;
|
||||||
|
void SetNotifyPtr(qint32 ptr);
|
||||||
|
|
||||||
|
XAnimNotifyInfo& GetNotify();
|
||||||
|
const XAnimNotifyInfo& GetNotify() const;
|
||||||
|
void SetNotify(const XAnimNotifyInfo& notify);
|
||||||
|
|
||||||
|
qint32 GetDeltaPartPtr() const;
|
||||||
|
void SetDeltaPartPtr(qint32 ptr);
|
||||||
|
|
||||||
|
XAnimDeltaPart& GetDeltaPart();
|
||||||
|
const XAnimDeltaPart& GetDeltaPart() const;
|
||||||
|
void SetDeltaPart(const XAnimDeltaPart& deltaPart);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString mName;
|
||||||
|
quint32 mNamePtr = 0;
|
||||||
|
|
||||||
|
quint16 mDataByteCount = 0;
|
||||||
|
quint16 mDataShortCount = 0;
|
||||||
|
quint16 mDataIntCount = 0;
|
||||||
|
quint16 mRandomDataByteCount = 0;
|
||||||
|
quint16 mRandomDataIntCount = 0;
|
||||||
|
quint16 mNumFrames = 0;
|
||||||
|
|
||||||
|
bool mIsLoop = false;
|
||||||
|
bool mIsDelta = false;
|
||||||
|
|
||||||
|
quint8 mBoneCount[12] = {0};
|
||||||
|
quint8 mNotifyCount = 0;
|
||||||
|
quint8 mAssetType = 0;
|
||||||
|
|
||||||
|
bool mPad = false;
|
||||||
|
|
||||||
|
quint16 mRandomDataShortCount = 0;
|
||||||
|
quint16 mIndexCount = 0;
|
||||||
|
|
||||||
|
float mFramerate = 0.0f;
|
||||||
|
float mFrequency = 0.0f;
|
||||||
|
|
||||||
|
quint32 mNamesPtr = 0;
|
||||||
|
quint16 mNames = 0;
|
||||||
|
|
||||||
|
quint32 mDataBytePtr = 0;
|
||||||
|
quint8 mDataByte = 0;
|
||||||
|
|
||||||
|
quint32 mDataShortPtr = 0;
|
||||||
|
qint16 mDataShort = 0;
|
||||||
|
|
||||||
|
quint32 mDataIntPtr = 0;
|
||||||
|
int mDataInt = 0;
|
||||||
|
|
||||||
|
quint32 mRandomDataShortPtr = 0;
|
||||||
|
qint16 mRandomDataShort = 0;
|
||||||
|
|
||||||
|
quint32 mRandomDataBytePtr = 0;
|
||||||
|
quint8 mRandomDataByte = 0;
|
||||||
|
|
||||||
|
quint32 mRandomDataIntPtr = 0;
|
||||||
|
int mRandomDataInt = 0;
|
||||||
|
|
||||||
|
XAnimIndices mIndices;
|
||||||
|
|
||||||
|
qint32 mNotifyPtr = 0;
|
||||||
|
XAnimNotifyInfo mNotify;
|
||||||
|
|
||||||
|
qint32 mDeltaPartPtr = 0;
|
||||||
|
XAnimDeltaPart mDeltaPart;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMPARTS_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
54
libs/xassets/xanimparttrans.cpp
Normal file
54
libs/xassets/xanimparttrans.cpp
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimparttrans.h"
|
||||||
|
|
||||||
|
XAnimPartTrans::XAnimPartTrans()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTrans::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mSize, sizeof(quint16));
|
||||||
|
quint8 smallTransByte;
|
||||||
|
aStream->read((char*)&smallTransByte, sizeof(quint8));
|
||||||
|
mIsSmallTrans = (smallTransByte != 0);
|
||||||
|
|
||||||
|
// Parse data
|
||||||
|
mData.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XAnimPartTrans::GetSize() const {
|
||||||
|
return mSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTrans::SetSize(quint16 size) {
|
||||||
|
mSize = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool XAnimPartTrans::IsSmallTrans() const {
|
||||||
|
return mIsSmallTrans;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTrans::SetIsSmallTrans(bool isSmall) {
|
||||||
|
mIsSmallTrans = isSmall;
|
||||||
|
}
|
||||||
|
|
||||||
|
XAnimPartTransData& XAnimPartTrans::GetData() {
|
||||||
|
return mData;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimPartTransData& XAnimPartTrans::GetData() const {
|
||||||
|
return mData;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTrans::SetData(const XAnimPartTransData& data) {
|
||||||
|
mData = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
40
libs/xassets/xanimparttrans.h
Normal file
40
libs/xassets/xanimparttrans.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMPARTTRANS_H
|
||||||
|
#define XANIMPARTTRANS_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xanimparttransdata.h"
|
||||||
|
|
||||||
|
class XAnimPartTrans : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimPartTrans();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint16 GetSize() const;
|
||||||
|
void SetSize(quint16 size);
|
||||||
|
|
||||||
|
bool IsSmallTrans() const;
|
||||||
|
void SetIsSmallTrans(bool isSmall);
|
||||||
|
|
||||||
|
XAnimPartTransData& GetData();
|
||||||
|
const XAnimPartTransData& GetData() const;
|
||||||
|
void SetData(const XAnimPartTransData& data);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint16 mSize = 0;
|
||||||
|
bool mIsSmallTrans = false;
|
||||||
|
XAnimPartTransData mData;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMPARTTRANS_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
40
libs/xassets/xanimparttransdata.cpp
Normal file
40
libs/xassets/xanimparttransdata.cpp
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimparttransdata.h"
|
||||||
|
|
||||||
|
XAnimPartTransData::XAnimPartTransData()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTransData::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
// We need to determine which part of the union to parse
|
||||||
|
// For simplicity, we'll assume it's always frames for now
|
||||||
|
mFrames.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimPartTransFrames& XAnimPartTransData::GetFrames() const {
|
||||||
|
return mFrames;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTransData::SetFrames(const XAnimPartTransFrames& frames) {
|
||||||
|
mFrames = frames;
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XAnimPartTransData::GetFrame0() const {
|
||||||
|
return mFrame0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTransData::SetFrame0(const float* frame0, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mFrame0, frame0, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
37
libs/xassets/xanimparttransdata.h
Normal file
37
libs/xassets/xanimparttransdata.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMPARTTRANSDATA_H
|
||||||
|
#define XANIMPARTTRANSDATA_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xanimparttransframes.h"
|
||||||
|
|
||||||
|
class XAnimPartTransData : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimPartTransData();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
// Option 1: Frames data
|
||||||
|
const XAnimPartTransFrames& GetFrames() const;
|
||||||
|
void SetFrames(const XAnimPartTransFrames& frames);
|
||||||
|
|
||||||
|
// Option 2: Frame0 data
|
||||||
|
const float* GetFrame0() const;
|
||||||
|
void SetFrame0(const float* frame0, size_t count = 3);
|
||||||
|
|
||||||
|
private:
|
||||||
|
union {
|
||||||
|
XAnimPartTransFrames mFrames;
|
||||||
|
float mFrame0[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMPARTTRANSDATA_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
71
libs/xassets/xanimparttransframes.cpp
Normal file
71
libs/xassets/xanimparttransframes.cpp
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xanimparttransframes.h"
|
||||||
|
|
||||||
|
XAnimPartTransFrames::XAnimPartTransFrames()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTransFrames::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)mMins, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)mSize, 3 * sizeof(float));
|
||||||
|
|
||||||
|
// Parse frames
|
||||||
|
mFrames.ParseData(aStream);
|
||||||
|
|
||||||
|
// Parse indices
|
||||||
|
mIndices.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XAnimPartTransFrames::GetMins() const {
|
||||||
|
return mMins;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTransFrames::SetMins(const float* mins, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mMins, mins, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XAnimPartTransFrames::GetSize() const {
|
||||||
|
return mSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTransFrames::SetSize(const float* size, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mSize, size, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
XAnimDynamicFrames& XAnimPartTransFrames::GetFrames() {
|
||||||
|
return mFrames;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimDynamicFrames& XAnimPartTransFrames::GetFrames() const {
|
||||||
|
return mFrames;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTransFrames::SetFrames(const XAnimDynamicFrames& frames) {
|
||||||
|
mFrames = frames;
|
||||||
|
}
|
||||||
|
|
||||||
|
XAnimDynamicIndices& XAnimPartTransFrames::GetIndices() {
|
||||||
|
return mIndices;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XAnimDynamicIndices& XAnimPartTransFrames::GetIndices() const {
|
||||||
|
return mIndices;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAnimPartTransFrames::SetIndices(const XAnimDynamicIndices& indices) {
|
||||||
|
mIndices = indices;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
43
libs/xassets/xanimparttransframes.h
Normal file
43
libs/xassets/xanimparttransframes.h
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XANIMPARTTRANSFRAMES_H
|
||||||
|
#define XANIMPARTTRANSFRAMES_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xanimdynamicframes.h"
|
||||||
|
#include "xanimdynamicindices.h"
|
||||||
|
|
||||||
|
class XAnimPartTransFrames : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAnimPartTransFrames();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const float* GetMins() const;
|
||||||
|
void SetMins(const float* mins, size_t count = 3);
|
||||||
|
|
||||||
|
const float* GetSize() const;
|
||||||
|
void SetSize(const float* size, size_t count = 3);
|
||||||
|
|
||||||
|
XAnimDynamicFrames& GetFrames();
|
||||||
|
const XAnimDynamicFrames& GetFrames() const;
|
||||||
|
void SetFrames(const XAnimDynamicFrames& frames);
|
||||||
|
|
||||||
|
XAnimDynamicIndices& GetIndices();
|
||||||
|
const XAnimDynamicIndices& GetIndices() const;
|
||||||
|
void SetIndices(const XAnimDynamicIndices& indices);
|
||||||
|
|
||||||
|
private:
|
||||||
|
float mMins[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
float mSize[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
XAnimDynamicFrames mFrames;
|
||||||
|
XAnimDynamicIndices mIndices;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XANIMPARTTRANSFRAMES_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
53
libs/xassets/xassetlist.cpp
Normal file
53
libs/xassets/xassetlist.cpp
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xassetlist.h"
|
||||||
|
|
||||||
|
XAssetList::XAssetList()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAssetList::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
// Parse string list
|
||||||
|
mStringList.ParseData(aStream);
|
||||||
|
|
||||||
|
// Parse asset count and assets
|
||||||
|
aStream->read((char*)&mAssetCount, sizeof(int));
|
||||||
|
for (int i = 0; i < mAssetCount; ++i) {
|
||||||
|
XAsset asset;
|
||||||
|
asset.ParseData(aStream);
|
||||||
|
mAssets.append(asset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const ScriptStringList& XAssetList::GetStringList() const {
|
||||||
|
return mStringList;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAssetList::SetStringList(const ScriptStringList& stringList) {
|
||||||
|
mStringList = stringList;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XAssetList::GetAssetCount() const {
|
||||||
|
return mAssetCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAssetList::SetAssetCount(int count) {
|
||||||
|
mAssetCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVector<XAsset>& XAssetList::GetAssets() {
|
||||||
|
return mAssets;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QVector<XAsset>& XAssetList::GetAssets() const {
|
||||||
|
return mAssets;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAssetList::SetAssets(const QVector<XAsset>& assets) {
|
||||||
|
mAssets = assets;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
34
libs/xassets/xassetlist.h
Normal file
34
libs/xassets/xassetlist.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef XASSETLIST_H
|
||||||
|
#define XASSETLIST_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include <QVector>
|
||||||
|
#include "scriptstringlist.h"
|
||||||
|
|
||||||
|
class XAssetList : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XAssetList();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const ScriptStringList& GetStringList() const;
|
||||||
|
void SetStringList(const ScriptStringList& stringList);
|
||||||
|
|
||||||
|
int GetAssetCount() const;
|
||||||
|
void SetAssetCount(int count);
|
||||||
|
|
||||||
|
QVector<XAsset>& GetAssets();
|
||||||
|
const QVector<XAsset>& GetAssets() const;
|
||||||
|
void SetAssets(const QVector<XAsset>& assets);
|
||||||
|
|
||||||
|
private:
|
||||||
|
ScriptStringList mStringList;
|
||||||
|
int mAssetCount = 0;
|
||||||
|
QVector<XAsset> mAssets;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XASSETLIST_H
|
||||||
|
|
||||||
64
libs/xassets/xaudiochannelmap.cpp
Normal file
64
libs/xassets/xaudiochannelmap.cpp
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#include "xaudiochannelmap.h"
|
||||||
|
|
||||||
|
XAudioChannelMap::XAudioChannelMap()
|
||||||
|
: XAsset()
|
||||||
|
, mEntryCount(0)
|
||||||
|
, mEntries(QVector<XAudioChannelMapEntry*>())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XAudioChannelMap::~XAudioChannelMap()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mEntries.size(); i++)
|
||||||
|
{
|
||||||
|
delete mEntries[i];
|
||||||
|
}
|
||||||
|
mEntries.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XAudioChannelMap::GetEntryCount() const
|
||||||
|
{
|
||||||
|
return mEntryCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
XAudioChannelMapEntry *XAudioChannelMap::GetMapEntry(int aIndex) const
|
||||||
|
{
|
||||||
|
return mEntries[aIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAudioChannelMap::SetMapEntry(int aIndex, XAudioChannelMapEntry *aEntry)
|
||||||
|
{
|
||||||
|
mEntries[aIndex] = aEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAudioChannelMap::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
*aStream >> mEntryCount;
|
||||||
|
|
||||||
|
aStream->skipRawData(3);
|
||||||
|
|
||||||
|
quint32 entriesPtr;
|
||||||
|
*aStream >> entriesPtr;
|
||||||
|
|
||||||
|
if (entriesPtr)
|
||||||
|
{
|
||||||
|
mEntries.resize(mEntryCount);
|
||||||
|
for (int i = 0; i < mEntryCount; i++)
|
||||||
|
{
|
||||||
|
mEntries[i] = new XAudioChannelMapEntry();
|
||||||
|
mEntries[i]->ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAudioChannelMap::Clear()
|
||||||
|
{
|
||||||
|
mEntryCount = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < mEntries.size(); i++)
|
||||||
|
{
|
||||||
|
delete mEntries[i];
|
||||||
|
}
|
||||||
|
mEntries.clear();
|
||||||
|
}
|
||||||
26
libs/xassets/xaudiochannelmap.h
Normal file
26
libs/xassets/xaudiochannelmap.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef XAUDIOCHANNELMAP_H
|
||||||
|
#define XAUDIOCHANNELMAP_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xaudiochannelmapentry.h"
|
||||||
|
|
||||||
|
class XAudioChannelMap : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
XAudioChannelMap();
|
||||||
|
~XAudioChannelMap();
|
||||||
|
|
||||||
|
quint8 GetEntryCount() const;
|
||||||
|
|
||||||
|
XAudioChannelMapEntry* GetMapEntry(int aIndex) const;
|
||||||
|
void SetMapEntry(int aIndex, XAudioChannelMapEntry* aEntry);
|
||||||
|
|
||||||
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint8 mEntryCount;
|
||||||
|
QVector<XAudioChannelMapEntry*> mEntries;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XAUDIOCHANNELMAP_H
|
||||||
64
libs/xassets/xaudiochannelmapentry.cpp
Normal file
64
libs/xassets/xaudiochannelmapentry.cpp
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#include "xaudiochannelmapentry.h"
|
||||||
|
|
||||||
|
XAudioChannelMapEntry::XAudioChannelMapEntry()
|
||||||
|
: XAsset()
|
||||||
|
, mInputChannel(0)
|
||||||
|
, mOutputChannel(0)
|
||||||
|
, mVolume(0.0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XAudioChannelMapEntry::~XAudioChannelMapEntry()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XAudioChannelMapEntry::GetInputChannel() const
|
||||||
|
{
|
||||||
|
return mInputChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAudioChannelMapEntry::SetInputChannel(quint8 aInputChannel)
|
||||||
|
{
|
||||||
|
mInputChannel = aInputChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XAudioChannelMapEntry::GetOutputChannel() const
|
||||||
|
{
|
||||||
|
return mOutputChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAudioChannelMapEntry::SetOutputChannel(quint8 aOutputChannel)
|
||||||
|
{
|
||||||
|
mOutputChannel = aOutputChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XAudioChannelMapEntry::GetVolume() const
|
||||||
|
{
|
||||||
|
return mVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAudioChannelMapEntry::SetVolume(float aVolume)
|
||||||
|
{
|
||||||
|
mVolume = aVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAudioChannelMapEntry::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mInputChannel
|
||||||
|
>> mOutputChannel;
|
||||||
|
|
||||||
|
// Skip padding bytes in struct
|
||||||
|
aStream->skipRawData(2);
|
||||||
|
|
||||||
|
*aStream >> mVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XAudioChannelMapEntry::Clear()
|
||||||
|
{
|
||||||
|
mInputChannel = 0;
|
||||||
|
mOutputChannel = 0;
|
||||||
|
mVolume = 0.0;
|
||||||
|
}
|
||||||
30
libs/xassets/xaudiochannelmapentry.h
Normal file
30
libs/xassets/xaudiochannelmapentry.h
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#ifndef XAUDIOCHANNELMAPENTRY_H
|
||||||
|
#define XAUDIOCHANNELMAPENTRY_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XAudioChannelMapEntry : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
XAudioChannelMapEntry();
|
||||||
|
~XAudioChannelMapEntry();
|
||||||
|
|
||||||
|
quint8 GetInputChannel() const;
|
||||||
|
void SetInputChannel(quint8 aInputChannel);
|
||||||
|
|
||||||
|
quint8 GetOutputChannel() const;
|
||||||
|
void SetOutputChannel(quint8 aOutputChannel);
|
||||||
|
|
||||||
|
float GetVolume() const;
|
||||||
|
void SetVolume(float aVolume);
|
||||||
|
|
||||||
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint8 mInputChannel;
|
||||||
|
quint8 mOutputChannel;
|
||||||
|
float mVolume;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XAUDIOCHANNELMAPENTRY_H
|
||||||
23
libs/xassets/xcardmemory.cpp
Normal file
23
libs/xassets/xcardmemory.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include "xcardmemory.h"
|
||||||
|
|
||||||
|
XCardMemory::XCardMemory()
|
||||||
|
: XAsset()
|
||||||
|
, mPlatform(0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XCardMemory::~XCardMemory()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCardMemory::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
*aStream >> mPlatform;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCardMemory::Clear()
|
||||||
|
{
|
||||||
|
mPlatform = 0;
|
||||||
|
}
|
||||||
19
libs/xassets/xcardmemory.h
Normal file
19
libs/xassets/xcardmemory.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#ifndef XCARDMEMORY_H
|
||||||
|
#define XCARDMEMORY_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XCardMemory : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
XCardMemory();
|
||||||
|
~XCardMemory();
|
||||||
|
|
||||||
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
int mPlatform;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCARDMEMORY_H
|
||||||
97
libs/xassets/xcleaf.cpp
Normal file
97
libs/xassets/xcleaf.cpp
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcleaf.h"
|
||||||
|
|
||||||
|
XCLeaf::XCLeaf()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeaf::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mFirstCollAabbIndex, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mCollAabbCount, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mBrushContents, sizeof(int));
|
||||||
|
aStream->read((char*)&mTerrainContents, sizeof(int));
|
||||||
|
aStream->read((char*)mMins, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)mMaxs, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)&mLeafBrushNode, sizeof(int));
|
||||||
|
aStream->read((char*)&mCluster, sizeof(qint16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XCLeaf::GetFirstCollAabbIndex() const {
|
||||||
|
return mFirstCollAabbIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeaf::SetFirstCollAabbIndex(quint16 index) {
|
||||||
|
mFirstCollAabbIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XCLeaf::GetCollAabbCount() const {
|
||||||
|
return mCollAabbCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeaf::SetCollAabbCount(quint16 count) {
|
||||||
|
mCollAabbCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XCLeaf::GetBrushContents() const {
|
||||||
|
return mBrushContents;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeaf::SetBrushContents(int contents) {
|
||||||
|
mBrushContents = contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XCLeaf::GetTerrainContents() const {
|
||||||
|
return mTerrainContents;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeaf::SetTerrainContents(int contents) {
|
||||||
|
mTerrainContents = contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XCLeaf::GetMins() const {
|
||||||
|
return mMins;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeaf::SetMins(const float* mins, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mMins, mins, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XCLeaf::GetMaxs() const {
|
||||||
|
return mMaxs;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeaf::SetMaxs(const float* maxs, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mMaxs, maxs, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int XCLeaf::GetLeafBrushNode() const {
|
||||||
|
return mLeafBrushNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeaf::SetLeafBrushNode(int node) {
|
||||||
|
mLeafBrushNode = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint16 XCLeaf::GetCluster() const {
|
||||||
|
return mCluster;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeaf::SetCluster(qint16 cluster) {
|
||||||
|
mCluster = cluster;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
59
libs/xassets/xcleaf.h
Normal file
59
libs/xassets/xcleaf.h
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCLEAF_H
|
||||||
|
#define XCLEAF_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XCLeaf : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCLeaf();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint16 GetFirstCollAabbIndex() const;
|
||||||
|
void SetFirstCollAabbIndex(quint16 index);
|
||||||
|
|
||||||
|
quint16 GetCollAabbCount() const;
|
||||||
|
void SetCollAabbCount(quint16 count);
|
||||||
|
|
||||||
|
int GetBrushContents() const;
|
||||||
|
void SetBrushContents(int contents);
|
||||||
|
|
||||||
|
int GetTerrainContents() const;
|
||||||
|
void SetTerrainContents(int contents);
|
||||||
|
|
||||||
|
const float* GetMins() const;
|
||||||
|
void SetMins(const float* mins, size_t count = 3);
|
||||||
|
|
||||||
|
const float* GetMaxs() const;
|
||||||
|
void SetMaxs(const float* maxs, size_t count = 3);
|
||||||
|
|
||||||
|
int GetLeafBrushNode() const;
|
||||||
|
void SetLeafBrushNode(int node);
|
||||||
|
|
||||||
|
qint16 GetCluster() const;
|
||||||
|
void SetCluster(qint16 cluster);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint16 mFirstCollAabbIndex = 0;
|
||||||
|
quint16 mCollAabbCount = 0;
|
||||||
|
int mBrushContents = 0;
|
||||||
|
int mTerrainContents = 0;
|
||||||
|
float mMins[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
float mMaxs[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
int mLeafBrushNode = 0;
|
||||||
|
qint16 mCluster = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCLEAF_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
55
libs/xassets/xcleafbrushnode.cpp
Normal file
55
libs/xassets/xcleafbrushnode.cpp
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include "xcleafbrushnode.h"
|
||||||
|
|
||||||
|
XCLeafBrushNode::XCLeafBrushNode()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNode::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mAxis, sizeof(quint8));
|
||||||
|
aStream->read((char*)&mLeafBrushCount, sizeof(qint16));
|
||||||
|
aStream->read((char*)&mContents, sizeof(int));
|
||||||
|
|
||||||
|
// Parse data
|
||||||
|
mData.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XCLeafBrushNode::GetAxis() const {
|
||||||
|
return mAxis;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNode::SetAxis(quint8 axis) {
|
||||||
|
mAxis = axis;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint16 XCLeafBrushNode::GetLeafBrushCount() const {
|
||||||
|
return mLeafBrushCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNode::SetLeafBrushCount(qint16 count) {
|
||||||
|
mLeafBrushCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XCLeafBrushNode::GetContents() const {
|
||||||
|
return mContents;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNode::SetContents(int contents) {
|
||||||
|
mContents = contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
XCLeafBrushNodeData& XCLeafBrushNode::GetData() {
|
||||||
|
return mData;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XCLeafBrushNodeData& XCLeafBrushNode::GetData() const {
|
||||||
|
return mData;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNode::SetData(const XCLeafBrushNodeData& data) {
|
||||||
|
mData = data;
|
||||||
|
}
|
||||||
|
|
||||||
45
libs/xassets/xcleafbrushnode.h
Normal file
45
libs/xassets/xcleafbrushnode.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCLEAFBRUSHNODE_H
|
||||||
|
#define XCLEAFBRUSHNODE_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xcleafbrushnodedata.h"
|
||||||
|
|
||||||
|
class XCLeafBrushNode : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCLeafBrushNode();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint8 GetAxis() const;
|
||||||
|
void SetAxis(quint8 axis);
|
||||||
|
|
||||||
|
qint16 GetLeafBrushCount() const;
|
||||||
|
void SetLeafBrushCount(qint16 count);
|
||||||
|
|
||||||
|
int GetContents() const;
|
||||||
|
void SetContents(int contents);
|
||||||
|
|
||||||
|
XCLeafBrushNodeData& GetData();
|
||||||
|
const XCLeafBrushNodeData& GetData() const;
|
||||||
|
void SetData(const XCLeafBrushNodeData& data);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint8 mAxis = 0;
|
||||||
|
qint16 mLeafBrushCount = 0;
|
||||||
|
int mContents = 0;
|
||||||
|
XCLeafBrushNodeData mData;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCLEAFBRUSHNODE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
52
libs/xassets/xcleafbrushnodechildren.cpp
Normal file
52
libs/xassets/xcleafbrushnodechildren.cpp
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcleafbrushnodechildren.h"
|
||||||
|
|
||||||
|
XCLeafBrushNodeChildren::XCLeafBrushNodeChildren()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNodeChildren::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mDist, sizeof(float));
|
||||||
|
aStream->read((char*)&mRange, sizeof(float));
|
||||||
|
aStream->read((char*)mChildOffset, 2 * sizeof(quint16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float XCLeafBrushNodeChildren::GetDist() const {
|
||||||
|
return mDist;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNodeChildren::SetDist(float dist) {
|
||||||
|
mDist = dist;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XCLeafBrushNodeChildren::GetRange() const {
|
||||||
|
return mRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNodeChildren::SetRange(float range) {
|
||||||
|
mRange = range;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XCLeafBrushNodeChildren::GetChildOffset(int index) const {
|
||||||
|
if (index >= 0 && index < 2) {
|
||||||
|
return mChildOffset[index];
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNodeChildren::SetChildOffset(int index, quint16 offset) {
|
||||||
|
if (index >= 0 && index < 2) {
|
||||||
|
mChildOffset[index] = offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
39
libs/xassets/xcleafbrushnodechildren.h
Normal file
39
libs/xassets/xcleafbrushnodechildren.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCLEAFBRUSHNODECHILDREN_H
|
||||||
|
#define XCLEAFBRUSHNODECHILDREN_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XCLeafBrushNodeChildren : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCLeafBrushNodeChildren();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
float GetDist() const;
|
||||||
|
void SetDist(float dist);
|
||||||
|
|
||||||
|
float GetRange() const;
|
||||||
|
void SetRange(float range);
|
||||||
|
|
||||||
|
quint16 GetChildOffset(int index) const;
|
||||||
|
void SetChildOffset(int index, quint16 offset);
|
||||||
|
|
||||||
|
private:
|
||||||
|
float mDist = 0.0f;
|
||||||
|
float mRange = 0.0f;
|
||||||
|
quint16 mChildOffset[2] = {0};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCLEAFBRUSHNODECHILDREN_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
39
libs/xassets/xcleafbrushnodedata.cpp
Normal file
39
libs/xassets/xcleafbrushnodedata.cpp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcleafbrushnodedata.h"
|
||||||
|
|
||||||
|
XCLeafBrushNodeData::XCLeafBrushNodeData()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNodeData::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
// We need to determine which part of the union to parse
|
||||||
|
// For simplicity, we'll assume it's always leaf for now
|
||||||
|
mLeaf.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const XCLeafBrushNodeLeaf& XCLeafBrushNodeData::GetLeaf() const {
|
||||||
|
return mLeaf;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNodeData::SetLeaf(const XCLeafBrushNodeLeaf& leaf) {
|
||||||
|
mLeaf = leaf;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XCLeafBrushNodeChildren& XCLeafBrushNodeData::GetChildren() const {
|
||||||
|
return mChildren;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNodeData::SetChildren(const XCLeafBrushNodeChildren& children) {
|
||||||
|
mChildren = children;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
41
libs/xassets/xcleafbrushnodedata.h
Normal file
41
libs/xassets/xcleafbrushnodedata.h
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCLEAFBRUSHNODEDATA_H
|
||||||
|
#define XCLEAFBRUSHNODEDATA_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xcleafbrushnodeleaf.h"
|
||||||
|
#include "xcleafbrushnodechildren.h"
|
||||||
|
|
||||||
|
class XCLeafBrushNodeData : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCLeafBrushNodeData();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
// Option 1: Leaf data
|
||||||
|
const XCLeafBrushNodeLeaf& GetLeaf() const;
|
||||||
|
void SetLeaf(const XCLeafBrushNodeLeaf& leaf);
|
||||||
|
|
||||||
|
// Option 2: Children data
|
||||||
|
const XCLeafBrushNodeChildren& GetChildren() const;
|
||||||
|
void SetChildren(const XCLeafBrushNodeChildren& children);
|
||||||
|
|
||||||
|
private:
|
||||||
|
union {
|
||||||
|
XCLeafBrushNodeLeaf mLeaf;
|
||||||
|
XCLeafBrushNodeChildren mChildren;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCLEAFBRUSHNODEDATA_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
28
libs/xassets/xcleafbrushnodeleaf.cpp
Normal file
28
libs/xassets/xcleafbrushnodeleaf.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcleafbrushnodeleaf.h"
|
||||||
|
|
||||||
|
XCLeafBrushNodeLeaf::XCLeafBrushNodeLeaf()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNodeLeaf::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
// We would parse brushes here, but we're using a placeholder
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void* XCLeafBrushNodeLeaf::GetBrushes() const {
|
||||||
|
return mBrushes;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCLeafBrushNodeLeaf::SetBrushes(void* brushes) {
|
||||||
|
mBrushes = brushes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
33
libs/xassets/xcleafbrushnodeleaf.h
Normal file
33
libs/xassets/xcleafbrushnodeleaf.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCLEAFBRUSHNODELEAF_H
|
||||||
|
#define XCLEAFBRUSHNODELEAF_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XCLeafBrushNodeLeaf : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCLeafBrushNodeLeaf();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
// Note: In a real implementation, we would have proper handling for brushes pointer
|
||||||
|
// For now, we'll just use a placeholder
|
||||||
|
void* GetBrushes() const;
|
||||||
|
void SetBrushes(void* brushes);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void* mBrushes = nullptr; // Placeholder for unsigned __int16*
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCLEAFBRUSHNODELEAF_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
104
libs/xassets/xclipmap.cpp
Normal file
104
libs/xassets/xclipmap.cpp
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xclipmap.h"
|
||||||
|
|
||||||
|
XClipMap::XClipMap()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
char name[64];
|
||||||
|
aStream->read(name, 64);
|
||||||
|
mName = QString::fromUtf8(name);
|
||||||
|
|
||||||
|
aStream->read((char*)&mChecksum, sizeof(int));
|
||||||
|
|
||||||
|
// We would parse arrays here, but we're using placeholders
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString& XClipMap::GetName() const {
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetName(const QString& name) {
|
||||||
|
mName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XClipMap::GetChecksum() const {
|
||||||
|
return mChecksum;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetChecksum(int checksum) {
|
||||||
|
mChecksum = checksum;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* XClipMap::GetStaticModels() const {
|
||||||
|
return mStaticModels;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetStaticModels(void* staticModels) {
|
||||||
|
mStaticModels = staticModels;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XClipMap::GetNumStaticModels() const {
|
||||||
|
return mNumStaticModels;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetNumStaticModels(int count) {
|
||||||
|
mNumStaticModels = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* XClipMap::GetCollisionAabbTrees() const {
|
||||||
|
return mCollisionAabbTrees;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetCollisionAabbTrees(void* trees) {
|
||||||
|
mCollisionAabbTrees = trees;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XClipMap::GetNumCollisionAabbTrees() const {
|
||||||
|
return mNumCollisionAabbTrees;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetNumCollisionAabbTrees(int count) {
|
||||||
|
mNumCollisionAabbTrees = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* XClipMap::GetMaterials() const {
|
||||||
|
return mMaterials;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetMaterials(void* materials) {
|
||||||
|
mMaterials = materials;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XClipMap::GetNumMaterials() const {
|
||||||
|
return mNumMaterials;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetNumMaterials(int count) {
|
||||||
|
mNumMaterials = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* XClipMap::GetLeafBrushNodes() const {
|
||||||
|
return mLeafBrushNodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetLeafBrushNodes(void* nodes) {
|
||||||
|
mLeafBrushNodes = nodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XClipMap::GetNumLeafBrushNodes() const {
|
||||||
|
return mNumLeafBrushNodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XClipMap::SetNumLeafBrushNodes(int count) {
|
||||||
|
mNumLeafBrushNodes = count;
|
||||||
|
}
|
||||||
|
|
||||||
82
libs/xassets/xclipmap.h
Normal file
82
libs/xassets/xclipmap.h
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCLIPMAP_H
|
||||||
|
#define XCLIPMAP_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class XCStaticModel_s; // Forward declaration
|
||||||
|
class XCollisionAabbTree; // Forward declaration
|
||||||
|
class XDmaterial_t; // Forward declaration
|
||||||
|
class XCLeafBrushNode; // Forward declaration
|
||||||
|
|
||||||
|
class XClipMap : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XClipMap();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const QString& GetName() const;
|
||||||
|
void SetName(const QString& name);
|
||||||
|
|
||||||
|
int GetChecksum() const;
|
||||||
|
void SetChecksum(int checksum);
|
||||||
|
|
||||||
|
// Note: In a real implementation, we would have proper handling for these arrays
|
||||||
|
// For now, we'll just use placeholders
|
||||||
|
void* GetStaticModels() const;
|
||||||
|
void SetStaticModels(void* staticModels);
|
||||||
|
|
||||||
|
int GetNumStaticModels() const;
|
||||||
|
void SetNumStaticModels(int count);
|
||||||
|
|
||||||
|
void* GetCollisionAabbTrees() const;
|
||||||
|
void SetCollisionAabbTrees(void* trees);
|
||||||
|
|
||||||
|
int GetNumCollisionAabbTrees() const;
|
||||||
|
void SetNumCollisionAabbTrees(int count);
|
||||||
|
|
||||||
|
void* GetMaterials() const;
|
||||||
|
void SetMaterials(void* materials);
|
||||||
|
|
||||||
|
int GetNumMaterials() const;
|
||||||
|
void SetNumMaterials(int count);
|
||||||
|
|
||||||
|
void* GetLeafBrushNodes() const;
|
||||||
|
void SetLeafBrushNodes(void* nodes);
|
||||||
|
|
||||||
|
int GetNumLeafBrushNodes() const;
|
||||||
|
void SetNumLeafBrushNodes(int count);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString mName = "";
|
||||||
|
int mChecksum = 0;
|
||||||
|
|
||||||
|
// Placeholders for arrays
|
||||||
|
void* mStaticModels = nullptr; // Placeholder for XCStaticModel_s*
|
||||||
|
int mNumStaticModels = 0;
|
||||||
|
|
||||||
|
void* mCollisionAabbTrees = nullptr; // Placeholder for XCollisionAabbTree*
|
||||||
|
int mNumCollisionAabbTrees = 0;
|
||||||
|
|
||||||
|
void* mMaterials = nullptr; // Placeholder for XDmaterial_t*
|
||||||
|
int mNumMaterials = 0;
|
||||||
|
|
||||||
|
void* mLeafBrushNodes = nullptr; // Placeholder for XCLeafBrushNode*
|
||||||
|
int mNumLeafBrushNodes = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCLIPMAP_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
45
libs/xassets/xcnode.cpp
Normal file
45
libs/xassets/xcnode.cpp
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcnode.h"
|
||||||
|
|
||||||
|
XCNode_t::XCNode_t()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCNode_t::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
// We would parse plane here, but we're using a placeholder
|
||||||
|
|
||||||
|
// Parse children
|
||||||
|
aStream->read((char*)mChildren, 2 * sizeof(qint16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void* XCNode_t::GetPlane() const {
|
||||||
|
return mPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCNode_t::SetPlane(void* plane) {
|
||||||
|
mPlane = plane;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint16 XCNode_t::GetChild(int index) const {
|
||||||
|
if (index >= 0 && index < 2) {
|
||||||
|
return mChildren[index];
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCNode_t::SetChild(int index, qint16 child) {
|
||||||
|
if (index >= 0 && index < 2) {
|
||||||
|
mChildren[index] = child;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
39
libs/xassets/xcnode.h
Normal file
39
libs/xassets/xcnode.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCNODE_H
|
||||||
|
#define XCNODE_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class CPlane; // Forward declaration
|
||||||
|
|
||||||
|
class XCNode_t : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCNode_t();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
// Note: In a real implementation, we would have an XCPlane class
|
||||||
|
// For now, we'll just use a pointer to CPlane as a placeholder
|
||||||
|
void* GetPlane() const;
|
||||||
|
void SetPlane(void* plane);
|
||||||
|
|
||||||
|
qint16 GetChild(int index) const;
|
||||||
|
void SetChild(int index, qint16 child);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void* mPlane = nullptr; // Placeholder for CPlane*
|
||||||
|
qint16 mChildren[2] = {0};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCNODE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
74
libs/xassets/xcollisionaabbtree.cpp
Normal file
74
libs/xassets/xcollisionaabbtree.cpp
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcollisionaabbtree.h"
|
||||||
|
|
||||||
|
XCollisionAabbTree::XCollisionAabbTree()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionAabbTree::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)mOrigin, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)mHalfSize, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)&mMaterialIndex, sizeof(quint16));
|
||||||
|
aStream->read((char*)&mChildCount, sizeof(quint16));
|
||||||
|
|
||||||
|
// Parse union
|
||||||
|
mU.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XCollisionAabbTree::GetOrigin() const {
|
||||||
|
return mOrigin;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionAabbTree::SetOrigin(const float* origin, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mOrigin, origin, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XCollisionAabbTree::GetHalfSize() const {
|
||||||
|
return mHalfSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionAabbTree::SetHalfSize(const float* halfSize, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mHalfSize, halfSize, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XCollisionAabbTree::GetMaterialIndex() const {
|
||||||
|
return mMaterialIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionAabbTree::SetMaterialIndex(quint16 index) {
|
||||||
|
mMaterialIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XCollisionAabbTree::GetChildCount() const {
|
||||||
|
return mChildCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionAabbTree::SetChildCount(quint16 count) {
|
||||||
|
mChildCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
XCollisionAabbTreeIndex& XCollisionAabbTree::GetU() {
|
||||||
|
return mU;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XCollisionAabbTreeIndex& XCollisionAabbTree::GetU() const {
|
||||||
|
return mU;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionAabbTree::SetU(const XCollisionAabbTreeIndex& u) {
|
||||||
|
mU = u;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
49
libs/xassets/xcollisionaabbtree.h
Normal file
49
libs/xassets/xcollisionaabbtree.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCOLLISIONAABBTREE_H
|
||||||
|
#define XCOLLISIONAABBTREE_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xcollisionaabbtreeindex.h"
|
||||||
|
|
||||||
|
class XCollisionAabbTree : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCollisionAabbTree();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const float* GetOrigin() const;
|
||||||
|
void SetOrigin(const float* origin, size_t count = 3);
|
||||||
|
|
||||||
|
const float* GetHalfSize() const;
|
||||||
|
void SetHalfSize(const float* halfSize, size_t count = 3);
|
||||||
|
|
||||||
|
quint16 GetMaterialIndex() const;
|
||||||
|
void SetMaterialIndex(quint16 index);
|
||||||
|
|
||||||
|
quint16 GetChildCount() const;
|
||||||
|
void SetChildCount(quint16 count);
|
||||||
|
|
||||||
|
XCollisionAabbTreeIndex& GetU();
|
||||||
|
const XCollisionAabbTreeIndex& GetU() const;
|
||||||
|
void SetU(const XCollisionAabbTreeIndex& u);
|
||||||
|
|
||||||
|
private:
|
||||||
|
float mOrigin[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
float mHalfSize[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
quint16 mMaterialIndex = 0;
|
||||||
|
quint16 mChildCount = 0;
|
||||||
|
XCollisionAabbTreeIndex mU;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCOLLISIONAABBTREE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
40
libs/xassets/xcollisionaabbtreeindex.cpp
Normal file
40
libs/xassets/xcollisionaabbtreeindex.cpp
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcollisionaabbtreeindex.h"
|
||||||
|
|
||||||
|
XCollisionAabbTreeIndex::XCollisionAabbTreeIndex()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionAabbTreeIndex::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
// We need to determine which part of the union to parse
|
||||||
|
// For simplicity, we'll assume it's always firstChildIndex for now
|
||||||
|
aStream->read((char*)&mFirstChildIndex, sizeof(int));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int XCollisionAabbTreeIndex::GetFirstChildIndex() const {
|
||||||
|
return mFirstChildIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionAabbTreeIndex::SetFirstChildIndex(int index) {
|
||||||
|
mFirstChildIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XCollisionAabbTreeIndex::GetPartitionIndex() const {
|
||||||
|
return mPartitionIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionAabbTreeIndex::SetPartitionIndex(int index) {
|
||||||
|
mPartitionIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
39
libs/xassets/xcollisionaabbtreeindex.h
Normal file
39
libs/xassets/xcollisionaabbtreeindex.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCOLLISIONAABBTREEINDEX_H
|
||||||
|
#define XCOLLISIONAABBTREEINDEX_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XCollisionAabbTreeIndex : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCollisionAabbTreeIndex();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
// Option 1: First child index
|
||||||
|
int GetFirstChildIndex() const;
|
||||||
|
void SetFirstChildIndex(int index);
|
||||||
|
|
||||||
|
// Option 2: Partition index
|
||||||
|
int GetPartitionIndex() const;
|
||||||
|
void SetPartitionIndex(int index);
|
||||||
|
|
||||||
|
private:
|
||||||
|
union {
|
||||||
|
int mFirstChildIndex = 0;
|
||||||
|
int mPartitionIndex = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCOLLISIONAABBTREEINDEX_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
60
libs/xassets/xcollisionborder.cpp
Normal file
60
libs/xassets/xcollisionborder.cpp
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include "xcollisionborder.h"
|
||||||
|
|
||||||
|
XCollisionBorder::XCollisionBorder()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionBorder::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)mDistEq, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)&mZBase, sizeof(float));
|
||||||
|
aStream->read((char*)&mZSlope, sizeof(float));
|
||||||
|
aStream->read((char*)&mStart, sizeof(float));
|
||||||
|
aStream->read((char*)&mLength, sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XCollisionBorder::GetDistEq() const {
|
||||||
|
return mDistEq;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionBorder::SetDistEq(const float* distEq, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mDistEq, distEq, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float XCollisionBorder::GetZBase() const {
|
||||||
|
return mZBase;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionBorder::SetZBase(float zBase) {
|
||||||
|
mZBase = zBase;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XCollisionBorder::GetZSlope() const {
|
||||||
|
return mZSlope;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionBorder::SetZSlope(float zSlope) {
|
||||||
|
mZSlope = zSlope;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XCollisionBorder::GetStart() const {
|
||||||
|
return mStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionBorder::SetStart(float start) {
|
||||||
|
mStart = start;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XCollisionBorder::GetLength() const {
|
||||||
|
return mLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionBorder::SetLength(float length) {
|
||||||
|
mLength = length;
|
||||||
|
}
|
||||||
|
|
||||||
47
libs/xassets/xcollisionborder.h
Normal file
47
libs/xassets/xcollisionborder.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCOLLISIONBORDER_H
|
||||||
|
#define XCOLLISIONBORDER_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XCollisionBorder : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCollisionBorder();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const float* GetDistEq() const;
|
||||||
|
void SetDistEq(const float* distEq, size_t count = 3);
|
||||||
|
|
||||||
|
float GetZBase() const;
|
||||||
|
void SetZBase(float zBase);
|
||||||
|
|
||||||
|
float GetZSlope() const;
|
||||||
|
void SetZSlope(float zSlope);
|
||||||
|
|
||||||
|
float GetStart() const;
|
||||||
|
void SetStart(float start);
|
||||||
|
|
||||||
|
float GetLength() const;
|
||||||
|
void SetLength(float length);
|
||||||
|
|
||||||
|
private:
|
||||||
|
float mDistEq[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
float mZBase = 0.0f;
|
||||||
|
float mZSlope = 0.0f;
|
||||||
|
float mStart = 0.0f;
|
||||||
|
float mLength = 0.0f;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCOLLISIONBORDER_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
58
libs/xassets/xcollisionpartition.cpp
Normal file
58
libs/xassets/xcollisionpartition.cpp
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcollisionpartition.h"
|
||||||
|
|
||||||
|
XCollisionPartition::XCollisionPartition()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionPartition::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mTriCount, sizeof(quint8));
|
||||||
|
aStream->read((char*)&mBorderCount, sizeof(quint8));
|
||||||
|
aStream->read((char*)&mFirstTri, sizeof(int));
|
||||||
|
|
||||||
|
// We would parse borders here, but we're using a placeholder
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XCollisionPartition::GetTriCount() const {
|
||||||
|
return mTriCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionPartition::SetTriCount(quint8 count) {
|
||||||
|
mTriCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XCollisionPartition::GetBorderCount() const {
|
||||||
|
return mBorderCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionPartition::SetBorderCount(quint8 count) {
|
||||||
|
mBorderCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XCollisionPartition::GetFirstTri() const {
|
||||||
|
return mFirstTri;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionPartition::SetFirstTri(int firstTri) {
|
||||||
|
mFirstTri = firstTri;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* XCollisionPartition::GetBorders() const {
|
||||||
|
return mBorders;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCollisionPartition::SetBorders(void* borders) {
|
||||||
|
mBorders = borders;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
47
libs/xassets/xcollisionpartition.h
Normal file
47
libs/xassets/xcollisionpartition.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCOLLISIONPARTITION_H
|
||||||
|
#define XCOLLISIONPARTITION_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class CollisionBorder; // Forward declaration
|
||||||
|
|
||||||
|
class XCollisionPartition : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCollisionPartition();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint8 GetTriCount() const;
|
||||||
|
void SetTriCount(quint8 count);
|
||||||
|
|
||||||
|
quint8 GetBorderCount() const;
|
||||||
|
void SetBorderCount(quint8 count);
|
||||||
|
|
||||||
|
int GetFirstTri() const;
|
||||||
|
void SetFirstTri(int firstTri);
|
||||||
|
|
||||||
|
// Note: In a real implementation, we would have proper handling for borders pointer
|
||||||
|
// For now, we'll just use a placeholder
|
||||||
|
void* GetBorders() const;
|
||||||
|
void SetBorders(void* borders);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint8 mTriCount = 0;
|
||||||
|
quint8 mBorderCount = 0;
|
||||||
|
int mFirstTri = 0;
|
||||||
|
void* mBorders = nullptr; // Placeholder for CollisionBorder*
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCOLLISIONPARTITION_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
93
libs/xassets/xcstaticmodels.cpp
Normal file
93
libs/xassets/xcstaticmodels.cpp
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcstaticmodels.h"
|
||||||
|
|
||||||
|
XCStaticModel_s::XCStaticModel_s()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCStaticModel_s::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
// Parse writable
|
||||||
|
mWritable.ParseData(aStream);
|
||||||
|
|
||||||
|
// We would parse xmodel here, but we're using a placeholder
|
||||||
|
|
||||||
|
// Parse origin
|
||||||
|
aStream->read((char*)mOrigin, 3 * sizeof(float));
|
||||||
|
|
||||||
|
// Parse invScaledAxis
|
||||||
|
for (int i = 0; i < 3; ++i) {
|
||||||
|
aStream->read((char*)mInvScaledAxis[i], 3 * sizeof(float));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse absmin and absmax
|
||||||
|
aStream->read((char*)mAbsmin, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)mAbsmax, 3 * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const XCStaticModelWritable& XCStaticModel_s::GetWritable() const {
|
||||||
|
return mWritable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCStaticModel_s::SetWritable(const XCStaticModelWritable& writable) {
|
||||||
|
mWritable = writable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* XCStaticModel_s::GetXModel() const {
|
||||||
|
return mXModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCStaticModel_s::SetXModel(void* model) {
|
||||||
|
mXModel = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XCStaticModel_s::GetOrigin() const {
|
||||||
|
return mOrigin;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCStaticModel_s::SetOrigin(const float* origin, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mOrigin, origin, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XCStaticModel_s::GetInvScaledAxis() const {
|
||||||
|
return &mInvScaledAxis[0][0];
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCStaticModel_s::SetInvScaledAxis(const float* axis, size_t rows, size_t cols) {
|
||||||
|
if (rows <= 3 && cols <= 3) {
|
||||||
|
for (size_t i = 0; i < rows; ++i) {
|
||||||
|
memcpy(mInvScaledAxis[i], &axis[i * cols], cols * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XCStaticModel_s::GetAbsmin() const {
|
||||||
|
return mAbsmin;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCStaticModel_s::SetAbsmin(const float* absmin, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mAbsmin, absmin, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XCStaticModel_s::GetAbsmax() const {
|
||||||
|
return mAbsmax;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCStaticModel_s::SetAbsmax(const float* absmax, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mAbsmax, absmax, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
56
libs/xassets/xcstaticmodels.h
Normal file
56
libs/xassets/xcstaticmodels.h
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCSTATICMODELS_H
|
||||||
|
#define XCSTATICMODELS_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xcstaticmodelwritable.h"
|
||||||
|
|
||||||
|
class XModel; // Forward declaration
|
||||||
|
|
||||||
|
class XCStaticModel_s : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCStaticModel_s();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const XCStaticModelWritable& GetWritable() const;
|
||||||
|
void SetWritable(const XCStaticModelWritable& writable);
|
||||||
|
|
||||||
|
// Note: In a real implementation, we would have an XModel class
|
||||||
|
// For now, we'll just use a pointer to Model as a placeholder
|
||||||
|
void* GetXModel() const;
|
||||||
|
void SetXModel(void* model);
|
||||||
|
|
||||||
|
const float* GetOrigin() const;
|
||||||
|
void SetOrigin(const float* origin, size_t count = 3);
|
||||||
|
|
||||||
|
const float* GetInvScaledAxis() const;
|
||||||
|
void SetInvScaledAxis(const float* axis, size_t rows = 3, size_t cols = 3);
|
||||||
|
|
||||||
|
const float* GetAbsmin() const;
|
||||||
|
void SetAbsmin(const float* absmin, size_t count = 3);
|
||||||
|
|
||||||
|
const float* GetAbsmax() const;
|
||||||
|
void SetAbsmax(const float* absmax, size_t count = 3);
|
||||||
|
|
||||||
|
private:
|
||||||
|
XCStaticModelWritable mWritable;
|
||||||
|
void* mXModel = nullptr; // Placeholder for Model*
|
||||||
|
float mOrigin[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
float mInvScaledAxis[3][3] = {{0.0f}};
|
||||||
|
float mAbsmin[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
float mAbsmax[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCSTATICMODELS_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
28
libs/xassets/xcstaticmodelwritable.cpp
Normal file
28
libs/xassets/xcstaticmodelwritable.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xcstaticmodelwritable.h"
|
||||||
|
|
||||||
|
XCStaticModelWritable::XCStaticModelWritable()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCStaticModelWritable::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mNextModelInWorldSector, sizeof(quint16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XCStaticModelWritable::GetNextModelInWorldSector() const {
|
||||||
|
return mNextModelInWorldSector;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XCStaticModelWritable::SetNextModelInWorldSector(quint16 nextModel) {
|
||||||
|
mNextModelInWorldSector = nextModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
29
libs/xassets/xcstaticmodelwritable.h
Normal file
29
libs/xassets/xcstaticmodelwritable.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XCSTATICMODELWRITABLE_H
|
||||||
|
#define XCSTATICMODELWRITABLE_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XCStaticModelWritable : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XCStaticModelWritable();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint16 GetNextModelInWorldSector() const;
|
||||||
|
void SetNextModelInWorldSector(quint16 nextModel);
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint16 mNextModelInWorldSector = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XCSTATICMODELWRITABLE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
25
libs/xassets/xd3dbasetexture.cpp
Normal file
25
libs/xassets/xd3dbasetexture.cpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include "xd3dbasetexture.h"
|
||||||
|
|
||||||
|
XD3DBaseTexture::XD3DBaseTexture()
|
||||||
|
: XAsset()
|
||||||
|
, mMipFlush(0)
|
||||||
|
, mFormat(new XGpuTextureFetchConstant())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XD3DBaseTexture::~XD3DBaseTexture()
|
||||||
|
{
|
||||||
|
delete mFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XD3DBaseTexture::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void XD3DBaseTexture::Clear()
|
||||||
|
{
|
||||||
|
mMipFlush = 0;
|
||||||
|
mFormat->Clear();
|
||||||
|
}
|
||||||
22
libs/xassets/xd3dbasetexture.h
Normal file
22
libs/xassets/xd3dbasetexture.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef XD3DBASETEXTURE_H
|
||||||
|
#define XD3DBASETEXTURE_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xd3dresource.h"
|
||||||
|
|
||||||
|
class XD3DBaseTexture : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
XD3DBaseTexture();
|
||||||
|
~XD3DBaseTexture();
|
||||||
|
|
||||||
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
unsigned int mMipFlush;
|
||||||
|
XGpuTextureFetchConstant* mFormat;
|
||||||
|
XD3DResource* mResource;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XD3DBASETEXTURE_H
|
||||||
31
libs/xassets/xd3dcubetexture.cpp
Normal file
31
libs/xassets/xd3dcubetexture.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include "xgfximageloaddef.h"
|
||||||
|
|
||||||
|
XGfxImageLoadDef::XGfxImageLoadDef()
|
||||||
|
: XAsset()
|
||||||
|
, mLevelCount(0)
|
||||||
|
, mFlags(0)
|
||||||
|
, mDimensions(QVector<qint16>(3))
|
||||||
|
, mFormat(0)
|
||||||
|
, mTexture(new XGfxTexture())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XGfxImageLoadDef::~XGfxImageLoadDef()
|
||||||
|
{
|
||||||
|
delete mTexture;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxImageLoadDef::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxImageLoadDef::Clear()
|
||||||
|
{
|
||||||
|
mLevelCount = 0;
|
||||||
|
mFlags = 0;
|
||||||
|
mDimensions = QVector<qint16>(3);
|
||||||
|
mFormat = 0;
|
||||||
|
mTexture->Clear();
|
||||||
|
}
|
||||||
23
libs/xassets/xd3dcubetexture.h
Normal file
23
libs/xassets/xd3dcubetexture.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef XGFXIMAGELOADDEF_H
|
||||||
|
#define XGFXIMAGELOADDEF_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XGfxImageLoadDef : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
XGfxImageLoadDef();
|
||||||
|
~XGfxImageLoadDef();
|
||||||
|
|
||||||
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint8 mLevelCount;
|
||||||
|
quint8 mFlags;
|
||||||
|
QVector<qint16> mDimensions;
|
||||||
|
int mFormat;
|
||||||
|
XGfxTexture* mTexture;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XGFXIMAGELOADDEF_H
|
||||||
39
libs/xassets/xd3dresource.cpp
Normal file
39
libs/xassets/xd3dresource.cpp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#include "xd3dresource.h"
|
||||||
|
|
||||||
|
XD3DResource::XD3DResource()
|
||||||
|
: XAsset()
|
||||||
|
, mCommon(0)
|
||||||
|
, mReferenceCount(0)
|
||||||
|
, mFence(0)
|
||||||
|
, mReadFence(0)
|
||||||
|
, mIdentifier(0)
|
||||||
|
, mBaseFlush(0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XD3DResource::~XD3DResource()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void XD3DResource::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
*aStream
|
||||||
|
>> mCommon
|
||||||
|
>> mReferenceCount
|
||||||
|
>> mFence
|
||||||
|
>> mReadFence
|
||||||
|
>> mIdentifier
|
||||||
|
>> mBaseFlush;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XD3DResource::Clear()
|
||||||
|
{
|
||||||
|
mCommon = 0;
|
||||||
|
mReferenceCount = 0;
|
||||||
|
mFence = 0;
|
||||||
|
mReadFence = 0;
|
||||||
|
mIdentifier = 0;
|
||||||
|
mBaseFlush = 0;
|
||||||
|
}
|
||||||
25
libs/xassets/xd3dresource.h
Normal file
25
libs/xassets/xd3dresource.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#ifndef XD3DRESOURCE_H
|
||||||
|
#define XD3DRESOURCE_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XD3DResource : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
XD3DResource();
|
||||||
|
~XD3DResource();
|
||||||
|
|
||||||
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
unsigned int mCommon;
|
||||||
|
unsigned int mReferenceCount;
|
||||||
|
unsigned int mFence;
|
||||||
|
unsigned int mReadFence;
|
||||||
|
unsigned int mIdentifier;
|
||||||
|
unsigned int mBaseFlush;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // XD3DRESOURCE_H
|
||||||
31
libs/xassets/xd3dvolumetexture.cpp
Normal file
31
libs/xassets/xd3dvolumetexture.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include "xgfximageloaddef.h"
|
||||||
|
|
||||||
|
XGfxImageLoadDef::XGfxImageLoadDef()
|
||||||
|
: XAsset()
|
||||||
|
, mLevelCount(0)
|
||||||
|
, mFlags(0)
|
||||||
|
, mDimensions(QVector<qint16>(3))
|
||||||
|
, mFormat(0)
|
||||||
|
, mTexture(new XGfxTexture())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XGfxImageLoadDef::~XGfxImageLoadDef()
|
||||||
|
{
|
||||||
|
delete mTexture;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxImageLoadDef::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxImageLoadDef::Clear()
|
||||||
|
{
|
||||||
|
mLevelCount = 0;
|
||||||
|
mFlags = 0;
|
||||||
|
mDimensions = QVector<qint16>(3);
|
||||||
|
mFormat = 0;
|
||||||
|
mTexture->Clear();
|
||||||
|
}
|
||||||
23
libs/xassets/xd3dvolumetexture.h
Normal file
23
libs/xassets/xd3dvolumetexture.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef XGFXIMAGELOADDEF_H
|
||||||
|
#define XGFXIMAGELOADDEF_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XGfxImageLoadDef : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
XGfxImageLoadDef();
|
||||||
|
~XGfxImageLoadDef();
|
||||||
|
|
||||||
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint8 mLevelCount;
|
||||||
|
quint8 mFlags;
|
||||||
|
QVector<qint16> mDimensions;
|
||||||
|
int mFormat;
|
||||||
|
XGfxTexture* mTexture;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XGFXIMAGELOADDEF_H
|
||||||
50
libs/xassets/xdmaterial.cpp
Normal file
50
libs/xassets/xdmaterial.cpp
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xdmaterial.h"
|
||||||
|
|
||||||
|
XDmaterial_t::XDmaterial_t()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XDmaterial_t::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
char material[64];
|
||||||
|
aStream->read(material, 64);
|
||||||
|
mMaterial = QString::fromUtf8(material);
|
||||||
|
|
||||||
|
aStream->read((char*)&mSurfaceFlags, sizeof(int));
|
||||||
|
aStream->read((char*)&mContentFlags, sizeof(int));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString& XDmaterial_t::GetMaterial() const {
|
||||||
|
return mMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XDmaterial_t::SetMaterial(const QString& material) {
|
||||||
|
mMaterial = material;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XDmaterial_t::GetSurfaceFlags() const {
|
||||||
|
return mSurfaceFlags;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XDmaterial_t::SetSurfaceFlags(int flags) {
|
||||||
|
mSurfaceFlags = flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XDmaterial_t::GetContentFlags() const {
|
||||||
|
return mContentFlags;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XDmaterial_t::SetContentFlags(int flags) {
|
||||||
|
mContentFlags = flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
40
libs/xassets/xdmaterial.h
Normal file
40
libs/xassets/xdmaterial.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XDMATERIAL_H
|
||||||
|
#define XDMATERIAL_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class XDmaterial_t : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XDmaterial_t();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
const QString& GetMaterial() const;
|
||||||
|
void SetMaterial(const QString& material);
|
||||||
|
|
||||||
|
int GetSurfaceFlags() const;
|
||||||
|
void SetSurfaceFlags(int flags);
|
||||||
|
|
||||||
|
int GetContentFlags() const;
|
||||||
|
void SetContentFlags(int flags);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString mMaterial = "";
|
||||||
|
int mSurfaceFlags = 0;
|
||||||
|
int mContentFlags = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XDMATERIAL_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
21
libs/xassets/xgameworld.cpp
Normal file
21
libs/xassets/xgameworld.cpp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xgameworld.h"
|
||||||
|
|
||||||
|
XGameWorld::XGameWorld()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGameWorld::ParseData(QDataStream *aStream) {
|
||||||
|
// Implement parsing logic here based on the GameWorldSp and GameWorldMp structures
|
||||||
|
|
||||||
|
// Parse both sp and mp parts using our new classes
|
||||||
|
sp.ParseData(aStream);
|
||||||
|
mp.ParseData(aStream);
|
||||||
|
|
||||||
|
// TODO: Add any additional parsing code if needed
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
25
libs/xassets/xgameworld.h
Normal file
25
libs/xassets/xgameworld.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XGAMEWORLD_H
|
||||||
|
#define XGAMEWORLD_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "gameworld.h"
|
||||||
|
#include "xgameworldmp.h"
|
||||||
|
#include "xgameworldsp.h"
|
||||||
|
|
||||||
|
class XGameWorld : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XGameWorld();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
XGameWorldSp sp;
|
||||||
|
XGameWorldMp mp;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XGAMEWORLD_H
|
||||||
|
|
||||||
25
libs/xassets/xgameworldmp.cpp
Normal file
25
libs/xassets/xgameworldmp.cpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xgameworldmp.h"
|
||||||
|
|
||||||
|
XGameWorldMp::XGameWorldMp()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGameWorldMp::ParseData(QDataStream *aStream) {
|
||||||
|
// Parse the name string
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
mName = XString::ParseCustom(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString XGameWorldMp::GetName() const {
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGameWorldMp::SetName(const QString& name) {
|
||||||
|
mName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
23
libs/xassets/xgameworldmp.h
Normal file
23
libs/xassets/xgameworldmp.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef XGAMEWORLDMP_H
|
||||||
|
#define XGAMEWORLDMP_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XGameWorldMp : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XGameWorldMp();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
QString GetName() const;
|
||||||
|
void SetName(const QString& name);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString mName;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XGAMEWORLDMP_H
|
||||||
|
|
||||||
26
libs/xassets/xgameworldsp.cpp
Normal file
26
libs/xassets/xgameworldsp.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include "xgameworldsp.h"
|
||||||
|
|
||||||
|
XGameWorldSp::XGameWorldSp()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGameWorldSp::ParseData(QDataStream *aStream) {
|
||||||
|
// Parse the name string
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
mName = XString::ParseCustom(aStream);
|
||||||
|
|
||||||
|
// Parse the path data using our new XPathData class
|
||||||
|
path.ParseData(aStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString XGameWorldSp::GetName() const {
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGameWorldSp::SetName(const QString& name) {
|
||||||
|
mName = name;
|
||||||
|
}
|
||||||
|
|
||||||
26
libs/xassets/xgameworldsp.h
Normal file
26
libs/xassets/xgameworldsp.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef XGAMEWORLDSP_H
|
||||||
|
#define XGAMEWORLDSP_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "gameworld.h"
|
||||||
|
#include "xpathdata.h"
|
||||||
|
|
||||||
|
class XGameWorldSp : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XGameWorldSp();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
QString GetName() const;
|
||||||
|
void SetName(const QString& name);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString mName;
|
||||||
|
XPathData path; // Using our new XPathData class instead of PathData struct
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XGAMEWORLDSP_H
|
||||||
|
|
||||||
1
libs/xassets/xgfximage.cpp
Normal file
1
libs/xassets/xgfximage.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "xgfximage.h"
|
||||||
31
libs/xassets/xgfximage.h
Normal file
31
libs/xassets/xgfximage.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef XGFXIMAGE_H
|
||||||
|
#define XGFXIMAGE_H
|
||||||
|
|
||||||
|
#include "material.h"
|
||||||
|
#include "xasset.h"
|
||||||
|
#include "xcardmemory.h"
|
||||||
|
|
||||||
|
class XGfxImage : public XAsset
|
||||||
|
{
|
||||||
|
MapType mapType;
|
||||||
|
XGfxTexture texture;
|
||||||
|
quint8 semantic;
|
||||||
|
XCardMemory cardMemory;
|
||||||
|
quint16 width;
|
||||||
|
quint16 height;
|
||||||
|
quint16 depth;
|
||||||
|
quint8 category;
|
||||||
|
bool delayLoadPixels;
|
||||||
|
|
||||||
|
qint32 pixelsPtr;
|
||||||
|
quint8 *pixels;
|
||||||
|
|
||||||
|
unsigned int baseSize;
|
||||||
|
quint16 streamSlot;
|
||||||
|
bool streaming;
|
||||||
|
|
||||||
|
qint32 namePtr;
|
||||||
|
QString name;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XGFXIMAGE_H
|
||||||
31
libs/xassets/xgfximageloaddef.cpp
Normal file
31
libs/xassets/xgfximageloaddef.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include "xgfximageloaddef.h"
|
||||||
|
|
||||||
|
XGfxImageLoadDef::XGfxImageLoadDef()
|
||||||
|
: XAsset()
|
||||||
|
, mLevelCount(0)
|
||||||
|
, mFlags(0)
|
||||||
|
, mDimensions(QVector<qint16>(3))
|
||||||
|
, mFormat(0)
|
||||||
|
, mTexture(new XGfxTexture())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XGfxImageLoadDef::~XGfxImageLoadDef()
|
||||||
|
{
|
||||||
|
delete mTexture;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxImageLoadDef::ParseData(QDataStream *aStream)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxImageLoadDef::Clear()
|
||||||
|
{
|
||||||
|
mLevelCount = 0;
|
||||||
|
mFlags = 0;
|
||||||
|
mDimensions = QVector<qint16>(3);
|
||||||
|
mFormat = 0;
|
||||||
|
mTexture->Clear();
|
||||||
|
}
|
||||||
23
libs/xassets/xgfximageloaddef.h
Normal file
23
libs/xassets/xgfximageloaddef.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef XGFXIMAGELOADDEF_H
|
||||||
|
#define XGFXIMAGELOADDEF_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XGfxImageLoadDef : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
XGfxImageLoadDef();
|
||||||
|
~XGfxImageLoadDef();
|
||||||
|
|
||||||
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
|
virtual void Clear() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
quint8 mLevelCount;
|
||||||
|
quint8 mFlags;
|
||||||
|
QVector<qint16> mDimensions;
|
||||||
|
int mFormat;
|
||||||
|
XGfxTexture* mTexture;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XGFXIMAGELOADDEF_H
|
||||||
129
libs/xassets/xgfxlight.cpp
Normal file
129
libs/xassets/xgfxlight.cpp
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "xgfxlight.h"
|
||||||
|
|
||||||
|
XGfxLight::XGfxLight()
|
||||||
|
: XAsset() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::ParseData(QDataStream *aStream) {
|
||||||
|
if (GetPtr() == -1) {
|
||||||
|
aStream->read((char*)&mType, sizeof(unsigned char));
|
||||||
|
aStream->read((char*)&mCanUseShadowMap, sizeof(unsigned char));
|
||||||
|
aStream->ignore(sizeof(unsigned char) * 2); // Skip unused bytes
|
||||||
|
aStream->read((char*)mColor, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)mDir, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)mOrigin, 3 * sizeof(float));
|
||||||
|
aStream->read((char*)&mRadius, sizeof(float));
|
||||||
|
aStream->read((char*)&mCosHalfFovOuter, sizeof(float));
|
||||||
|
aStream->read((char*)&mCosHalfFovInner, sizeof(float));
|
||||||
|
aStream->read((char*)&mExponent, sizeof(int));
|
||||||
|
|
||||||
|
// Skip spotShadowIndex - we'll handle this appropriately later
|
||||||
|
aStream->ignore(sizeof(unsigned int));
|
||||||
|
|
||||||
|
// Skip def pointer - we'll handle this appropriately later
|
||||||
|
aStream->ignore(sizeof(int));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char XGfxLight::GetType() const {
|
||||||
|
return mType;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetType(unsigned char type) {
|
||||||
|
mType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char XGfxLight::CanUseShadowMap() const {
|
||||||
|
return mCanUseShadowMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetCanUseShadowMap(bool canUse) {
|
||||||
|
mCanUseShadowMap = canUse ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XGfxLight::GetColor() const {
|
||||||
|
return mColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetColor(const float* color, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mColor, color, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XGfxLight::GetDir() const {
|
||||||
|
return mDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetDir(const float* dir, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mDir, dir, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const float* XGfxLight::GetOrigin() const {
|
||||||
|
return mOrigin;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetOrigin(const float* origin, size_t count) {
|
||||||
|
if (count <= 3) {
|
||||||
|
memcpy(mOrigin, origin, count * sizeof(float));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float XGfxLight::GetRadius() const {
|
||||||
|
return mRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetRadius(float radius) {
|
||||||
|
mRadius = radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XGfxLight::GetCosHalfFovOuter() const {
|
||||||
|
return mCosHalfFovOuter;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetCosHalfFovOuter(float cosHalfFov) {
|
||||||
|
mCosHalfFovOuter = cosHalfFov;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XGfxLight::GetCosHalfFovInner() const {
|
||||||
|
return mCosHalfFovInner;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetCosHalfFovInner(float cosHalfFov) {
|
||||||
|
mCosHalfFovInner = cosHalfFov;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XGfxLight::GetExponent() const {
|
||||||
|
return mExponent;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetExponent(int exponent) {
|
||||||
|
mExponent = exponent;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int XGfxLight::GetSpotShadowIndex() const {
|
||||||
|
return mSpotShadowIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetSpotShadowIndex(unsigned int index) {
|
||||||
|
mSpotShadowIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XGfxLight::GetDefPtr() const {
|
||||||
|
return mDefPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XGfxLight::SetDefPtr(int ptr) {
|
||||||
|
mDefPtr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
79
libs/xassets/xgfxlight.h
Normal file
79
libs/xassets/xgfxlight.h
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef XGFXLIGHT_H
|
||||||
|
#define XGFXLIGHT_H
|
||||||
|
|
||||||
|
#include "xasset.h"
|
||||||
|
|
||||||
|
class XGfxLight : public XAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XGfxLight();
|
||||||
|
|
||||||
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
unsigned char GetType() const;
|
||||||
|
void SetType(unsigned char type);
|
||||||
|
|
||||||
|
unsigned char CanUseShadowMap() const;
|
||||||
|
void SetCanUseShadowMap(bool canUse);
|
||||||
|
|
||||||
|
const float* GetColor() const;
|
||||||
|
void SetColor(const float* color, size_t count = 3);
|
||||||
|
|
||||||
|
const float* GetDir() const;
|
||||||
|
void SetDir(const float* dir, size_t count = 3);
|
||||||
|
|
||||||
|
const float* GetOrigin() const;
|
||||||
|
void SetOrigin(const float* origin, size_t count = 3);
|
||||||
|
|
||||||
|
float GetRadius() const;
|
||||||
|
void SetRadius(float radius);
|
||||||
|
|
||||||
|
float GetCosHalfFovOuter() const;
|
||||||
|
void SetCosHalfFovOuter(float cosHalfFov);
|
||||||
|
|
||||||
|
float GetCosHalfFovInner() const;
|
||||||
|
void SetCosHalfFovInner(float cosHalfFov);
|
||||||
|
|
||||||
|
int GetExponent() const;
|
||||||
|
void SetExponent(int exponent);
|
||||||
|
|
||||||
|
unsigned int GetSpotShadowIndex() const;
|
||||||
|
void SetSpotShadowIndex(unsigned int index);
|
||||||
|
|
||||||
|
// Note: XGfxLightDef is a placeholder - we need to handle this appropriately
|
||||||
|
int GetDefPtr() const;
|
||||||
|
void SetDefPtr(int ptr);
|
||||||
|
|
||||||
|
private:
|
||||||
|
unsigned char mType = 0;
|
||||||
|
unsigned char mCanUseShadowMap = 0;
|
||||||
|
unsigned char mUnused[2] = {0, 0};
|
||||||
|
float mColor[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
float mDir[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
float mOrigin[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
float mRadius = 0.0f;
|
||||||
|
float mCosHalfFovOuter = 0.0f;
|
||||||
|
float mCosHalfFovInner = 0.0f;
|
||||||
|
int mExponent = 0;
|
||||||
|
unsigned int mSpotShadowIndex = 0;
|
||||||
|
int mDefPtr = 0; // Placeholder for XGfxLightDef pointer
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XGFXLIGHT_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user