Fixed crash when loading HLBSP maps that use skyboxes
This commit is contained in:
parent
8fce28734b
commit
b0c1d1ce20
2 changed files with 14 additions and 11 deletions
|
@ -1037,25 +1037,22 @@ void Mod_LoadFaces (lump_t *l)
|
|||
else
|
||||
out->samples = loadmodel->lightdata + i;
|
||||
}
|
||||
// set the drawing flags flag
|
||||
// if (!strncmp(out->texinfo->texture->name,"light",5) || !strncmp(out->texinfo->texture->name,"dem",3)|| !strncmp(out->texinfo->texture->name,"rune",4)) // light hack
|
||||
// {
|
||||
// out->flags |= ( SURF_FLARE);
|
||||
// continue;
|
||||
// }
|
||||
// for the d_mipdetail 64 setting - keep buttons and other small textures sharp while allowing the rest to blur out
|
||||
if (out->texinfo->texture->height < 33 && out->texinfo->texture->width < 33)
|
||||
if ((out->texinfo->texture->height < 33 && out->texinfo->texture->width < 33) && loadmodel->fromgame != fg_halflife)
|
||||
{
|
||||
out->flags |= ( SURF_DONTMIP64);
|
||||
continue;
|
||||
}
|
||||
if (!strncmp(out->texinfo->texture->name,"sky",3)) // sky
|
||||
else if (!strncmp(out->texinfo->texture->name,"sky",3)) // sky
|
||||
{
|
||||
out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED);
|
||||
if(loadmodel->fromgame == fg_halflife) // HLBSP uses external skies
|
||||
out->flags |= SURF_DRAWSKYBOX;
|
||||
else
|
||||
out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!strncmp(out->texinfo->texture->name,"*",1)) // turbulent
|
||||
else if (!strncmp(out->texinfo->texture->name,"*",1)) // turbulent
|
||||
{
|
||||
out->flags |= (SURF_DRAWTURB | SURF_DRAWTILED | SURF_DRAWTRANSLUCENT); // no lava/water check. we're trying to emulate dp/glq behavior here
|
||||
if (strncmp(out->texinfo->texture->name, "*lava", 3))
|
||||
|
|
|
@ -248,6 +248,12 @@ void D_DrawSurfaces (void)
|
|||
D_DrawSkyScans8 (s->spans);
|
||||
D_DrawZSpans (s->spans);
|
||||
}
|
||||
else if (s->flags & SURF_DRAWSKYBOX)
|
||||
{
|
||||
D_DrawSolidSurface (s, (int)r_clearcolor->value & 0xFF);
|
||||
D_DrawZSpans (s->spans);
|
||||
}
|
||||
|
||||
else if (s->flags & SURF_DRAWBACKGROUND)
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in a new issue