mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 06:51:47 +00:00
don't segfault when a surface uses the `null' texture (r_notexture_mip)
This commit is contained in:
parent
a431a2783c
commit
4123d74e5e
2 changed files with 11 additions and 2 deletions
|
@ -170,6 +170,7 @@ R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
|
||||||
{
|
{
|
||||||
cvar_t *r_skyname;
|
cvar_t *r_skyname;
|
||||||
int i;
|
int i;
|
||||||
|
texture_t *tex;
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
d_lightstylevalue[i] = 264; // normal light value
|
d_lightstylevalue[i] = 264; // normal light value
|
||||||
|
@ -190,7 +191,7 @@ R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
|
||||||
skytexturenum = -1;
|
skytexturenum = -1;
|
||||||
mirrortexturenum = -1;
|
mirrortexturenum = -1;
|
||||||
for (i = 0; i < r_worldentity.model->numtextures; i++) {
|
for (i = 0; i < r_worldentity.model->numtextures; i++) {
|
||||||
texture_t *tex = r_worldentity.model->textures[i];
|
tex = r_worldentity.model->textures[i];
|
||||||
if (!tex)
|
if (!tex)
|
||||||
continue;
|
continue;
|
||||||
if (!strncmp (tex->name, "sky", 3))
|
if (!strncmp (tex->name, "sky", 3))
|
||||||
|
@ -200,6 +201,10 @@ R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
|
||||||
tex->texturechain = NULL;
|
tex->texturechain = NULL;
|
||||||
tex->texturechain_tail = &tex->texturechain;
|
tex->texturechain_tail = &tex->texturechain;
|
||||||
}
|
}
|
||||||
|
tex = r_notexture_mip;
|
||||||
|
tex->texturechain = NULL;
|
||||||
|
tex->texturechain_tail = &tex->texturechain;
|
||||||
|
|
||||||
r_skyname = Cvar_FindVar ("r_skyname");
|
r_skyname = Cvar_FindVar ("r_skyname");
|
||||||
if (r_skyname != NULL)
|
if (r_skyname != NULL)
|
||||||
R_LoadSkys (r_skyname->string);
|
R_LoadSkys (r_skyname->string);
|
||||||
|
|
|
@ -244,11 +244,12 @@ DrawTextureChains (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
msurface_t *s;
|
msurface_t *s;
|
||||||
|
texture_t *tex;
|
||||||
|
|
||||||
qfglDisable (GL_BLEND);
|
qfglDisable (GL_BLEND);
|
||||||
|
|
||||||
for (i = 0; i < r_worldentity.model->numtextures; i++) {
|
for (i = 0; i < r_worldentity.model->numtextures; i++) {
|
||||||
texture_t *tex = r_worldentity.model->textures[i];
|
tex = r_worldentity.model->textures[i];
|
||||||
if (!tex)
|
if (!tex)
|
||||||
continue;
|
continue;
|
||||||
qfglBindTexture (GL_TEXTURE_2D, tex->gl_texturenum);
|
qfglBindTexture (GL_TEXTURE_2D, tex->gl_texturenum);
|
||||||
|
@ -258,6 +259,9 @@ DrawTextureChains (void)
|
||||||
tex->texturechain = NULL;
|
tex->texturechain = NULL;
|
||||||
tex->texturechain_tail = &tex->texturechain;
|
tex->texturechain_tail = &tex->texturechain;
|
||||||
}
|
}
|
||||||
|
tex = r_notexture_mip;
|
||||||
|
tex->texturechain = NULL;
|
||||||
|
tex->texturechain_tail = &tex->texturechain;
|
||||||
|
|
||||||
qfglEnable (GL_BLEND);
|
qfglEnable (GL_BLEND);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue