UFO: Alien Invasion
Loading...
Searching...
No Matches
r_model.h
Go to the documentation of this file.
1
7
8/*
9Copyright (C) 1997-2001 Id Software, Inc.
10
11This program is free software; you can redistribute it and/or
12modify it under the terms of the GNU General Public License
13as published by the Free Software Foundation; either version 2
14of the License, or (at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
20See the GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with this program; if not, write to the Free Software
24Foundation, 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
43typedef struct model_s {
45
47
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
70void R_ModModellist_f(void);
71image_t* R_AliasModelState(const model_t* mod, int* mesh, int* frame, int* oldFrame, int* skin);
72image_t* R_AliasModelGetSkin(const char* modelFileName, const char* skin);
74void R_ShutdownModels(bool complete);
76int R_ModAllocateActorSkin(const char* name);
77void R_LoadActorSkinsFromModel(mAliasMesh_t* outMesh, image_t* defaultSkin);
78bool R_UseActorSkin(void);
79
80model_t* R_FindModel(const char* name);
81bool R_ModelExists(const char* name);
82model_t* R_GetModel(const char* name);
84
85void R_ModelInit();
86void R_ModelShutdown();
87
89extern model_t* r_mapTiles[MAX_MAPTILES];
90extern int r_numMapTiles;
91
93extern int r_numModelsInline;
Definition aabb.h:42
#define MAX_MOD_KNOWN
Definition defines.h:160
#define MAX_QPATH
Definition filesys.h:40
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
int r_numMapTiles
Definition r_model.cpp:33
int r_numModelsInline
Definition r_model.cpp:37
model_t r_modelsInline[MAX_MOD_KNOWN]
Definition r_model.cpp:36
model_t * r_mapTiles[MAX_MAPTILES]
The world model(s).
Definition r_model.cpp:32
bool R_ModelExists(const char *name)
Definition r_model.cpp:177
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
image_t * R_AliasModelState(const model_t *mod, int *mesh, int *frame, int *oldFrame, int *skin)
model_t * R_FindModel(const char *name)
Tries to load a model.
Definition r_model.cpp:203
void R_ModModellist_f(void)
Prints all loaded models.
Definition r_model.cpp:53
void R_ModelInit()
Definition r_model.cpp:436
void R_ModelShutdown()
Definition r_model.cpp:440
int R_ModAllocateActorSkin(const char *name)
Register an actorskin name.
Definition r_model.cpp:332
void R_ShutdownModels(bool complete)
Frees the model pool.
Definition r_model.cpp:391
image_t * R_AliasModelGetSkin(const char *modelFileName, const char *skin)
void R_ModReloadSurfacesArrays(void)
bool R_UseActorSkin(void)
Definition r_model.cpp:342
model_t * R_GetModel(const char *name)
Get a model for the given name already loaded.
Definition r_model.cpp:269
void R_DrawAliasModel(entity_t *e)
Draw a model from the battlescape entity list.
Definition r_mesh.cpp:717
model_t * R_AllocModelSlot(void)
Definition r_model.cpp:100
modtype_t
All supported model formats.
Definition r_model.h:41
@ mod_obj
Definition r_model.h:41
@ mod_bsp
Definition r_model.h:41
@ mod_alias_md3
Definition r_model.h:41
@ mod_bad
Definition r_model.h:41
@ mod_bsp_submodel
Definition r_model.h:41
@ mod_alias_md2
Definition r_model.h:41
Shared alias model functions.
brush model loading
md2 alias model loading
md3 alias model loading
obj model loading
brush model
vec3_t clipmaxs
Definition r_model.h:58
modtype_t type
Definition r_model.h:46
int flags
Definition r_model.h:48
float radius
Definition r_model.h:52
AABB modBox
Definition r_model.h:51
mBspModel_t bsp
Definition r_model.h:60
vec3_t clipmins
Definition r_model.h:58
mAliasModel_t alias
Definition r_model.h:63
bool clipbox
Definition r_model.h:57
char name[MAX_QPATH]
Definition r_model.h:44
bool loaded
Definition r_model.h:54
vec_t vec3_t[3]
Definition ufotypes.h:39