From b2aa5ce554eb0fd1f7120b6bec1bfe489e40f187 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 15 Dec 2011 15:18:07 +0900 Subject: [PATCH] Register the textures of other brush models; --- libs/video/renderer/gl/gl_rmisc.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/libs/video/renderer/gl/gl_rmisc.c b/libs/video/renderer/gl/gl_rmisc.c index a303cfbf5..7de2da56c 100644 --- a/libs/video/renderer/gl/gl_rmisc.c +++ b/libs/video/renderer/gl/gl_rmisc.c @@ -186,6 +186,22 @@ R_Init (void) Fog_Init (); } +static void +register_textures (model_t *model) +{ + int i; + texture_t *tex; + + for (i = 0; i < model->numtextures; i++) { + tex = model->textures[i]; + if (!tex) + continue; + if (tex->texturechain_tail) + continue; + R_AddTexture (tex); + } +} + VISIBLE void R_NewMap (model_t *worldmodel, struct model_s **models, int num_models) { @@ -223,7 +239,13 @@ R_NewMap (model_t *worldmodel, struct model_s **models, int num_models) } if (!strncmp (tex->name, "window02_1", 10)) mirrortexturenum = i; - R_AddTexture (tex); + } + register_textures (r_worldentity.model); + for (i = 0; i < num_models; i++) { + if (!models[i]) + continue; + if (models[i] != r_worldentity.model && models[i]->type == mod_brush) + register_textures (models[i]); } tex = r_notexture_mip; tex->texturechain = NULL;