|
@@ -61,7 +61,6 @@ http://themdcfile.planetwolfenstein.gamespy.com/MDC_File_Format.pdf
|
|
namespace Assimp {
|
|
namespace Assimp {
|
|
namespace MDC {
|
|
namespace MDC {
|
|
|
|
|
|
-
|
|
|
|
// to make it easier for us, we test the magic word against both "endianesses"
|
|
// to make it easier for us, we test the magic word against both "endianesses"
|
|
#define AI_MDC_MAGIC_NUMBER_BE AI_MAKE_MAGIC("CPDI")
|
|
#define AI_MDC_MAGIC_NUMBER_BE AI_MAKE_MAGIC("CPDI")
|
|
#define AI_MDC_MAGIC_NUMBER_LE AI_MAKE_MAGIC("IDPC")
|
|
#define AI_MDC_MAGIC_NUMBER_LE AI_MAKE_MAGIC("IDPC")
|
|
@@ -79,8 +78,7 @@ namespace MDC {
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** \brief Data structure for a MDC file's main header
|
|
/** \brief Data structure for a MDC file's main header
|
|
*/
|
|
*/
|
|
-struct Header
|
|
|
|
-{
|
|
|
|
|
|
+struct Header {
|
|
uint32_t ulIdent ;
|
|
uint32_t ulIdent ;
|
|
uint32_t ulVersion ;
|
|
uint32_t ulVersion ;
|
|
char ucName [ AI_MDC_MAXQPATH ] ;
|
|
char ucName [ AI_MDC_MAXQPATH ] ;
|
|
@@ -100,8 +98,7 @@ struct Header
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** \brief Data structure for a MDC file's surface header
|
|
/** \brief Data structure for a MDC file's surface header
|
|
*/
|
|
*/
|
|
-struct Surface
|
|
|
|
-{
|
|
|
|
|
|
+struct Surface {
|
|
uint32_t ulIdent ;
|
|
uint32_t ulIdent ;
|
|
char ucName [ AI_MDC_MAXQPATH ] ;
|
|
char ucName [ AI_MDC_MAXQPATH ] ;
|
|
uint32_t ulFlags ;
|
|
uint32_t ulFlags ;
|
|
@@ -120,7 +117,6 @@ struct Surface
|
|
uint32_t ulOffsetEnd;
|
|
uint32_t ulOffsetEnd;
|
|
Surface() AI_NO_EXCEPT
|
|
Surface() AI_NO_EXCEPT
|
|
: ulIdent()
|
|
: ulIdent()
|
|
- , ucName{ 0 }
|
|
|
|
, ulFlags()
|
|
, ulFlags()
|
|
, ulNumCompFrames()
|
|
, ulNumCompFrames()
|
|
, ulNumBaseFrames()
|
|
, ulNumBaseFrames()
|
|
@@ -142,8 +138,7 @@ struct Surface
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** \brief Data structure for a MDC frame
|
|
/** \brief Data structure for a MDC frame
|
|
*/
|
|
*/
|
|
-struct Frame
|
|
|
|
-{
|
|
|
|
|
|
+struct Frame {
|
|
//! bounding box minimum coords
|
|
//! bounding box minimum coords
|
|
aiVector3D bboxMin ;
|
|
aiVector3D bboxMin ;
|
|
|
|
|
|
@@ -163,24 +158,21 @@ struct Frame
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** \brief Data structure for a MDC triangle
|
|
/** \brief Data structure for a MDC triangle
|
|
*/
|
|
*/
|
|
-struct Triangle
|
|
|
|
-{
|
|
|
|
|
|
+struct Triangle {
|
|
uint32_t aiIndices[3];
|
|
uint32_t aiIndices[3];
|
|
} PACK_STRUCT;
|
|
} PACK_STRUCT;
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** \brief Data structure for a MDC texture coordinate
|
|
/** \brief Data structure for a MDC texture coordinate
|
|
*/
|
|
*/
|
|
-struct TexturCoord
|
|
|
|
-{
|
|
|
|
|
|
+struct TexturCoord {
|
|
float u,v;
|
|
float u,v;
|
|
} PACK_STRUCT;
|
|
} PACK_STRUCT;
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** \brief Data structure for a MDC base vertex
|
|
/** \brief Data structure for a MDC base vertex
|
|
*/
|
|
*/
|
|
-struct BaseVertex
|
|
|
|
-{
|
|
|
|
|
|
+struct BaseVertex {
|
|
int16_t x,y,z;
|
|
int16_t x,y,z;
|
|
uint16_t normal;
|
|
uint16_t normal;
|
|
} PACK_STRUCT;
|
|
} PACK_STRUCT;
|
|
@@ -188,25 +180,20 @@ struct BaseVertex
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** \brief Data structure for a MDC compressed vertex
|
|
/** \brief Data structure for a MDC compressed vertex
|
|
*/
|
|
*/
|
|
-struct CompressedVertex
|
|
|
|
-{
|
|
|
|
|
|
+struct CompressedVertex {
|
|
uint8_t xd,yd,zd,nd;
|
|
uint8_t xd,yd,zd,nd;
|
|
} PACK_STRUCT;
|
|
} PACK_STRUCT;
|
|
|
|
|
|
-
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** \brief Data structure for a MDC shader
|
|
/** \brief Data structure for a MDC shader
|
|
*/
|
|
*/
|
|
-struct Shader
|
|
|
|
-{
|
|
|
|
|
|
+struct Shader {
|
|
char ucName [ AI_MDC_MAXQPATH ] ;
|
|
char ucName [ AI_MDC_MAXQPATH ] ;
|
|
uint32_t ulPath;
|
|
uint32_t ulPath;
|
|
-
|
|
|
|
} PACK_STRUCT;
|
|
} PACK_STRUCT;
|
|
|
|
|
|
#include <assimp/Compiler/poppack1.h>
|
|
#include <assimp/Compiler/poppack1.h>
|
|
|
|
|
|
-
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
/** Build a floating point vertex from the compressed data in MDC files
|
|
/** Build a floating point vertex from the compressed data in MDC files
|
|
*/
|
|
*/
|
|
@@ -215,6 +202,7 @@ void BuildVertex(const Frame& frame,
|
|
const CompressedVertex& cvert,
|
|
const CompressedVertex& cvert,
|
|
aiVector3D& vXYZOut,
|
|
aiVector3D& vXYZOut,
|
|
aiVector3D& vNorOut);
|
|
aiVector3D& vNorOut);
|
|
-}}
|
|
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
|
|
#endif // !! AI_MDCFILEHELPER_H_INC
|
|
#endif // !! AI_MDCFILEHELPER_H_INC
|