SBSPSS/tools/Data/include/dstructs.h

220 lines
4.0 KiB
C
Raw Normal View History

2000-12-12 21:56:51 +01:00
/***********************/
/*** Data Structures ***/
/***********************/
#ifndef __DATA_STRUCTS_HEADER__
#define __DATA_STRUCTS_HEADER__
2000-12-06 23:21:55 +01:00
//***************************************************************************
// biped bone IDs
/*
enum BONE_NAME
{
BIP0,
BIP01_PELVI,
BIP01_SPIN,
BIP01_SPINE,
BIP01_NEC,
BIP01_HEA,
BIP01_L_CLAVICL,
BIP01_L_UPPERAR,
BIP01_L_FOREAR,
BIP01_L_HAN,
BIP01_R_CLAVICL,
BIP01_R_UPPERAR,
BIP01_R_FOREAR,
BIP01_R_HAN,
BIP01_L_THIG,
BIP01_L_CAL,
BIP01_L_FOO,
BIP01_L_TOE,
BIP01_R_THIG,
BIP01_R_CAL,
BIP01_R_FOO,
BIP01_R_TOE0,
MAX_BONE
};
*/
//***************************************************************************
#ifndef sQuat
struct sQuat
{
s16 vx,vy,vz,vw;
};
#endif
struct sShortXYZ
{
s16 vx,vy,vz;
};
//***************************************************************************
struct sVtx
{
s16 vx, vy, vz, pad;
2000-12-12 21:56:51 +01:00
#ifdef WIN32
bool operator==(sVtx const &v1) {return((vx==v1.vx) && (vy==v1.vy) && (vz==v1.vz));}
#endif
2000-12-06 23:21:55 +01:00
};
#define NormalScale 4096
struct sNormal
{
s16 nX,nY,nZ,pD;
};
//---------------------------------------------------------------------------
struct sBBox
{
s16 XMin,YMin,ZMin;
s16 XMax,YMax,ZMax;
};
//***************************************************************************
struct sMat
{
u16 TPage;
u16 Clut;
// s32 DblFlag;
};
//***************************************************************************
struct sTri
{
2000-12-14 17:38:34 +01:00
u16 P0; // 2
u16 P1; // 2
2000-12-06 23:21:55 +01:00
u8 uv0[2]; // 2
2000-12-14 17:38:34 +01:00
u16 Clut; // 2
2000-12-06 23:21:55 +01:00
u8 uv1[2]; // 2
2000-12-14 17:38:34 +01:00
u16 TPage; // 2
2000-12-06 23:21:55 +01:00
u8 uv2[2]; // 2
2000-12-14 17:38:34 +01:00
u16 P2; // 2
2000-12-12 21:56:51 +01:00
}; // 16
2000-12-06 23:21:55 +01:00
// u8 r0, g0, b0, code; // 4
// u8 r1, g1, b1, Mat; // 4
// u8 r2, g2, b2; // 3
// s8 OtOfs; // 1
//---------------------------------------------------------------------------
struct sQuad
{
u16 P0,P1,P2,P3; // 8
u8 uv0[2]; // 2
u8 uv1[2]; // 2
u8 uv2[2]; // 2
u8 uv3[2]; // 2
2000-12-12 21:56:51 +01:00
u16 TPage; // 2
u16 Clut; // 2
2000-12-06 23:21:55 +01:00
}; // 20
// u8 r0, g0, b0, code; // 4
// u8 r1, g1, b1, Mat; // 4
// u8 r2, g2, b2; // 3
// s8 OtOfs; // 1
// u8 r3, g3, b3, Pad3; // 4
//***************************************************************************
/*
struct sWeight
{
s16 X,Y,Z,VtxNo;
};
*/
//***************************************************************************
/*
struct sBone
{
SVECTOR BoneSize; // 8
s16 Parent,Idx;
s32 WeightCount; // 4
sWeight *WeightList;
}; // 16
*/
//***************************************************************************
//***************************************************************************
//***************************************************************************
// Tiles
struct sTileMapElem
{
2000-12-14 17:38:34 +01:00
u16 Tile;
2000-12-06 23:21:55 +01:00
};
struct sTile
{
// 3d Tile
u16 TriList;
u16 TriCount;
u16 QuadList;
u16 QuadCount;
// 2d Tile
2000-12-14 17:38:34 +01:00
u8 u0,v0;
2000-12-12 21:56:51 +01:00
u16 Clut;
2000-12-14 17:38:34 +01:00
u16 TPage;
u16 Pad; // :o( need this?
2000-12-12 21:56:51 +01:00
#ifdef WIN32
bool operator==(sTile const &v1)
{
if (TriCount!=v1.TriCount) return(false);
if (TriList!=v1.TriList) return(false);
// if (QuadCount!=v1.QuadCount) return(false);
// if (QuadList!=v1.QuadList) return(false);
if (TPage!=v1.TPage) return(false);
2000-12-14 17:38:34 +01:00
if (u0!=v1.u0) return(false);
if (v0!=v1.v0) return(false);
2000-12-06 23:21:55 +01:00
return(TRUE);
}
2000-12-12 21:56:51 +01:00
#endif
};
//---------------------------------------------------------------------------
// Layers
struct sLayerHdr
{
int Type;
int SubType;
int Width;
int Height;
/*int TileData[W][H];....*/
};
//---------------------------------------------------------------------------
// Header
struct sLvlHdr
{
// sTri *TriList;
// sQuad *QuadList;
// sVtx *VtxList;
// sMat *MatList;
// sTile *TileList;
// int LayerCount;
/*int LayerOfs[LayerCount]...*/
u32 TriList;
u32 QuadList;
u32 VtxList;
u32 TileList;
// Layers
u32 BackLayer;
u32 MidLayer;
u32 ActionLayer;
u32 ForeLayer;
u32 Pad0;
u32 Pad1;
u32 Pad2;
u32 Pad3;
u32 Pad4;
u32 Pad5;
u32 Pad6;
u32 Pad7;
2000-12-06 23:21:55 +01:00
};
2000-12-12 21:56:51 +01:00
2000-12-06 23:21:55 +01:00
#endif