mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-09 06:37:53 +00:00
ref: gl: ignore GenTextures objects that fall into reserved space for skyboxes
This commit is contained in:
parent
1d62df0e2d
commit
1d965d7543
@ -1421,7 +1421,16 @@ static gl_texture_t *GL_AllocTexture( const char *name, texFlags_t flags )
|
|||||||
|
|
||||||
if( FBitSet( flags, TF_SKYSIDE ))
|
if( FBitSet( flags, TF_SKYSIDE ))
|
||||||
tex->texnum = tr.skyboxbasenum++;
|
tex->texnum = tr.skyboxbasenum++;
|
||||||
else pglGenTextures( 1, &tex->texnum );
|
else
|
||||||
|
{
|
||||||
|
// keep generating new texture names to avoid collision with predefined skybox objects
|
||||||
|
do
|
||||||
|
{
|
||||||
|
pglGenTextures( 1, &tex->texnum );
|
||||||
|
}
|
||||||
|
while( tex->texnum >= SKYBOX_BASE_NUM &&
|
||||||
|
tex->texnum <= SKYBOX_BASE_NUM + SKYBOX_MAX_SIDES );
|
||||||
|
}
|
||||||
|
|
||||||
tex->flags = flags;
|
tex->flags = flags;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user