From 7203b0ed78930b750ff4cb6066dbde6a333e3293 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sun, 15 Sep 2024 18:34:21 +0300 Subject: [PATCH] models: move load code to separate function --- src/client/refresh/files/models.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/client/refresh/files/models.c b/src/client/refresh/files/models.c index 961b0604..35063a46 100644 --- a/src/client/refresh/files/models.c +++ b/src/client/refresh/files/models.c @@ -3023,11 +3023,9 @@ Mod_LoadMinMaxUpdate(const char *mod_name, vec3_t mins, vec3_t maxs, void *extra 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) +static void * +Mod_LoadModelFile(const char *mod_name, const void *buffer, int modfilelen, + struct image_s ***skins, int *numskins, readfile_t read_file, modtype_t *type) { void *extradata = NULL; @@ -3104,6 +3102,25 @@ Mod_LoadModel(const char *mod_name, const void *buffer, int modfilelen, 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) { Mod_LoadMinMaxUpdate(mod_name, mins, maxs, extradata, *type);