]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_alias.h
double precision RecursiveHullCheck
[xonotic/darkplaces.git] / model_alias.h
index a00d41e1036b0393c661489772f85fba11fa363e..935bd5467697dbe5d9fef4ba5fc5a050ab61d21c 100644 (file)
@@ -29,6 +29,7 @@ Alias models are position independent, so the cache manager can move them.
 
 #include "modelgen.h"
 
+/*
 typedef struct
 {
        int                                     firstpose;
@@ -54,19 +55,12 @@ typedef struct
        maliasgroupframedesc_t  frames[1];
 } maliasgroup_t;
 
-// !!! if this is changed, it must be changed in asm_draw.h too !!!
 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;
@@ -83,30 +77,12 @@ typedef struct {
        synctype_t      synctype;
        int                     flags;
        float           size;
-
-       int                                     numposes;
-       int                                     posedata;       // LordHavoc: numposes*numverts*trivert2
-       int                                     frontfaces; // LordHavoc: how many front faces
-       int                                     backfaces; // LordHavoc: how many back faces
-//     int                                     poseverts;
-//     int                                     posedata;       // numposes*poseverts trivert_t
-//     int                                     commands;       // gl command list with embedded s/t
-       int                                     texcoords;      // LordHavoc: texture coordinates
-       int                                     vertindices;    // LordHavoc: vertex numbers
-       int                                     gl_texturenum[MAX_SKINS][4];
-       int                                     texels[MAX_SKINS];      // only for player skins
-       maliasframedesc_t       frames[1];      // variable sized
-} aliashdr_t;
+} daliashdr_t;
 
 #define        MAXALIASVERTS   4096
 #define        MAXALIASFRAMES  1024
 #define        MAXALIASTRIS    4096
 
-extern aliashdr_t      *pheader;
-//extern       stvert_t        stverts[MAXALIASVERTS];
-//extern       mtriangle_t     triangles[MAXALIASTRIS];
-//extern       trivertx_t      *poseverts[MAXALIASFRAMES];
-
 /*
 ========================================================================
 
@@ -118,13 +94,11 @@ extern     aliashdr_t      *pheader;
 // 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)
@@ -146,18 +120,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[0];       // 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
-       trivert2        verts[0];       // variable sized
-} md2memframe_t;
-
-
 // the glcmd format:
 // a positive integer starts a tristrip command, followed by that many
 // vertex structures.
@@ -187,27 +151,17 @@ 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
-
-       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;
+#define ALIASTYPE_MDL 1
+#define ALIASTYPE_MD2 2
+#define ALIASTYPE_ZYM 3
 
-       int                     ofs_tris;               // offset for dtriangles
-       int                     ofs_frames;             // offset for first frame
-       int                     ofs_glcmds;     
+extern void Mod_LoadAliasModel (struct model_s *mod, void *buffer);
+extern void Mod_LoadQ2AliasModel (struct model_s *mod, void *buffer);
 
-       int                     gl_texturenum[MAX_SKINS];
-} md2mem_t;
+extern void Mod_AliasInit(void);
 
-#define ALIASTYPE_MDL 1
-#define ALIASTYPE_MD2 2
+#include "model_zymotic.h"