mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-13 07:47:45 +00:00
fix crash from dodgy skies.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4945 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
dca5fee18a
commit
9ecc276ce3
1 changed files with 9 additions and 0 deletions
|
@ -759,6 +759,15 @@ void R_InitSky (shader_t *shader, const char *skyname, qbyte *src, unsigned int
|
||||||
if (width < 1 || height < 1 || stride != width*2)
|
if (width < 1 || height < 1 || stride != width*2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (width*height > countof(trans))
|
||||||
|
{
|
||||||
|
unsigned int wibuf[16] = {0};
|
||||||
|
shader->defaulttextures->base = R_LoadTexture("$blackimage", 4, 4, TF_RGBA32, wibuf, IF_NOMIPMAP|IF_NOPICMIP|IF_NEAREST|IF_NOGAMMA);
|
||||||
|
shader->defaulttextures->base = R_LoadReplacementTexture(skyname, NULL, 0, src, stride, height, TF_SOLID8);
|
||||||
|
shader->defaulttextures->fullbright = shader->defaulttextures->base;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// make an average value for the back to avoid
|
// make an average value for the back to avoid
|
||||||
// a fringe on the top level
|
// a fringe on the top level
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue