and here is my code so far
EDIT: i already know i havent added the other headers
Code: Select all
#include "stdio.h"
#ifdef __cplusplus__
extern "C" {
#endif /* __cplusplus */
typedef struct MD2_Header{
int ident;
int version
int skinwidth;
int skinheight;
int framesize;
int num_skins;
int num_xyz;
int num_st;
int num_tris;
int num_glcmds;
int num_frames;
int ofs_skins;
int ofs_st;
int ofs_tris;
int ofs_frames;
int ofs_glcmds;
int ofs_end;
}MD2_Header;
/* at offset ofs_st its num_st * this struct */
typedef struct MD2_ofs1{
short s;
short t;
}MD2_ofs1
/*
typedef struct MD2_
int Load_MD2(char *target){
MD2_Header *header;
if(Load_MD2(char *target)
{
printf("file %d loaded sucessfully!\n\n", char *target);
printf("verifying struct...\n");
printf("%d"
}
/* this function decompresses a single frame and displays it
*
*/
int Decompress_Frame(int frame)
{
}
int MD2GetMagic(void)
{
return ident;
}
int MD2GetVersion(void)
{
return version;
}
int MD2GetSkinWidth(void)
{
return skinwidth;
}
int MD2GetSkinHeight(void)
{
return skinheight;
}
int MD2GetFrameSize(void)
{
return framesize;
}
int MD2GetNumSkins(void)
{
return num_skins;
}
int MD2GetNumXYZ(void)
{
return num_xyz
}
int MD2GetNumST(void)
{
return num_st;
}
int MD2GetNumTri(void)
{
return num_tris;
}
int MD2GetNumGL(void)
{
return num_glcmds;
}
int MD2GetNumFrames(void)
{
return num_frames;
}
int MD2GetSkinOffs(void)
{
return ofs_skins;
if(ofs_skins << unsigned char[64])
{
printf("error at %d", ofs_skins);
}
else if(ofs_skins == unsigned char[64])
{
printf("%d", ofs_skins);
}
return ofs_skins;
}
int MD2GetSTOffs(void)
{
ofs_st = (num_st * (MD2_ofs1 *header));
return ofs_st;
}
int MD2GetTrigOffs(void)
{
return ofs_tris;
}
int MD2GetFrameOffs(void)
{
return ofs_frames;
}
int MD2GetGLOffs(void)
{
return ofs_glcmds;
}
int MD2GetEndOffs(void)
{
return ofs_end;
}