model loading and caching More...
#include "r_local.h"
Go to the source code of this file.
Defines | |
#define | MEM_TAG_STATIC_MODELS 1 |
Functions | |
void | R_ModModellist_f (void) |
Prints all loaded models. | |
static model_t * | R_ModForName (const char *name, qboolean crash) |
Loads in a model for the given name. | |
model_t * | R_RegisterModelShort (const char *name) |
Tries to load a model. | |
void | R_SwitchModelMemPoolTag (void) |
After all static models are loaded, switch the pool tag for these models to not free them everytime R_ShutdownModels is called. | |
void | R_ShutdownModels (qboolean complete) |
Frees the model pool. | |
Variables | |
model_t | r_models [MAX_MOD_KNOWN] |
int | r_numModels |
static int | r_numModelsStatic |
model_t * | r_mapTiles [MAX_MAPTILES] |
The world model(s). | |
int | r_numMapTiles |
model_t | r_modelsInline [MAX_MOD_KNOWN] |
int | r_numModelsInline |
static const char * | mod_extensions [] |
all supported model formats |
model loading and caching
Definition in file r_model.c.
#define MEM_TAG_STATIC_MODELS 1 |
Definition at line 221 of file r_model.c.
Referenced by R_SwitchModelMemPoolTag().
Loads in a model for the given name.
[in] | name | Filename relative to base dir and with extension (models/model.md2) |
Definition at line 97 of file r_model.c.
References byte, Com_Error(), DPMHEADER, ERR_FATAL, FS_FreeFile(), FS_LoadFile(), i, IDALIASHEADER, IDBSPHEADER, IDMD3HEADER, LittleLong(), MAX_MOD_KNOWN, model_s::name, Q_strcasecmp, Q_strncpyz(), qtrue, R_LoadObjModel(), R_ModLoadAliasDPMModel(), R_ModLoadAliasMD2Model(), R_ModLoadAliasMD3Model(), r_numModels, and r_numModelsInline.
Referenced by R_RegisterModelShort().
void R_ModModellist_f | ( | void | ) |
Prints all loaded models.
Definition at line 42 of file r_model.c.
References model_s::alias, Com_Printf(), i, mAliasModel_s::meshes, mod_alias_dpm, mod_alias_md2, mod_alias_md3, mod_bsp, mod_bsp_submodel, mod_obj, mAliasSkin_s::name, model_s::name, mAliasModel_s::num_meshes, mAliasMesh_s::num_skins, mAliasMesh_s::num_tris, r_numMapTiles, r_numModels, r_numModelsInline, r_numModelsStatic, mAliasSkin_s::skin, mAliasMesh_s::skins, image_s::texnum, image_s::type, and model_s::type.
model_t* R_RegisterModelShort | ( | const char * | name | ) | [read] |
Tries to load a model.
[in] | name | The model path or name (with or without extension) - see notes this parameter is always relativ to the game base dir - it can also be relative to the models/ dir in the game folder |
Definition at line 197 of file r_model.c.
References Com_Printf(), Com_sprintf(), i, MAX_QPATH, mod_extensions, qfalse, and R_ModForName().
Referenced by CL_AddBrushModel(), CL_ParseConfigString(), CL_ParticleLoadArt(), CL_PrecacheCharacterModels(), CL_ViewLoadMedia(), CL_ViewPrecacheModels(), LM_Register(), R_Draw2DMapMarkers(), R_Draw3DMapMarkers(), R_DrawModelDirect(), SEQ_ExecuteModel(), SEQ_ExecutePrecache(), UI_DrawModelNode(), and UI_DrawModelNodeWithUIModel().
void R_ShutdownModels | ( | qboolean | complete | ) |
Frees the model pool.
complete | If this is true the static mesh models are freed, too |
Definition at line 261 of file r_model.c.
References model_s::bsp, i, mBspModel_s::lmtexcoord_buffer, Mem_FreePool, Mem_FreeTag, mBspModel_s::normal_buffer, r_numModels, r_numModelsStatic, mBspModel_s::tangent_buffer, mBspModel_s::texcoord_buffer, mBspModel_s::vertex_buffer, vid_lightPool, and vid_modelPool.
Referenced by CL_Disconnect(), and R_Shutdown().
void R_SwitchModelMemPoolTag | ( | void | ) |
After all static models are loaded, switch the pool tag for these models to not free them everytime R_ShutdownModels is called.
Definition at line 228 of file r_model.c.
References model_s::alias, Com_Printf(), i, it_static, Mem_ChangeTag, MEM_TAG_STATIC_MODELS, mAliasModel_s::meshes, model_s::name, mAliasModel_s::num_meshes, mAliasMesh_s::num_skins, r_noTexture, r_numModels, r_numModelsStatic, mAliasSkin_s::skin, mAliasMesh_s::skins, image_s::type, and vid_modelPool.
Referenced by CL_ViewPrecacheModels().
const char* mod_extensions[] [static] |
{ "md2", "md3", "dpm", "obj", NULL }
all supported model formats
Definition at line 181 of file r_model.c.
Referenced by R_RegisterModelShort().
model_t* r_mapTiles[MAX_MAPTILES] |
The world model(s).
Definition at line 32 of file r_model.c.
Referenced by R_CreateMaterialData(), R_DrawBspNormals(), R_DrawSurfaceStage(), R_GetLevelSurfaceLists(), R_LoadSurfacesArrays(), R_ModAddMapTile(), R_ModReloadSurfacesArrays(), R_RecursiveWorldNode(), R_RenderFrame(), and R_SetSurfaceState().
Definition at line 28 of file r_model.c.
Referenced by R_ModAddMapTile().
model_t r_modelsInline[MAX_MOD_KNOWN] |
Definition at line 36 of file r_model.c.
Referenced by R_CreateMaterialData(), R_LoadSurfacesArrays(), and R_SetupSubmodels().
int r_numMapTiles |
Definition at line 33 of file r_model.c.
Referenced by R_CreateMaterialData(), R_GetLevelSurfaceLists(), R_LoadSurfacesArrays(), R_ModAddMapTile(), R_ModBeginLoading(), R_ModLoadSurfaces(), R_ModModellist_f(), R_ModReloadSurfacesArrays(), R_RenderFrame(), R_SetupSubmodels(), and R_Trace().
int r_numModels |
Definition at line 29 of file r_model.c.
Referenced by R_ModAddMapTile(), R_ModForName(), R_ModModellist_f(), R_ShutdownModels(), and R_SwitchModelMemPoolTag().
Definition at line 37 of file r_model.c.
Referenced by R_CreateMaterialData(), R_LoadSurfacesArrays(), R_ModBeginLoading(), R_ModForName(), R_ModModellist_f(), and R_SetupSubmodels().
int r_numModelsStatic [static] |
Definition at line 30 of file r_model.c.
Referenced by R_ModModellist_f(), R_ShutdownModels(), and R_SwitchModelMemPoolTag().