models: move load code to separate function

This commit is contained in:
Denis Pauk 2024-09-15 18:34:21 +03:00
parent ce98c8a957
commit 7203b0ed78
1 changed files with 22 additions and 5 deletions

View File

@ -3023,11 +3023,9 @@ Mod_LoadMinMaxUpdate(const char *mod_name, vec3_t mins, vec3_t maxs, void *extra
Mod_LoadModel Mod_LoadModel
================= =================
*/ */
void * static void *
Mod_LoadModel(const char *mod_name, const void *buffer, int modfilelen, Mod_LoadModelFile(const char *mod_name, const void *buffer, int modfilelen,
vec3_t mins, vec3_t maxs, struct image_s ***skins, int *numskins, struct image_s ***skins, int *numskins, readfile_t read_file, modtype_t *type)
findimage_t find_image, loadimage_t load_image, readfile_t read_file,
modtype_t *type)
{ {
void *extradata = NULL; void *extradata = NULL;
@ -3104,6 +3102,25 @@ Mod_LoadModel(const char *mod_name, const void *buffer, int modfilelen,
break; break;
} }
return extradata;
}
/*
=================
Mod_LoadModel
=================
*/
void *
Mod_LoadModel(const char *mod_name, const void *buffer, int modfilelen,
vec3_t mins, vec3_t maxs, struct image_s ***skins, int *numskins,
findimage_t find_image, loadimage_t load_image, readfile_t read_file,
modtype_t *type)
{
void *extradata;
extradata = Mod_LoadModelFile(mod_name, buffer, modfilelen, skins, numskins,
read_file, type);
if (extradata) if (extradata)
{ {
Mod_LoadMinMaxUpdate(mod_name, mins, maxs, extradata, *type); Mod_LoadMinMaxUpdate(mod_name, mins, maxs, extradata, *type);