]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake2/qdata_heretic2/qcommon/fmodel.h
set eol-style
[xonotic/netradiant.git] / tools / quake2 / qdata_heretic2 / qcommon / fmodel.h
index f33efa479b26b7c58f543b6c8bb49201386373f4..f52d922c83198981116e8320aa9c348c604ab0bf 100644 (file)
-/*\r
-Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
-For a list of contributors, see the accompanying CONTRIBUTORS file.\r
-\r
-This file is part of GtkRadiant.\r
-\r
-GtkRadiant is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-GtkRadiant is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with GtkRadiant; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
-*/\r
-\r
-\r
-/*\r
-========================================================================\r
-\r
-.FM triangle flexible model file format\r
-\r
-========================================================================\r
-*/\r
-\r
-#ifndef __FMODEL_HEADER\r
-#define __FMODEL_HEADER\r
-\r
-#include "bspfile.h"\r
-\r
-//typedef unsigned char                byte;\r
-//typedef int  qboolean;\r
-//typedef float vec3_t[3];\r
-\r
-#define        MAX_FM_TRIANGLES        2048\r
-#define MAX_FM_VERTS           2048\r
-#define MAX_FM_FRAMES          2048\r
-#define MAX_FM_SKINS           64\r
-#define        MAX_FM_SKINNAME         64\r
-#define MAX_FM_MESH_NODES      16              // also defined in game/qshared.h\r
-\r
-\r
-#define DTRIVERTX_V0   0\r
-#define DTRIVERTX_V1   1\r
-#define DTRIVERTX_V2   2\r
-#define DTRIVERTX_LNI  3\r
-#define DTRIVERTX_SIZE 4\r
-\r
-#define SKINPAGE_WIDTH 640\r
-#define SKINPAGE_HEIGHT 480\r
-\r
-#define ENCODED_WIDTH_X 92\r
-#define ENCODED_WIDTH_Y 475\r
-#define ENCODED_HEIGHT_X 128\r
-#define ENCODED_HEIGHT_Y 475\r
-\r
-#define SCALE_ADJUST_FACTOR 0.96\r
-\r
-#define INFO_HEIGHT 5\r
-#define INFO_Y (SKINPAGE_HEIGHT-INFO_HEIGHT)\r
-\r
-extern byte            *BasePalette;\r
-extern byte            *BasePixels,*TransPixels;\r
-extern int             BaseWidth, BaseHeight, TransWidth, TransHeight;\r
-extern int ScaleWidth, ScaleHeight;\r
-\r
-int ExtractNumber(byte *pic, int x, int y);\r
-void DrawTextChar(int x, int y, char *text);\r
-void DrawLine(int x1, int y1, int x2, int y2);\r
-\r
-// the glcmd format:\r
-// a positive integer starts a tristrip command, followed by that many\r
-// vertex structures.\r
-// a negative integer starts a trifan command, followed by -x vertexes\r
-// a zero indicates the end of the command list.\r
-// a vertex consists of a floating point s, a floating point t,\r
-// and an integer vertex index.\r
-\r
-\r
-// Initial Header\r
-#define FM_HEADER_NAME "header"\r
-#define FM_HEADER_VER  2\r
-\r
-typedef struct\r
-{\r
-       int                     skinwidth;\r
-       int                     skinheight;\r
-       int                     framesize;              // byte size of each frame\r
-\r
-       int                     num_skins;\r
-       int                     num_xyz;\r
-       int                     num_st;                 // greater than num_xyz for seams\r
-       int                     num_tris;\r
-       int                     num_glcmds;             // dwords in strip/fan command list\r
-       int                     num_frames;\r
-       int                     num_mesh_nodes;\r
-} fmheader_t;\r
-\r
-\r
-// Skin Header\r
-#define FM_SKIN_NAME   "skin"\r
-#define FM_SKIN_VER            1\r
-\r
-\r
-// ST Coord Header\r
-#define FM_ST_NAME             "st coord"\r
-#define FM_ST_VER              1\r
-\r
-typedef struct\r
-{\r
-       short   s;\r
-       short   t;\r
-} fmstvert_t;\r
-\r
-\r
-// Tri Header\r
-#define FM_TRI_NAME            "tris"\r
-#define FM_TRI_VER             1\r
-\r
-typedef struct \r
-{\r
-       short   index_xyz[3];\r
-       short   index_st[3];\r
-} fmtriangle_t;\r
-\r
-\r
-// Frame Header\r
-#define FM_FRAME_NAME  "frames"\r
-#define FM_FRAME_VER   1\r
-\r
-// Frame for compression, just the names\r
-#define FM_SHORT_FRAME_NAME    "short frames"\r
-#define FM_SHORT_FRAME_VER     1\r
-\r
-// Normals for compressed frames\r
-#define FM_NORMAL_NAME "normals"\r
-#define FM_NORMAL_VER  1\r
-\r
-// Compressed Frame Data\r
-#define FM_COMP_NAME   "comp data"\r
-#define FM_COMP_VER    1\r
-\r
-// GL Cmds Header\r
-#define FM_GLCMDS_NAME "glcmds"\r
-#define FM_GLCMDS_VER  1\r
-\r
-\r
-// Mesh Nodes Header\r
-#define FM_MESH_NAME   "mesh nodes"\r
-#define FM_MESH_VER            3\r
-\r
-// Skeleton Header\r
-#define FM_SKELETON_NAME "skeleton"\r
-#define FM_SKELETON_VER        1\r
-\r
-// References Header\r
-#define FM_REFERENCES_NAME "references"\r
-#define FM_REFERENCES_VER      1\r
-\r
-typedef struct\r
-{\r
-\r
-       union\r
-       {\r
-\r
-       byte    tris[MAX_FM_TRIANGLES>>3];\r
-\r
-       struct {\r
-       short   *triIndicies;\r
-       int             num_tris;\r
-       };\r
-\r
-       };\r
-\r
-       byte    verts[MAX_FM_VERTS>>3];\r
-       short   start_glcmds, num_glcmds;\r
-} fmmeshnode_t;\r
-\r
-//=================================================================\r
-\r
-// Frame info\r
-typedef struct\r
-{\r
-       byte    v[3];                   // scaled byte to fit in frame mins/maxs\r
-       byte    lightnormalindex;\r
-} fmtrivertx_t;\r
-\r
-typedef struct\r
-{\r
-       float                   scale[3];               // multiply byte verts by this\r
-       float                   translate[3];   // then add this\r
-       char                    name[16];               // frame name from grabbing\r
-       fmtrivertx_t    verts[1];               // variable sized\r
-} fmaliasframe_t;\r
-\r
-\r
-#endif // #define __FMODEL_HEADER\r
+/*
+Copyright (C) 1999-2007 id Software, Inc. and contributors.
+For a list of contributors, see the accompanying CONTRIBUTORS file.
+
+This file is part of GtkRadiant.
+
+GtkRadiant is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+GtkRadiant is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GtkRadiant; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+
+/*
+========================================================================
+
+.FM triangle flexible model file format
+
+========================================================================
+*/
+
+#ifndef __FMODEL_HEADER
+#define __FMODEL_HEADER
+
+#include "bspfile.h"
+
+//typedef unsigned char                byte;
+//typedef int  qboolean;
+//typedef float vec3_t[3];
+
+#define        MAX_FM_TRIANGLES        2048
+#define MAX_FM_VERTS           2048
+#define MAX_FM_FRAMES          2048
+#define MAX_FM_SKINS           64
+#define        MAX_FM_SKINNAME         64
+#define MAX_FM_MESH_NODES      16              // also defined in game/qshared.h
+
+
+#define DTRIVERTX_V0   0
+#define DTRIVERTX_V1   1
+#define DTRIVERTX_V2   2
+#define DTRIVERTX_LNI  3
+#define DTRIVERTX_SIZE 4
+
+#define SKINPAGE_WIDTH 640
+#define SKINPAGE_HEIGHT 480
+
+#define ENCODED_WIDTH_X 92
+#define ENCODED_WIDTH_Y 475
+#define ENCODED_HEIGHT_X 128
+#define ENCODED_HEIGHT_Y 475
+
+#define SCALE_ADJUST_FACTOR 0.96
+
+#define INFO_HEIGHT 5
+#define INFO_Y (SKINPAGE_HEIGHT-INFO_HEIGHT)
+
+extern byte            *BasePalette;
+extern byte            *BasePixels,*TransPixels;
+extern int             BaseWidth, BaseHeight, TransWidth, TransHeight;
+extern int ScaleWidth, ScaleHeight;
+
+int ExtractNumber(byte *pic, int x, int y);
+void DrawTextChar(int x, int y, char *text);
+void DrawLine(int x1, int y1, int x2, int y2);
+
+// the glcmd format:
+// a positive integer starts a tristrip command, followed by that many
+// vertex structures.
+// a negative integer starts a trifan command, followed by -x vertexes
+// a zero indicates the end of the command list.
+// a vertex consists of a floating point s, a floating point t,
+// and an integer vertex index.
+
+
+// Initial Header
+#define FM_HEADER_NAME "header"
+#define FM_HEADER_VER  2
+
+typedef struct
+{
+       int                     skinwidth;
+       int                     skinheight;
+       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;
+       int                     num_mesh_nodes;
+} fmheader_t;
+
+
+// Skin Header
+#define FM_SKIN_NAME   "skin"
+#define FM_SKIN_VER            1
+
+
+// ST Coord Header
+#define FM_ST_NAME             "st coord"
+#define FM_ST_VER              1
+
+typedef struct
+{
+       short   s;
+       short   t;
+} fmstvert_t;
+
+
+// Tri Header
+#define FM_TRI_NAME            "tris"
+#define FM_TRI_VER             1
+
+typedef struct 
+{
+       short   index_xyz[3];
+       short   index_st[3];
+} fmtriangle_t;
+
+
+// Frame Header
+#define FM_FRAME_NAME  "frames"
+#define FM_FRAME_VER   1
+
+// Frame for compression, just the names
+#define FM_SHORT_FRAME_NAME    "short frames"
+#define FM_SHORT_FRAME_VER     1
+
+// Normals for compressed frames
+#define FM_NORMAL_NAME "normals"
+#define FM_NORMAL_VER  1
+
+// Compressed Frame Data
+#define FM_COMP_NAME   "comp data"
+#define FM_COMP_VER    1
+
+// GL Cmds Header
+#define FM_GLCMDS_NAME "glcmds"
+#define FM_GLCMDS_VER  1
+
+
+// Mesh Nodes Header
+#define FM_MESH_NAME   "mesh nodes"
+#define FM_MESH_VER            3
+
+// Skeleton Header
+#define FM_SKELETON_NAME "skeleton"
+#define FM_SKELETON_VER        1
+
+// References Header
+#define FM_REFERENCES_NAME "references"
+#define FM_REFERENCES_VER      1
+
+typedef struct
+{
+
+       union
+       {
+
+       byte    tris[MAX_FM_TRIANGLES>>3];
+
+       struct {
+       short   *triIndicies;
+       int             num_tris;
+       };
+
+       };
+
+       byte    verts[MAX_FM_VERTS>>3];
+       short   start_glcmds, num_glcmds;
+} fmmeshnode_t;
+
+//=================================================================
+
+// Frame info
+typedef struct
+{
+       byte    v[3];                   // scaled byte to fit in frame mins/maxs
+       byte    lightnormalindex;
+} fmtrivertx_t;
+
+typedef struct
+{
+       float                   scale[3];               // multiply byte verts by this
+       float                   translate[3];   // then add this
+       char                    name[16];               // frame name from grabbing
+       fmtrivertx_t    verts[1];               // variable sized
+} fmaliasframe_t;
+
+
+#endif // #define __FMODEL_HEADER