///////////////////////////////////////////////////////////////////////////////
/// @file md2.h
///
/// @brief Header for MD2 structures
///
/// @author Assassin
///
/// This file is the intellectual property of Novus Delta, LLC.. Usage of the
/// contents of this file is subject to the Destiny3D Member License which
/// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
///
/// This file is distributed "AS IS" without warranty of any kind.  Novus
/// Delta, LLC. does not guarantee the fitness of the contents of this file
/// for any particular purpose.
///
/// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
///
/// <hr>
///                                 Change History
/// <hr>
///
/// @date June 2002
/// @author Assassin
/// @remarks Creation
///
///////////////////////////////////////////////////////////////////////////////

//MD2 model stuff
#ifndef MD2_H
#define MD2_H

typedef struct MD2Header
{
	int							indent;
	int							version;

	int							skinwidth;
	int							skinheight;

	int							framesize;
	
	int							numSkins;
	int							numXYZ;
	int							numST;
	int							numTris;
	int							numGLcmds;
	int							numFrames;

	int							offsetSkins;
	int							offsetST;
	int							offsetTris;
	int							offsetFrames;
	int							offsetGLcmds;
	int							offsetEnd;
} MD2Header;

typedef struct MD2TriangleVertex
{
	BYTE						vertex[3];
	BYTE						lightOffset;
} MD2TriangleVertex;

typedef struct MD2FrameData
{
	float					scale[3];
	float					translation[3];
	char						name[16];

	MD2TriangleVertex			*vertices;
} MD2FrameData;

typedef struct MD2Triangle
{
	deVertex					vert;
	deVertex					normal;
} MD2Triangle;

typedef struct MD2Frame
{
	char						name[16];
	MD2Triangle					*vertices;
} MD2Frame;

typedef struct MD2Face
{
	short						vertexIndices[3];
	short						textureIndices[3];
} MD2Face;

typedef struct MD2TexCoord
{
	short						s, t;
} MD2TexCoord;

typedef char					MD2Skin[64];

#endif
