modelgen.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. //
  16. // modelgen.h: header file for model generation program
  17. //
  18. // *********************************************************
  19. // * This file must be identical in the modelgen directory *
  20. // * and in the Quake directory, because it's used to *
  21. // * pass data from one to the other via model files. *
  22. // *********************************************************
  23. #ifdef INCLUDELIBS
  24. #include <stdlib.h>
  25. #include <stdio.h>
  26. #include <math.h>
  27. #include <string.h>
  28. #include "cmdlib.h"
  29. #include "scriplib.h"
  30. #include "trilib.h"
  31. #include "lbmlib.h"
  32. #include "mathlib.h"
  33. #endif
  34. #define ALIAS_VERSION 6
  35. #define ALIAS_ONSEAM 0x0020
  36. // must match definition in spritegn.h
  37. #ifndef SYNCTYPE_T
  38. #define SYNCTYPE_T
  39. typedef enum {ST_SYNC=0, ST_RAND } synctype_t;
  40. #endif
  41. typedef enum { ALIAS_SINGLE=0, ALIAS_GROUP } aliasframetype_t;
  42. typedef enum { ALIAS_SKIN_SINGLE=0, ALIAS_SKIN_GROUP } aliasskintype_t;
  43. typedef struct {
  44. int ident;
  45. int version;
  46. vec3_t scale;
  47. vec3_t scale_origin;
  48. float boundingradius;
  49. vec3_t eyeposition;
  50. int numskins;
  51. int skinwidth;
  52. int skinheight;
  53. int numverts;
  54. int numtris;
  55. int numframes;
  56. synctype_t synctype;
  57. int flags;
  58. float size;
  59. } mdl_t;
  60. // TODO: could be shorts
  61. typedef struct {
  62. int onseam;
  63. int s;
  64. int t;
  65. } stvert_t;
  66. typedef struct dtriangle_s {
  67. int facesfront;
  68. int vertindex[3];
  69. } dtriangle_t;
  70. #define DT_FACES_FRONT 0x0010
  71. // This mirrors trivert_t in trilib.h, is present so Quake knows how to
  72. // load this data
  73. typedef struct {
  74. byte v[3];
  75. byte lightnormalindex;
  76. } trivertx_t;
  77. typedef struct {
  78. trivertx_t bboxmin; // lightnormal isn't used
  79. trivertx_t bboxmax; // lightnormal isn't used
  80. char name[16]; // frame name from grabbing
  81. } daliasframe_t;
  82. typedef struct {
  83. int numframes;
  84. trivertx_t bboxmin; // lightnormal isn't used
  85. trivertx_t bboxmax; // lightnormal isn't used
  86. } daliasgroup_t;
  87. typedef struct {
  88. int numskins;
  89. } daliasskingroup_t;
  90. typedef struct {
  91. float interval;
  92. } daliasinterval_t;
  93. typedef struct {
  94. float interval;
  95. } daliasskininterval_t;
  96. typedef struct {
  97. aliasframetype_t type;
  98. } daliasframetype_t;
  99. typedef struct {
  100. aliasskintype_t type;
  101. } daliasskintype_t;
  102. #define IDPOLYHEADER (('O'<<24)+('P'<<16)+('D'<<8)+'I')
  103. // little-endian "IDPO"