X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=model_alias.h;h=e45abc344b2c58f0332696f770af9a9cd3f74cfd;hp=73e831076c7cad76ac10dbee94dbb999fbd7ab9e;hb=a79a57664e9b2420bb4b5a06cde2e84b7191e967;hpb=ccf0849cbfe3013a00dff7f37cc68e774b241cb5 diff --git a/model_alias.h b/model_alias.h index 73e83107..e45abc34 100644 --- a/model_alias.h +++ b/model_alias.h @@ -18,6 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef MODEL_ALIAS_H +#define MODEL_ALIAS_H + /* ============================================================================== @@ -29,45 +32,6 @@ Alias models are position independent, so the cache manager can move them. #include "modelgen.h" -/* -typedef struct -{ - int firstpose; - int numposes; - float interval; - trivertx_t bboxmin; - trivertx_t bboxmax; - int frame; - char name[16]; -} maliasframedesc_t; - -typedef struct -{ - trivertx_t bboxmin; - trivertx_t bboxmax; - int frame; -} maliasgroupframedesc_t; - -typedef struct -{ - int numframes; - int intervals; - maliasgroupframedesc_t frames[1]; -} maliasgroup_t; - -typedef struct mtriangle_s { - int facesfront; - int vertindex[3]; -} mtriangle_t; -*/ - -// LordHavoc: new vertex format -typedef struct { - byte v[3]; // location - signed char n[3]; // surface normal for lighting *127.0 -} trivert2; - -#define MAX_SKINS 32 typedef struct { int ident; int version; @@ -86,28 +50,6 @@ typedef struct { float size; } daliashdr_t; -typedef struct -{ - char name[16]; // LordHavoc: only kept this for reasons of viewthing support - unsigned short start; - unsigned short length; - float rate; // in poses per second -} maliasframe_t; - -typedef struct -{ - vec3_t scale; - vec3_t scale_origin; - int numverts; - int numtris; - int numframes; - int numposes; - int framedata; // LordHavoc: unsigned short start - int texdata; // LordHavoc: texture coordinate array - int posedata; // LordHavoc: vertex data for all the poses - int tridata; // LordHavoc: vertex indices for the triangles -} maliashdr_t; - #define MAXALIASVERTS 4096 #define MAXALIASFRAMES 1024 #define MAXALIASTRIS 4096 @@ -123,13 +65,11 @@ typedef struct // LordHavoc: grabbed this from the Q2 utility source, // renamed a things to avoid conflicts -#define MD2IDALIASHEADER (('2'<<24)+('P'<<16)+('D'<<8)+'I') #define MD2ALIAS_VERSION 8 #define MD2MAX_TRIANGLES 4096 #define MD2MAX_VERTS 4096 #define MD2MAX_FRAMES 1024 -#define MD2MAX_SKINS 32 #define MD2MAX_SKINNAME 64 // sanity checking size #define MD2MAX_SIZE (16777216) @@ -151,26 +91,8 @@ typedef struct float scale[3]; // multiply byte verts by this float translate[3]; // then add this char name[16]; // frame name from grabbing - trivertx_t verts[1]; // variable sized } md2frame_t; -// LordHavoc: memory representation is different than disk -typedef struct -{ - float scale[3]; // multiply byte verts by this - float translate[3]; // then add this - char name[16]; // LordHavoc: kept for viewthing - trivert2 verts[1]; // variable sized -} md2memframe_t; - -// must match md2memframe_t, this is just used for sizeof() -typedef struct -{ - float scale[3]; // multiply byte verts by this - float translate[3]; // then add this -} md2memframesize_t; - - // the glcmd format: // a positive integer starts a tristrip command, followed by that many // vertex structures. @@ -200,28 +122,20 @@ typedef struct int ofs_st; // byte offset from start for stverts int ofs_tris; // offset for dtriangles int ofs_frames; // offset for first frame - int ofs_glcmds; + int ofs_glcmds; int ofs_end; // end of file } md2_t; -typedef struct -{ - int framesize; // byte size of each frame +// LordHavoc: Q1 and Q2 models are converted to the same internal format +#define ALIASTYPE_MDLMD2 1 +#define ALIASTYPE_ZYM 2 - int num_skins; - int num_xyz; - int num_st; // greater than num_xyz for seams - int num_tris; - int num_glcmds; // dwords in strip/fan command list - int num_frames; +extern void Mod_LoadAliasModel (struct model_s *mod, void *buffer); +extern void Mod_LoadQ2AliasModel (struct model_s *mod, void *buffer); - int ofs_tris; // offset for dtriangles - int ofs_frames; // offset for first frame - int ofs_glcmds; -} md2mem_t; +extern void Mod_AliasInit(void); + +#include "model_zymotic.h" -#define ALIASTYPE_MDL 1 -#define ALIASTYPE_MD2 2 -#define ALIASTYPE_ZYM 3 +#endif -#include "model_zymotic.h" \ No newline at end of file