#ifndef __LUXINIA_MESH_VERTEX_H__
#define __LUXINIA_MESH_VERTEX_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef enum VertexType_e{
	VERTEX_32_LM = 0,		// 2 texcoords
	VERTEX_32_LIT,			// 1 tecoord 1 normal (short)
	VERTEX_32_FN,			// float normals, no color
	VERTEX_32_TERR,
	VERTEX_64,
	VERTEX_16_HOM,			// homogenous coord
	VERTEX_16_CLR,			// colored
	VERTEX_16_TERR,
	VERTEX_LASTTYPE
}VertexType_t;


typedef struct Vertex16Color_s{
	float			pos[3];
	unsigned char	color[4];
}Vertex16Color_t;

typedef struct Vertex16Hom_s{
	float			pos[4];
}Vertex16Hom_t;

typedef struct Vertex16Terrain_s{
	unsigned char	tangent[4];	// color 
	unsigned char	normal[4];	// seccolor

	short			pos[4];
}Vertex16Terrain_t;

typedef struct Vertex32Terrain_s{
	short			tangent[4];
	short			normal[4];

	float			pos[3];
	unsigned char	color[4];
}Vertex32Terrain_t;

typedef struct Vertex32Lit_s{
	float			tex[2];	
	short			normal[4];

	float			pos[3];
	unsigned char	color[4];
}Vertex32Lit_t;

typedef struct Vertex32Lightmap_s{
	float			tex[2];	
	float			tex1[2];

	float			pos[3];
	unsigned char	color[4];
}Vertex32Lightmap_t;

typedef struct Vertex32FN_s{
	float			pos[3];
	float			normal[3];
	float			tex[2];
}Vertex32FN_t;

typedef struct Vertex64Tex_s{	
	float			tex[2];
	float			tex1[2];
	float			tex2[2];
	float			tex3[2];
	short			normal[4];
	short			tangent[4];
	float			pos[3];
	unsigned char	color[4];
}Vertex64Tex_t;

typedef struct Vertex64User_s{	
	float			tex[2];
	float			tex1[2];
	float			user4[4];
	short			normal[4];
	short			tangent[4];
	float			pos[3];
	unsigned char	color[4];
}Vertex64User_t;

//////////////////////////////////////////////////////////////////////////
// Internal Types (unions, colorcompact)

typedef struct Vertex16_s{
	float		pos[3];
	union{
		unsigned char	color[4];
		unsigned int	colorc;
		float			posw;
	};
}Vertex16_t;

typedef struct Vertex32_s{
	float		tex[2];		// base
	union{
		float	tex1[2];	// lightmap
		short	normal[4];	// normal
	};

	float		pos[3];
	union{
		unsigned char	color[4];
		unsigned int	colorc;
	};
}Vertex32_t;


// Warning gl_terrain depends on this order and f3d version >=250
typedef struct Vertex64_s{	
	float		tex[2];
	float		tex1[2];
	float		user4[4];
	short		normal[4];
	short		tangent[4];
	float		pos[3];
	union{
		unsigned char	color[4];
		unsigned int	colorc;
	};
}Vertex64_t;

#ifdef __cplusplus
}
#endif

#endif
