UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
r_model.h
Go to the documentation of this file.
1 
8 /*
9 Copyright (C) 1997-2001 Id Software, Inc.
10 
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License
13 as published by the Free Software Foundation; either version 2
14 of the License, or (at your option) any later version.
15 
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 
20 See the GNU General Public License for more details.
21 
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 
26 */
27 
28 #pragma once
29 
30 #include "r_entity.h"
31 #include "r_model_alias.h"
32 #include "r_model_brush.h"
33 #include "r_model_md2.h"
34 #include "r_model_md3.h"
35 #include "r_model_obj.h"
36 
42 
43 typedef struct model_s {
44  char name[MAX_QPATH];
48  int flags;
49 
52  float radius;
53 
54  bool loaded;
55 
57  bool clipbox;
59 
61 
64 } model_t;
65 
66 #define MAX_ACTORSKINNAME 32
67 
68 /*============================================================================ */
69 
70 void R_ModModellist_f(void);
71 image_t* R_AliasModelState(const model_t* mod, int* mesh, int* frame, int* oldFrame, int* skin);
72 image_t* R_AliasModelGetSkin(const char* modelFileName, const char* skin);
73 void R_DrawAliasModel(entity_t* e);
74 void R_ShutdownModels(bool complete);
75 void R_ModReloadSurfacesArrays(void);
76 int R_ModAllocateActorSkin(const char* name);
77 void R_LoadActorSkinsFromModel(mAliasMesh_t* outMesh, image_t* defaultSkin);
78 bool R_UseActorSkin(void);
79 
80 model_t* R_FindModel(const char* name);
81 bool R_ModelExists(const char* name);
82 model_t* R_GetModel(const char* name);
84 
85 void R_ModelInit();
86 void R_ModelShutdown();
87 
89 extern model_t* r_mapTiles[MAX_MAPTILES];
90 extern int r_numMapTiles;
91 
93 extern int r_numModelsInline;
bool R_UseActorSkin(void)
Definition: r_model.cpp:342
mAliasModel_t alias
Definition: r_model.h:63
void R_ModelInit()
Definition: r_model.cpp:436
image_t * R_AliasModelGetSkin(const char *modelFileName, const char *skin)
AABB modBox
Definition: r_model.h:51
bool loaded
Definition: r_model.h:54
Shared alias model functions.
vec3_t clipmaxs
Definition: r_model.h:58
Definition: aabb.h:42
vec3_t clipmins
Definition: r_model.h:58
int r_numMapTiles
Definition: r_model.cpp:33
int R_ModAllocateActorSkin(const char *name)
Register an actorskin name.
Definition: r_model.cpp:332
void R_ModReloadSurfacesArrays(void)
struct model_s model_t
#define MAX_MOD_KNOWN
Definition: defines.h:160
int flags
Definition: r_model.h:48
model_t * R_GetModel(const char *name)
Get a model for the given name already loaded.
Definition: r_model.cpp:269
modtype_t type
Definition: r_model.h:46
modtype_t
All supported model formats.
Definition: r_model.h:41
brush model loading
int r_numModelsInline
Definition: r_model.cpp:37
void R_LoadActorSkinsFromModel(mAliasMesh_t *outMesh, image_t *defaultSkin)
Load actor skins from a default skin to a a mesh.
Definition: r_model.cpp:358
char name[MAX_QPATH]
Definition: r_model.h:44
bool clipbox
Definition: r_model.h:57
md3 alias model loading
void R_ShutdownModels(bool complete)
Frees the model pool.
Definition: r_model.cpp:391
void R_DrawAliasModel(entity_t *e)
Draw a model from the battlescape entity list.
Definition: r_mesh.cpp:717
model_t * r_mapTiles[MAX_MAPTILES]
The world model(s)
Definition: r_model.cpp:32
model_t * R_FindModel(const char *name)
Tries to load a model.
Definition: r_model.cpp:203
obj model loading
#define MAX_QPATH
Definition: filesys.h:40
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
image_t * R_AliasModelState(const model_t *mod, int *mesh, int *frame, int *oldFrame, int *skin)
md2 alias model loading
model_t r_modelsInline[MAX_MOD_KNOWN]
Definition: r_model.cpp:36
brush model
vec_t vec3_t[3]
Definition: ufotypes.h:39
model_t * R_AllocModelSlot(void)
Definition: r_model.cpp:100
float radius
Definition: r_model.h:52
bool R_ModelExists(const char *name)
Definition: r_model.cpp:177
void R_ModModellist_f(void)
Prints all loaded models.
Definition: r_model.cpp:53
void R_ModelShutdown()
Definition: r_model.cpp:440
mBspModel_t bsp
Definition: r_model.h:60