File: q2_structs.h

package info (click to toggle)
glhack 1.2-4
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 26,744 kB
  • sloc: ansic: 208,571; cpp: 13,139; yacc: 2,005; makefile: 1,155; lex: 377; sh: 121; awk: 89; sed: 11
file content (141 lines) | stat: -rw-r--r-- 1,722 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
 * Q2 STRUCTS
 *
 * Based on "qfiles.h" from the GPL'd quake 2 source release.
 * Copyright (C) 1997-2001 Id Software, Inc.
 */

#ifndef __Q2_STRUCTS_H__
#define __Q2_STRUCTS_H__


/* 
 * Pack files
 */

#define PACK_IDENT  "PACK"

typedef struct
{
  char ident[4];

  Sint32 dir_offset;
  Sint32 dir_size;
}
pack_header_t;

typedef struct
{
  char filename[56];

  Sint32 offset;
  Sint32 size;
}
pack_entry_t;


/* 
 * MD2 model format
 */

#define MD2_IDENT  "IDP2"

typedef struct
{
  char ident[4];
  Sint32 version;

  Sint32 skin_width;
  Sint32 skin_height;
  Sint32 frame_size;

  Sint32 num_skins;
  Sint32 num_xyz;
  Sint32 num_st;
  Sint32 num_tris;
  Sint32 num_glcmds;
  Sint32 num_frames;

  Sint32 ofs_skins;
  Sint32 ofs_st;
  Sint32 ofs_tris;
  Sint32 ofs_frames;
  Sint32 ofs_glcmds;  
  Sint32 ofs_end;
} 
md2_header_t;

typedef struct
{
  Uint16 s, t;
} 
md2_texcoord_t;

typedef struct 
{
  Uint16 index_xyz[3];
  Uint16 index_st[3];
} 
md2_triangle_t;

typedef struct
{
  Uint8 v[3];
  Uint8 light_normal;
} 
md2_vertex_t;

typedef struct
{
  float s, t;
  Sint32 vert_index;
}
md2_gl_vertex_t;

typedef struct
{
  float scale[3];
  float translate[3];

  char name[16];

  md2_vertex_t verts[1];  /* variable sized */
} 
md2_frame_t;

typedef struct
{
  char name[64];
}
md2_skin_t;


/* 
 * PCX image structure
 */

typedef struct
{
  Uint8 manufacturer;
  Uint8 version;
  Uint8 encoding;
  Uint8 bits_per_pixel;

  Uint16 xmin, ymin, xmax, ymax;
  Uint16 hres, vres;

  Uint8 palette[48];

  Uint8 reserved;
  Uint8 color_planes;

  Uint16 bytes_per_line;
  Uint16 palette_type;

  Uint8 filler[58];
  Uint8 data[1];      /* variable sized */
} 
pcx_header_t;


#endif /* __Q2_STRUCTS_H__ */