From: havoc Date: Sun, 10 Jul 2005 21:21:47 +0000 (+0000) Subject: turned Mod_CheckLoaded into a #define X-Git-Tag: xonotic-v0.1.0preview~4668 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=10c8faae4d8a148fea59222e87dadd6d72debd45;p=xonotic%2Fdarkplaces.git turned Mod_CheckLoaded into a #define git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5523 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/model_shared.c b/model_shared.c index a85f6196..18f5ae07 100644 --- a/model_shared.c +++ b/model_shared.c @@ -131,7 +131,7 @@ Mod_LoadModel Loads a model ================== */ -static model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel) +model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel) { int num; unsigned int crc; @@ -215,22 +215,6 @@ static model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, return mod; } -void Mod_CheckLoaded(model_t *mod) -{ - if (mod) - { - if (!mod->loaded) - Mod_LoadModel(mod, true, true, mod->isworldmodel); - else - { - //if (mod->type == mod_invalid) - // Host_Error("Mod_CheckLoaded: invalid model\n"); - mod->used = true; - return; - } - } -} - /* =================== Mod_ClearAll diff --git a/model_shared.h b/model_shared.h index 5004a972..0bc49935 100644 --- a/model_shared.h +++ b/model_shared.h @@ -542,7 +542,8 @@ extern qbyte *mod_base; extern cvar_t r_fullbrights; void Mod_Init (void); -void Mod_CheckLoaded (model_t *mod); +#define Mod_CheckLoaded(mod) (mod ? (mod->loaded ? (mod->used = true) : (Mod_LoadModel(mod, true, true, mod->isworldmodel), true)) : false) +model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel); void Mod_ClearAll (void); model_t *Mod_FindName (const char *name); model_t *Mod_ForName (const char *name, qboolean crash, qboolean checkdisk, qboolean isworldmodel);