[model] Remove empty brush model functions

It seems better to check for a null pointer and just not call.
This commit is contained in:
Bill Currie 2021-01-19 08:26:53 +09:00
parent c7b2843c0e
commit 9b53d7d4e2
7 changed files with 15 additions and 53 deletions

View file

@ -132,11 +132,6 @@ glsl_Mod_ProcessTexture (texture_t *tx)
}
}
void
glsl_Mod_LoadExternalTextures (model_t *mod)
{
}
void
glsl_Mod_LoadLighting (bsp_t *bsp)
{
@ -150,8 +145,3 @@ glsl_Mod_LoadLighting (bsp_t *bsp)
loadmodel->lightdata = Hunk_AllocName (bsp->lightdatasize, loadname);
memcpy (loadmodel->lightdata, bsp->lightdata, bsp->lightdatasize);
}
void
glsl_Mod_SubdivideSurface (msurface_t *fa)
{
}

View file

@ -204,7 +204,7 @@ Mod_LoadTextures (bsp_t *bsp)
if (!strncmp (mt->name, "sky", 3))
loadmodel->skytexture = tx;
if (mod_funcs)
if (mod_funcs && mod_funcs->Mod_ProcessTexture)
mod_funcs->Mod_ProcessTexture (tx);
}
@ -539,7 +539,7 @@ Mod_LoadFaces (bsp_t *bsp)
if (!strncmp (out->texinfo->texture->name, "sky", 3)) { // sky
out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED);
if (gl_sky_divide && gl_sky_divide->int_val)
if (mod_funcs)
if (mod_funcs && mod_funcs->Mod_SubdivideSurface)
mod_funcs->Mod_SubdivideSurface (out);
continue;
}
@ -552,8 +552,10 @@ Mod_LoadFaces (bsp_t *bsp)
out->extents[i] = 16384;
out->texturemins[i] = -8192;
}
if (mod_funcs) // cut up polygon for warps
if (mod_funcs && mod_funcs->Mod_SubdivideSurface) {
// cut up polygon for warps
mod_funcs->Mod_SubdivideSurface (out);
}
continue;
}
}
@ -915,8 +917,9 @@ Mod_LoadBrushModel (model_t *mod, void *buffer)
Mod_LoadEdges (bsp);
Mod_LoadSurfedges (bsp);
Mod_LoadTextures (bsp);
if (mod_funcs)
if (mod_funcs && mod_funcs->Mod_LoadLighting) {
mod_funcs->Mod_LoadLighting (bsp);
}
Mod_LoadPlanes (bsp);
Mod_LoadTexinfo (bsp);
Mod_LoadFaces (bsp);

View file

@ -40,22 +40,6 @@
#include "mod_internal.h"
void
sw_Mod_SubdivideSurface (msurface_t *fa)
{
}
void
sw_Mod_ProcessTexture (texture_t *tx)
{
}
void
sw_Mod_LoadExternalTextures (model_t *mod)
{
}
void
sw_Mod_LoadLighting (bsp_t *bsp)
{

View file

@ -48,26 +48,11 @@ Mod_LoadSpriteModel (model_t *mod, void *buf)
{
}
void
Mod_ProcessTexture (texture_t *tx)
{
}
void
Mod_LoadExternalSkins (model_t *mod)
{
}
void
Mod_LoadExternalTextures (model_t *mod)
{
}
void
Mod_SubdivideSurface (msurface_t *fa)
{
}
viddef_t vid;
VISIBLE void

View file

@ -46,9 +46,9 @@
gl_ctx_t *glsl_ctx;
static vid_model_funcs_t model_funcs = {
glsl_Mod_LoadExternalTextures,
0,//Mod_LoadExternalTextures,
glsl_Mod_LoadLighting,
glsl_Mod_SubdivideSurface,
0,//Mod_SubdivideSurface,
glsl_Mod_ProcessTexture,
Mod_LoadIQM,

View file

@ -39,10 +39,10 @@
sw_ctx_t *sw_ctx;
static vid_model_funcs_t model_funcs = {
sw_Mod_LoadExternalTextures,
0,//Mod_LoadExternalTextures,
sw_Mod_LoadLighting,
sw_Mod_SubdivideSurface,
sw_Mod_ProcessTexture,
0,//Mod_SubdivideSurface,
0,//Mod_ProcessTexture,
Mod_LoadIQM,
Mod_LoadAliasModel,

View file

@ -44,10 +44,10 @@
sw_ctx_t *sw32_ctx;
static vid_model_funcs_t model_funcs = {
sw_Mod_LoadExternalTextures,
0,//Mod_LoadExternalTextures,
sw_Mod_LoadLighting,
sw_Mod_SubdivideSurface,
sw_Mod_ProcessTexture,
0,//Mod_SubdivideSurface,
0,//Mod_ProcessTexture,
Mod_LoadIQM,
Mod_LoadAliasModel,