UFO: Alien Invasion
Loading...
Searching...
No Matches
r_model_brush.h
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 1997-2001 Id Software, Inc.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24*/
25
26#pragma once
27
28/*
29==============================================================================
30BRUSH MODELS
31==============================================================================
32*/
33
34
36typedef struct mBspVertex_s {
40
41typedef struct mBspHeader_s {
44 float radius;
49
50#define MSURF_PLANEBACK 1
51#define MSURF_LIGHTMAP 2
52
53typedef struct mBspEdge_s {
54 unsigned short v[2];
56
65typedef struct mBspTexInfo_s {
67 float u_offset;
69 float v_offset;
70 uint32_t flags;
73
74typedef struct mBspFlare_s {
76 float radius;
77 const image_t* image;
79 float time;
80 float alpha;
82
133
138typedef struct mBspSurfaces_s {
140 int count;
142
154
155#define opaque_surfaces sorted_surfaces[S_OPAQUE]
156#define opaque_warp_surfaces sorted_surfaces[S_OPAQUE_WARP]
157#define alpha_test_surfaces sorted_surfaces[S_ALPHA_TEST]
158#define blend_surfaces sorted_surfaces[S_BLEND]
159#define blend_warp_surfaces sorted_surfaces[S_BLEND_WARP]
160#define material_surfaces sorted_surfaces[S_MATERIAL]
161#define flare_surfaces sorted_surfaces[S_FLARE]
162
163#define R_AddSurfaceToArray(array, surf)\
164 (array)->surfaces[(array)->count++] = surf
165
166#define CONTENTS_NODE -1
167#define CONTENTS_PATHFINDING_NODE -2
168
171typedef struct mBspNode_s {
172 /* common with leaf */
175
176 struct mBspNode_s* parent;
177
178 struct model_s* model;
179
180 /* node specific */
182 struct mBspNode_s* children[2];
183
184 unsigned short firstsurface;
185 unsigned short numsurfaces;
186} mBspNode_t;
187
188typedef struct mBspLeaf_s {
189 /* common with mBspNode_t */
192
194
195 struct model_s* model;
196} mBspLeaf_t;
197
199typedef struct mBspModel_s {
200 /* range of surface numbers in this (sub)model */
203
206
209
212
215
218
222
225
228
231
232 /* vertex arrays */
233 float* verts;
234 float* texcoords;
236 float* tangents;
237 float* normals;
238 glElementIndex_t* indexes; /*< TODO: on Android glElementIndex_t is unsigned short, which can be only up to 65536 and might overflow */
240
241 /* vertex buffer objects */
242 unsigned int vertex_buffer;
243 unsigned int texcoord_buffer;
244 unsigned int lmtexcoord_buffer;
245 unsigned int tangent_buffer;
246 unsigned int normal_buffer;
247 unsigned int index_buffer;
248
251
252 /* sorted surfaces arrays */
Definition aabb.h:42
GLuint glElementIndex_t
Definition r_gl.h:57
surfaceArrayType_t
@ NUM_SURFACES_ARRAYS
@ S_MATERIAL
@ S_ALPHA_TEST
@ S_BLEND
@ S_OPAQUE_WARP
@ S_FLARE
@ S_OPAQUE
@ S_BLEND_WARP
plane_t structure
Definition typedefs.h:20
unsigned short v[2]
const image_t * image
mBspNode_t * parent
struct model_s * model
brush model
glElementIndex_t * indexes
unsigned int tangent_buffer
unsigned int normal_buffer
mBspVertex_t * vertexes
cBspPlane_t * planes
mBspSurfaces_t * sorted_surfaces[NUM_SURFACES_ARRAYS]
mBspTexInfo_t * texinfo
float * normals
unsigned int index_buffer
unsigned int vertex_buffer
unsigned int texcoord_buffer
unsigned int lmtexcoord_buffer
float * lmtexcoords
float * texcoords
mBspSurface_t * surfaces
float * tangents
mBspEdge_t * edges
mBspLeaf_t * leafs
mBspHeader_t * submodels
mBspNode_t * nodes
unsigned short firstsurface
struct model_s * model
struct mBspNode_s * parent
cBspPlane_t * plane
struct mBspNode_s * children[2]
unsigned short numsurfaces
short stmaxs[2]
mBspTexInfo_t * texinfo
unsigned int index
short stmins[2]
unsigned int numTriangles
mBspFlare_t * flare
cBspPlane_t * plane
surfaces are assigned to arrays based on their primary rendering type and then sorted by world textur...
mBspSurface_t ** surfaces
image_t * image
vec_t vec3_t[3]
Definition ufotypes.h:39
vec_t vec4_t[4]
Definition ufotypes.h:40
vec_t vec2_t[2]
Definition ufotypes.h:38